Imports
/- Copyright (c) 2026 Google LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. -/ module public import Cryptids.ReductionSupport.Riemann.WordGuard
@[expose] public sectionnamespace ConjectureMachines.Riemann95.Schemaabbrev Word := List (Fin 2)open ConjectureMachines.Riemann104.OnePassGuarddef callerPrefix : Nat → Word | 0 => [1,1,1,1,1,0] | d+1 => callerPrefix d ++ [1,1,1,1,0]def entry (d : Nat) : Word := (callerPrefix d).dropLastdef suffixes : Array Word := #[[1], [1,0,0,1], [1,0,0,1,1], [1,0,0,1,1,1], [1,0,1], [1,0,1,1], [1,0,1,1,1], [1,1], [1,1,0,0,1], [1,1,0,0,1,1], [1,1,0,0,1,1,1], [1,1,0,1], [1,1,0,1,1], [1,1,0,1,1,1], [1,1,1], [1,1,1,0,0,1], [1,1,1,0,0,1,1], [1,1,1,0,0,1,1,1], [1,1,1,0,1], [1,1,1,0,1,1], [1,1,1,0,1,1,1], [1,1,1,1,1]]def outsideWords : Array Word := #[[], [0,1], [0,1,1], [1], [1,0,0,1], [1,0,0,1,0,0,1], [1,0,0,1,0,0,1,1], [1,0,0,1,0,1], [1,0,0,1,0,1,0,1], [1,0,0,1,0,1,0,1,1], [1,0,0,1,0,1,1], [1,0,0,1,0,1,1,1], [1,0,0,1,0,1,1,1,0,0,1], [1,0,0,1,0,1,1,1,0,0,1,1], [1,0,0,1,0,1,1,1,0,1], [1,0,0,1,0,1,1,1,0,1,0,1], [1,0,0,1,0,1,1,1,0,1,0,1,1], [1,0,0,1,0,1,1,1,0,1,1], [1,0,0,1,0,1,1,1,1], [1,0,0,1,1], [1,0,0,1,1,0,1], [1,0,0,1,1,0,1,1], [1,0,0,1,1,0,1,1,0,1], [1,0,0,1,1,0,1,1,0,1,1], [1,0,0,1,1,0,1,1,1], [1,0,0,1,1,0,1,1,1,0,0,1], [1,0,0,1,1,0,1,1,1,0,0,1,1], [1,0,0,1,1,0,1,1,1,0,0,1,1,1], [1,0,0,1,1,0,1,1,1,0,1],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,1,0,1,1], [1,1,1,0,0,1,0,1,1,1,0,1,1], [1,1,1,0,0,1,0,1,1,1,1], [1,1,1,0,0,1,1], [1,1,1,0,0,1,1,0,1], [1,1,1,0,0,1,1,1], [1,1,1,0,1], [1,1,1,0,1,1], [1,1,1,0,1,1,1], [1,1,1,1], [1,1,1,1,0,0,1], [1,1,1,1,0,0,1,1], [1,1,1,1,0,0,1,1,1], [1,1,1,1,0,1], [1,1,1,1,0,1,1], [1,1,1,1,0,1,1,1], [1,1,1,1,1,1], [1,1,1,1,1,1,1]]def localWalkSuffixes : Array Word := #[[1,0,0,0], [1,0,0,1,0], [1,0,0,1,1,0], [1,0,0,1,1], [1,0,1,0], [1,0,1,1,0], [1,0,1,1], [1,1,0,0,0], [1,1,0,0,1,0], [1,1,0,0,1,1,0], [1,1,0,0,1,1], [1,1,0,1,0], [1,1,0,1,1,0], [1,1,0,1,1], [1,1,1,0,0,0], [1,1,1,0,0,1,0], [1,1,1,0,0,1,1,0], [1,1,1,0,0,1,1], [1,1,1,0,1,0], [1,1,1,0,1,1,0], [1,1,1,0,1,1], [1,1,1,1,1]]def outsideWalked : Array Word := #[[0,0], [0,1,0], [0,1], [1,0,0,0], [1,0,0,1,0,0,0], [1,0,0,1,0,0,1,0], [1,0,0,1,0,0,1], [1,0,0,1,0,1,0,0], [1,0,0,1,0,1,0,1,0], [1,0,0,1,0,1,0,1], [1,0,0,1,0,1,1,0], [1,0,0,1,0,1,1,1,0,0,0], [1,0,0,1,0,1,1,1,0,0,1,0], [1,0,0,1,0,1,1,1,0,0,1], [1,0,0,1,0,1,1,1,0,1,0,0], [1,0,0,1,0,1,1,1,0,1,0,1,0], [1,0,0,1,0,1,1,1,0,1,0,1], [1,0,0,1,0,1,1,1,0,1,1], [1,0,0,1,0,1,1,1], [1,0,0,1,1,0,0], [1,0,0,1,1,0,1,0], [1,0,0,1,1,0,1,1,0,0], [1,0,0,1,1,0,1,1,0,1,0], [1,0,0,1,1,0,1,1,0,1], [1,0,0,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0,1,0,1,0,1], [1,1,1,0,0,1,0,1,1,0], [1,1,1,0,0,1,0,1,1,1,0,0,0], [1,1,1,0,0,1,0,1,1,1,0,0,1,0], [1,1,1,0,0,1,0,1,1,1,0,0,1], [1,1,1,0,0,1,0,1,1,1,0,1,0,0], [1,1,1,0,0,1,0,1,1,1,0,1,0,1,0], [1,1,1,0,0,1,0,1,1,1,0,1,0,1], [1,1,1,0,0,1,0,1,1,1,0,1,1], [1,1,1,0,0,1,0,1,1,1], [1,1,1,0,0,1,1,0,0], [1,1,1,0,0,1,1,0], [1,1,1,0,0,1,1], [1,1,1,0,1,0], [1,1,1,0,1,1,0], [1,1,1,0,1,1], [1,1,1,1,0,0,0], [1,1,1,1,0,0,1,0], [1,1,1,1,0,0,1,1,0], [1,1,1,1,0,0,1,1], [1,1,1,1,0,1,0], [1,1,1,1,0,1,1,0], [1,1,1,1,0,1,1], [1,1,1,1,1,1,0], [1,1,1,1,1,1]]def suffix (s : Fin 22) : Word := suffixes.getD s.val []def outsideWord (s : Fin 97) : Word := outsideWords.getD s.val []def localWalkSuffix (s : Fin 22) : Word := localWalkSuffixes.getD s.val []def outsideWalk (s : Fin 97) : Word := outsideWalked.getD s.val []inductive ControlWord where | outside (id : Fin 97) | entry (depth : Nat) | local (depth : Nat) (id : Fin 22) deriving DecidableEq, Reprdef word : ControlWord → Word | .outside s => outsideWord s | .entry d => entry d | .local d s => callerPrefix d ++ suffix sdef localWalk (d : Nat) (s : Fin 22) : Word := callerPrefix d ++ localWalkSuffix stheorem outside_noThree : ∀ s : Fin 97, NoThreeZeros (1 :: outsideWord s) = true ∧ NoThreeZeros (1 :: outsideWord s).reverse = true := ⊢ ∀ (s : Fin 97), NoThreeZeros (1 :: outsideWord s) = true ∧ NoThreeZeros (1 :: outsideWord s).reverse = true All goals completed! 🐙theorem localWalkSuffix_length : ∀ s : Fin 22, (localWalkSuffix s).length ≤ 8 := ⊢ ∀ (s : Fin 22), List.length (localWalkSuffix s) ≤ 8 All goals completed! 🐙theorem outsideWalk_length : ∀ s : Fin 97, (outsideWalk s).length ≤ 16 := ⊢ ∀ (s : Fin 97), List.length (outsideWalk s) ≤ 16 All goals completed! 🐙theorem callerPrefix_length (d : Nat) : (callerPrefix d).length = 5*d+6 := d:ℕ⊢ List.length (callerPrefix d) = 5 * d + 6 induction d with ⊢ List.length (callerPrefix 0) = 5 * 0 + 6 All goals completed! 🐙 d:ℕih:List.length (callerPrefix d) = 5 * d + 6⊢ List.length (callerPrefix (d + 1)) = 5 * (d + 1) + 6 d:ℕih:List.length (callerPrefix d) = 5 * d + 6⊢ 5 * d + 6 + [1, 1, 1, 1, 0].length = 5 * (d + 1) + 6; d:ℕih:List.length (callerPrefix d) = 5 * d + 6⊢ 5 * d + 5 = 5 * (d + 1); All goals completed! 🐙theorem entry_length (d : Nat) : (entry d).length = 5*d+5 := d:ℕ⊢ List.length (entry d) = 5 * d + 5 d:ℕ⊢ 5 * d + 6 - 1 = 5 * d + 5 All goals completed! 🐙theorem localWalk_length (d : Nat) (s : Fin 22) : (localWalk d s).length ≤ 5*d+14 := d:ℕs:Fin 22⊢ List.length (localWalk d s) ≤ 5 * d + 14 d:ℕs:Fin 22⊢ 5 * d + 6 + List.length (localWalkSuffix s) ≤ 5 * d + 14 d:ℕs:Fin 22h:List.length (localWalkSuffix s) ≤ 8⊢ 5 * d + 6 + List.length (localWalkSuffix s) ≤ 5 * d + 14 All goals completed! 🐙end ConjectureMachines.Riemann95.Schema