Skip to content

Commit 0ecdc36

Browse files
committed
G_to_J
1 parent d70cf67 commit 0ecdc36

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

CollatzFunction/NonHalt/Main.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ cases n with
9090
rw [← List.replicate_succ] at h
9191
apply copy_half at h
9292
rw [← (ListBlank_empty_eq_single_zero (List.replicate _ one))] at h
93-
apply lemma_G_to_H at h
94-
apply lemma_H_to_J at h
93+
apply G_to_J at h
9594
forward h
9695
forward h
9796
use (11 + j + n / 2 * 13 + (n / 2) ^ 2 * 4)

CollatzFunction/NonHalt/Odd.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ nth_cfg init_cfg (3 + i + b * 2) = ⟨G, ⟨one,
1414
Turing.ListBlank.mk (List.replicate a one),
1515
Turing.ListBlank.mk (List.replicate (b+2) one)⟩⟩
1616
:= by
17-
have g := lemma_G_to_H [] b
17+
have g := G_to_J [] b
1818
rw [ListBlank_empty_eq_single_zero] at g
1919
apply g at h
20-
apply lemma_H_to_J at h
2120
forward h
2221
simp [h]
2322
rw [← List.cons_append]

CollatzFunction/NonHalt/Transition.lean

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace NonHalt
55

66
open Lean Meta Elab Tactic Std Term TmState Γ
77

8-
theorem lemma_G_to_H (r: List Γ)(r1: ℕ)(i : ℕ)(l: List Γ)(init_cfg: Cfg)
8+
private lemma G_to_H (r: List Γ)(r1: ℕ)(i : ℕ)(l: List Γ)(init_cfg: Cfg)
99
(h :
1010
nth_cfg init_cfg i = ⟨G, ⟨Γ.one,
1111
Turing.ListBlank.mk l,
@@ -22,7 +22,7 @@ cases r1 with
2222
ring_nf at *
2323
simp [h]
2424

25-
theorem lemma_H_to_J (r: List Γ)(r1: ℕ)(i : ℕ)(l: List Γ)(init_cfg: Cfg)
25+
private lemma H_to_J (r: List Γ)(r1: ℕ)(i : ℕ)(l: List Γ)(init_cfg: Cfg)
2626
(h :
2727
nth_cfg init_cfg i = ⟨H, ⟨Γ.zero,
2828
Turing.ListBlank.mk (List.replicate r1 Γ.one ++ List.cons Γ.zero r),
@@ -39,4 +39,18 @@ cases r1 with
3939
ring_nf at *
4040
simp [h]
4141

42+
theorem G_to_J (r: List Γ)(r1: ℕ)(i : ℕ)(l: List Γ)(init_cfg: Cfg)
43+
(h :
44+
nth_cfg init_cfg i = ⟨G, ⟨Γ.one,
45+
Turing.ListBlank.mk l,
46+
Turing.ListBlank.mk (List.replicate r1 Γ.one ++ List.cons Γ.zero r)⟩⟩) :
47+
nth_cfg init_cfg (2+i+r1*2) = ⟨J, ⟨Γ.zero,
48+
Turing.ListBlank.mk l,
49+
Turing.ListBlank.mk (List.replicate r1 Γ.one ++ List.cons Γ.one r)⟩⟩
50+
:= by
51+
apply G_to_H at h
52+
apply H_to_J at h
53+
ring_nf at h
54+
simp [h]
55+
4256
end NonHalt

0 commit comments

Comments
 (0)