Skip to content

Commit

Permalink
namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
lengyijun committed Oct 16, 2024
1 parent 5786d79 commit e024761
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions GoldbachTm/Tm31/Content.lean
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import GoldbachTm.Tm31.TuringMachine31
import GoldbachTm.Tm31.PBP
import Mathlib.Data.Nat.Prime.Defs

namespace Tm31

theorem lemma_25 (n : ℕ) (i : ℕ)
(g :
nth_cfg i = some ⟨⟨25, by omega⟩, ⟨Γ.zero, Turing.ListBlank.mk (List.replicate (n+4) Γ.one), Turing.ListBlank.mk []⟩⟩ )
Expand Down Expand Up @@ -111,3 +113,5 @@ intros h
by_contra! g
apply halt_lemma_rev' at g
tauto

end Tm31
4 changes: 4 additions & 0 deletions GoldbachTm/Tm31/PBP.lean
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import GoldbachTm.Tm31.Search0
import GoldbachTm.Tm31.Prime
import Mathlib.Data.Nat.Prime.Defs

namespace Tm31

-- l1 : count of 1 on the left
-- r1 : count of 1 on the right
theorem lemma_26 (i l1 r1: ℕ)
Expand Down Expand Up @@ -283,3 +285,5 @@ induction l1 with
simp at hpp
ring_nf
by_cases Nat.Prime (2+l1) <;> tauto

end Tm31
4 changes: 4 additions & 0 deletions GoldbachTm/Tm31/Prime.lean
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import GoldbachTm.Tm31.Transition
import Mathlib.Data.Nat.Prime.Defs
import Mathlib.Data.Nat.ModEq

namespace Tm31

-- c1++, c2++
-- l 0 [la 11] 0 [lb 11] 0 [ra 11111] 0 [(rb+1) 1] 0 r
-- c1 ^ c2
Expand Down Expand Up @@ -466,3 +468,5 @@ match r1 with
have g : 1 + r1.succ.succ.succ = 4+r1 := by omega
rw [g] at h
exact h

end Tm31
3 changes: 3 additions & 0 deletions GoldbachTm/Tm31/Search0.lean
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-- all these states' usage is to search 0
import GoldbachTm.Tm31.TuringMachine31

namespace Tm31

-- left
theorem rec5 (k : ℕ): ∀ (i : ℕ) (l r : List Γ),
Expand Down Expand Up @@ -197,3 +198,5 @@ induction k with intros i l r h
rw [g, induction_step]
. simp [List.replicate_succ' (k+1)]
. simp! [nth_cfg, h, step, machine, Turing.Tape.write, Turing.Tape.move]

end Tm31
2 changes: 2 additions & 0 deletions GoldbachTm/Tm31/Sim31.lean
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import GoldbachTm.Tm31.TuringMachine31
import GoldbachTm.Basic

open Tm31

unsafe def foo (cfg : Cfg) : IO Unit :=
match (step machine cfg) with
| some cfg => do
Expand Down
4 changes: 4 additions & 0 deletions GoldbachTm/Tm31/Transition.lean
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import GoldbachTm.Tm31.TuringMachine31
import GoldbachTm.Tm31.Search0

namespace Tm31

theorem lemma_12_to_13 (i : ℕ) (r1: ℕ) (l r : List Γ)
(h :
nth_cfg i = some ⟨⟨12, by omega⟩, ⟨Γ.zero,
Expand Down Expand Up @@ -107,3 +109,5 @@ cases l1 with
simp [h]
rw [List.append_cons, ← List.replicate_succ']
ring_nf

end Tm31
4 changes: 4 additions & 0 deletions GoldbachTm/Tm31/TuringMachine31.lean
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import GoldbachTm.Basic
import GoldbachTm.Format
import GoldbachTm.ListBlank

namespace Tm31

def Machine := Fin 31 → Γ → Option (Fin 31 × Stmt)

structure Cfg where
Expand Down Expand Up @@ -127,3 +129,5 @@ forward h h 3
forward h h 4
forward h h 5
assumption

end Tm31

0 comments on commit e024761

Please sign in to comment.