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.Riemann95Definition public import Cryptids.ReductionSupport.Riemann95.Auxiliary95
@[expose] public sectionnamespace ConjectureMachines.Riemann95.Projectionopen Turing ConjectureMachinesdef cfgMap (c : Cfg 98 2) : Cfg 95 2 := ⟨stateMap c.state, c.tape⟩theorem transition_map : ∀ (q : Fin 98) (a : Fin 2), machine.transition (stateMap q) a = (Riemann95Auxiliary.machine.transition q a).map (fun e => (e.1, e.2.1, stateMap e.2.2)) := ⊢ ∀ (q : Fin 98) (a : Fin 2), machine.transition (stateMap q) a = Option.map (fun e ↦ (e.1, e.2.1, stateMap e.2.2)) (Riemann95Auxiliary.machine.transition q a) q:Fin 98a:Fin 2⊢ machine.transition (stateMap q) a = Option.map (fun e ↦ (e.1, e.2.1, stateMap e.2.2)) (Riemann95Auxiliary.machine.transition q a) q:Fin 98a:Fin 2⊢ machine.transition (stateMap q) a = Option.map (fun e ↦ (e.1, e.2.1, stateMap e.2.2)) (Option.map (fun e ↦ (e.1, e.2.1, liftState e.2.2)) (machine.transition (stateMap q) a)) cases machine.transition (stateMap q) a with q:Fin 98a:Fin 2⊢ none = Option.map (fun e ↦ (e.1, e.2.1, stateMap e.2.2)) (Option.map (fun e ↦ (e.1, e.2.1, liftState e.2.2)) none) All goals completed! 🐙 q:Fin 98a:Fin 2e:Fin 2 × Dir × Fin 95⊢ some e = Option.map (fun e ↦ (e.1, e.2.1, stateMap e.2.2)) (Option.map (fun e ↦ (e.1, e.2.1, liftState e.2.2)) (some e)) q:Fin 98a:Fin 2b:Fin 2d:Dirq':Fin 95⊢ some (b, d, q') = Option.map (fun e ↦ (e.1, e.2.1, stateMap e.2.2)) (Option.map (fun e ↦ (e.1, e.2.1, liftState e.2.2)) (some (b, d, q'))) All goals completed! 🐙theorem step_map (c : Cfg 98 2) : step machine (cfgMap c) = (step Riemann95Auxiliary.machine c).map cfgMap := c:Cfg 98 2⊢ step machine (cfgMap c) = Option.map cfgMap (step Riemann95Auxiliary.machine c) q:Fin 98tape:Tape (Fin 2)⊢ step machine (cfgMap { state := q, tape := tape }) = Option.map cfgMap (step Riemann95Auxiliary.machine { state := q, tape := tape }) q:Fin 98tape:Tape (Fin 2)⊢ (match { state := stateMap { state := q, tape := tape }.state, tape := { state := q, tape := tape }.tape } with | { state := q, tape := T } => Option.map (fun x ↦ match x with | (a, d, q') => { state := q', tape := Tape.move d (Tape.write a T) }) (machine.transition q T.head)) = Option.map (fun c ↦ { state := stateMap c.state, tape := c.tape }) (match { state := q, tape := tape } with | { state := q, tape := T } => Option.map (fun x ↦ match x with | (a, d, q') => { state := q', tape := Tape.move d (Tape.write a T) }) (Riemann95Auxiliary.machine.transition q T.head)) q:Fin 98tape:Tape (Fin 2)⊢ Option.map (fun x ↦ { state := x.2.2, tape := Tape.move x.2.1 (Tape.write x.1 tape) }) (machine.transition (stateMap q) tape.head) = Option.map (fun c ↦ { state := stateMap c.state, tape := c.tape }) (Option.map (fun x ↦ { state := x.2.2, tape := Tape.move x.2.1 (Tape.write x.1 tape) }) (Riemann95Auxiliary.machine.transition q tape.head)) q:Fin 98tape:Tape (Fin 2)⊢ Option.map (fun x ↦ { state := x.2.2, tape := Tape.move x.2.1 (Tape.write x.1 tape) }) (Option.map (fun e ↦ (e.1, e.2.1, stateMap e.2.2)) (Riemann95Auxiliary.machine.transition q tape.head)) = Option.map (fun c ↦ { state := stateMap c.state, tape := c.tape }) (Option.map (fun x ↦ { state := x.2.2, tape := Tape.move x.2.1 (Tape.write x.1 tape) }) (Riemann95Auxiliary.machine.transition q tape.head)) cases h : Riemann95Auxiliary.machine.transition q tape.head with q:Fin 98tape:Tape (Fin 2)h:Riemann95Auxiliary.machine.transition q tape.head = none⊢ Option.map (fun x ↦ { state := x.2.2, tape := Tape.move x.2.1 (Tape.write x.1 tape) }) (Option.map (fun e ↦ (e.1, e.2.1, stateMap e.2.2)) none) = Option.map (fun c ↦ { state := stateMap c.state, tape := c.tape }) (Option.map (fun x ↦ { state := x.2.2, tape := Tape.move x.2.1 (Tape.write x.1 tape) }) none) All goals completed! 🐙 q:Fin 98tape:Tape (Fin 2)e:Fin 2 × Dir × Fin 98h:Riemann95Auxiliary.machine.transition q tape.head = some e⊢ Option.map (fun x ↦ { state := x.2.2, tape := Tape.move x.2.1 (Tape.write x.1 tape) }) (Option.map (fun e ↦ (e.1, e.2.1, stateMap e.2.2)) (some e)) = Option.map (fun c ↦ { state := stateMap c.state, tape := c.tape }) (Option.map (fun x ↦ { state := x.2.2, tape := Tape.move x.2.1 (Tape.write x.1 tape) }) (some e)) q:Fin 98tape:Tape (Fin 2)b:Fin 2d:Dirq':Fin 98h:Riemann95Auxiliary.machine.transition q tape.head = some (b, d, q')⊢ Option.map (fun x ↦ { state := x.2.2, tape := Tape.move x.2.1 (Tape.write x.1 tape) }) (Option.map (fun e ↦ (e.1, e.2.1, stateMap e.2.2)) (some (b, d, q'))) = Option.map (fun c ↦ { state := stateMap c.state, tape := c.tape }) (Option.map (fun x ↦ { state := x.2.2, tape := Tape.move x.2.1 (Tape.write x.1 tape) }) (some (b, d, q'))); All goals completed! 🐙theorem nSteps_map (n : Nat) (c : Cfg 98 2) : nSteps n (cfgMap c) = (Riemann95Auxiliary.nSteps n c).map cfgMap := n:ℕc:Cfg 98 2⊢ nSteps n (cfgMap c) = Option.map cfgMap (Riemann95Auxiliary.nSteps n c) induction n generalizing c with c:Cfg 98 2⊢ nSteps 0 (cfgMap c) = Option.map cfgMap (Riemann95Auxiliary.nSteps 0 c) All goals completed! 🐙 n:ℕih:∀ (c : Cfg 98 2), nSteps n (cfgMap c) = Option.map cfgMap (Riemann95Auxiliary.nSteps n c)c:Cfg 98 2⊢ nSteps (n + 1) (cfgMap c) = Option.map cfgMap (Riemann95Auxiliary.nSteps (n + 1) c) n:ℕih:∀ (c : Cfg 98 2), nSteps n (cfgMap c) = Option.map cfgMap (Riemann95Auxiliary.nSteps n c)c:Cfg 98 2⊢ (Option.map cfgMap (step Riemann95Auxiliary.machine c)).bind (nSteps n) = Option.map cfgMap ((step Riemann95Auxiliary.machine c).bind (Riemann95Auxiliary.nSteps n)) cases h : step Riemann95Auxiliary.machine c with n:ℕih:∀ (c : Cfg 98 2), nSteps n (cfgMap c) = Option.map cfgMap (Riemann95Auxiliary.nSteps n c)c:Cfg 98 2h:step Riemann95Auxiliary.machine c = none⊢ (Option.map cfgMap none).bind (nSteps n) = Option.map cfgMap (none.bind (Riemann95Auxiliary.nSteps n)) All goals completed! 🐙 n:ℕih:∀ (c : Cfg 98 2), nSteps n (cfgMap c) = Option.map cfgMap (Riemann95Auxiliary.nSteps n c)c:Cfg 98 2c':Cfg 98 2h:step Riemann95Auxiliary.machine c = some c'⊢ (Option.map cfgMap (some c')).bind (nSteps n) = Option.map cfgMap ((some c').bind (Riemann95Auxiliary.nSteps n)) All goals completed! 🐙theorem of_aux {n : Nat} {c c' : Cfg 98 2} (h : Riemann95Auxiliary.nSteps n c = some c') : nSteps n (cfgMap c) = some (cfgMap c') := n:ℕc:Cfg 98 2c':Cfg 98 2h:Riemann95Auxiliary.nSteps n c = some c'⊢ nSteps n (cfgMap c) = some (cfgMap c') n:ℕc:Cfg 98 2c':Cfg 98 2h:Riemann95Auxiliary.nSteps n c = some c'⊢ Option.map cfgMap (some c') = some (cfgMap c') All goals completed! 🐙end ConjectureMachines.Riemann95.Projection