-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDivseq2.lean
More file actions
91 lines (88 loc) · 5.13 KB
/
Divseq2.lean
File metadata and controls
91 lines (88 loc) · 5.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
-- This module serves as the root of the `Divseq2.Lean` library.
-- Import modules here that should be built as part of the library.
import Divseq2.Basic
open Nat
namespace divseq2
-- 十分条件
-- この条件は「コラッツ値n の完全割数列と拡張完全割数列の(コラッツ操作の果ての)行先が同じ」をあらわす
-- この条件には、コラッツ的条件「Single と Extsそれぞれ のコラッツ値が n に等しい」が含まれる
-- よって Divseq2/Test02.lean は不正となる
theorem singleToExts (n : Nat) (p : SingleLimited n) : ExtsLimited n := match p with
| SingleLimited.is02 _ p2 => by contradiction
| SingleLimited.is03 m p2 => by contradiction
| SingleLimited.is04 m p2 => by contradiction
| SingleLimited.is05 m p2 => by contradiction
| SingleLimited.is06 l p2 => by contradiction
| SingleLimited.is07 l p2 => by contradiction
| SingleLimited.is08 l p2 => by contradiction
| SingleLimited.is09 _ p2 => by contradiction
| SingleLimited.is11 _ p2 => by contradiction
| SingleLimited.is12 l p2 => by contradiction
| SingleLimited.is13 l p2 => by contradiction
| SingleLimited.is14 l p2 => by contradiction
| SingleLimited.is01_2 p2 => p2
| SingleLimited.is10_2 p2 => p2
lemma m₀₂₁ (l : Nat) : l < succ (succ (succ (succ (succ (l * 2 * 2) * 3)))) := by linarith
lemma m₀₃₁ (m : Nat) : 2 * m < succ (succ (succ (succ (succ (succ (m * 3 * 2) * 2) * 3)))) := by linarith
lemma m₀₄₁ (m : Nat) : 4 * m + 1 < succ (succ (succ (succ (succ (succ (succ (m * 3) * 2) * 2) * 3)))) := by linarith
lemma m₀₅₁ (m : Nat) : 8 * m + 7 < succ (succ (succ (succ (succ (succ (succ (succ (m * 3)) * 2) * 2) * 3)))) := by linarith
lemma m₀₆₁ (l : Nat) : 16 * l + 3 < succ (succ (succ (succ (l * 3 * 2 * 3)))) := by linarith
lemma m₀₇₁ (l : Nat) : 8 * l + 4 < succ (succ (succ (succ (succ (l * 3) * 2 * 3)))) := by linarith
lemma m₀₈₁ (l : Nat) : 4 * l + 3 < succ (succ (succ (succ (succ (succ (l * 3)) * 2 * 3)))) := by linarith
lemma m₀₉₁ (j : Nat) : j < succ (succ (j * 3)) := by linarith
lemma m₁₁₁ (k : Nat) : k < succ (succ (succ (k * 2 * 3))) := by linarith
lemma m₁₂₁ (l : Nat) : 2 * l < succ (succ (succ (succ (l * 3 * 2) * 3))) := by linarith
lemma m₁₃₁ (l : Nat) : 4 * l + 1 < succ (succ (succ (succ (succ (l * 3) * 2) * 3))) := by linarith
lemma m₁₄₁ (l : Nat) : 8 * l + 7 < succ (succ (succ (succ (succ (succ (l * 3)) * 2) * 3))) := by linarith
theorem makeLimitedDivSeq (x : Nat) (rs : ∀ x₁, x₁ < x → SingleLimited x₁) : SingleLimited x := match x with
| 0 => is10 -- 6*<0>+3 = 3
| 1 => is01 -- 6*<1>+3 = 9
| succ (succ x) => by have rs := rs; cases (mod3 x) with
-- 6 mod 9
| threeZero j =>
have sin := rs j (m₀₉₁ j); have ext := singleToExts j sin;
exact SingleLimited.is09 j ext;
-- 3 mod 9
| threeOne j => cases (parity j) with
| even k =>
have sin := rs k (m₁₁₁ k); have ext := singleToExts k sin;
exact SingleLimited.is11 k ext;
| odd k => cases (mod3 k) with
| threeZero l =>
have sin := rs (2 * l) (m₁₂₁ l); have ext := singleToExts (2 * l) sin;
exact SingleLimited.is12 l ext;
| threeOne l =>
have sin := rs (4 * l + 1) (m₁₃₁ l); have ext := singleToExts (4 * l + 1) sin;
exact SingleLimited.is13 l ext;
| threeTwo l =>
have sin := rs (8 * l + 7) (m₁₄₁ l); have ext := singleToExts (8 * l + 7) sin;
exact SingleLimited.is14 l ext;
-- 0 mod 9
| threeTwo j => cases (parity j) with
| even k => cases (mod3 k) with
| threeZero l =>
have sin := rs (16 * l + 3) (m₀₆₁ l); have ext := singleToExts (16 * l + 3) sin;
exact SingleLimited.is06 l ext;
| threeOne l =>
have sin := rs (8 * l + 4) (m₀₇₁ l); have ext := singleToExts (8 * l + 4) sin;
exact SingleLimited.is07 l ext;
| threeTwo l =>
have sin := rs (4 * l + 3) (m₀₈₁ l); have ext := singleToExts (4 * l + 3) sin;
exact SingleLimited.is08 l ext;
| odd k => cases (parity k) with
| even l =>
have sin := rs l (m₀₂₁ l); have ext := singleToExts l sin;
exact SingleLimited.is02 l ext;
| odd l => cases (mod3 l) with
| threeZero m =>
have sin := rs (2 * m) (m₀₃₁ m); have ext := singleToExts (2 * m) sin;
exact SingleLimited.is03 m ext;
| threeOne m =>
have sin := rs (4 * m + 1) (m₀₄₁ m); have ext := singleToExts (4 * m + 1) sin;
exact SingleLimited.is04 m ext;
| threeTwo m =>
have sin := rs (8 * m + 7) (m₀₅₁ m); have ext := singleToExts (8 * m + 7) sin;
exact SingleLimited.is05 m ext;
-- 最終的な定理
theorem LimitedDivSeq (n : Nat) : SingleLimited n := WellFounded.fix (measure id).wf makeLimitedDivSeq n
end divseq2