annotate src/sym5a.agda @ 320:8fb16f9a882a

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 19 Sep 2023 11:11:38 +0900
parents fff18d4a063b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
318
fff18d4a063b use stdlib-2.0 and safe-mode
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 292
diff changeset
1 {-# OPTIONS --cubical-compatible --safe #-}
fff18d4a063b use stdlib-2.0 and safe-mode
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 292
diff changeset
2
292
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 255
diff changeset
3 --
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 255
diff changeset
4 -- checking does not terminate, sorry
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 255
diff changeset
5 --
68
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 open import Level hiding ( suc ; zero )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 open import Algebra
251
d782dd481a26 compile
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 184
diff changeset
8 module sym5a where
68
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 open import Symmetric
75
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
11 open import Data.Unit using (⊤ ; tt )
68
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 open import Function.Inverse as Inverse using (_↔_; Inverse; _InverseOf_)
75
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
13 open import Function hiding (flip)
68
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 open import Data.Nat hiding (_⊔_) -- using (ℕ; suc; zero)
75
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
15 open import Data.Nat.Properties
68
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 open import Relation.Nullary
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 open import Data.Empty
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 open import Data.Product
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 open import Gutil
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 open import Putil
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 open import Solvable using (solvable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 open import Relation.Binary.PropositionalEquality hiding ( [_] )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24
75
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
25 open import Data.Fin hiding (_<_ ; _≤_ ; lift )
116
6022d00a0690 check termination problem remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 115
diff changeset
26 open import Data.Fin.Permutation hiding (_∘ₚ_)
6022d00a0690 check termination problem remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 115
diff changeset
27
6022d00a0690 check termination problem remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 115
diff changeset
28 infixr 200 _∘ₚ_
6022d00a0690 check termination problem remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 115
diff changeset
29 _∘ₚ_ = Data.Fin.Permutation._∘ₚ_
6022d00a0690 check termination problem remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 115
diff changeset
30
73
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 70
diff changeset
31 open import Data.List hiding ( [_] )
75
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
32 open import nat
77
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
33 open import fin
84
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 83
diff changeset
34 open import logic
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 83
diff changeset
35
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 83
diff changeset
36 open _∧_
68
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 ¬sym5solvable : ¬ ( solvable (Symmetric 5) )
251
d782dd481a26 compile
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 184
diff changeset
39 ¬sym5solvable sol = counter-example (end5 (abc 0<3 0<4 ) (any3de (dervied-length sol) 3rot 0<3 0<4 ) ) where
73
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 70
diff changeset
40 --
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 70
diff changeset
41 -- dba 1320 d → b → a → d
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 70
diff changeset
42 -- (dba)⁻¹ 3021 a → b → d → a
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 70
diff changeset
43 -- aec 21430
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 70
diff changeset
44 -- (aec)⁻¹ 41032
113
d8a21c5db0e0 sym5 done but agda won'y stop
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
45 -- [ dba , aec ] = (abd)(cea)(dba)(aec) = abc
d8a21c5db0e0 sym5 done but agda won'y stop
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
46 -- so commutator always contains abc, dba and aec
73
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 70
diff changeset
47
112
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 111
diff changeset
48 open ≡-Reasoning
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 111
diff changeset
49
73
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 70
diff changeset
50 open solvable
112
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 111
diff changeset
51 open Solvable ( Symmetric 5)
73
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 70
diff changeset
52 end5 : (x : Permutation 5 5) → deriving (dervied-length sol) x → x =p= pid
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 70
diff changeset
53 end5 x der = end sol x der
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 70
diff changeset
54
74
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 73
diff changeset
55 0<4 : 0 < 4
75
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
56 0<4 = s≤s z≤n
74
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 73
diff changeset
57
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 73
diff changeset
58 0<3 : 0 < 3
75
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
59 0<3 = s≤s z≤n
74
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 73
diff changeset
60
79
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 78
diff changeset
61 --- 1 ∷ 2 ∷ 0 ∷ [] abc
74
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 73
diff changeset
62 3rot : Permutation 3 3
79
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 78
diff changeset
63 3rot = pid {3} ∘ₚ pins (n≤ 2)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 78
diff changeset
64
85
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 84
diff changeset
65 save2 : {i j : ℕ } → (i ≤ 3 ) → ( j ≤ 4 ) → Permutation 5 5
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 84
diff changeset
66 save2 i<3 j<4 = flip (pins (s≤s i<3)) ∘ₚ flip (pins j<4)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 84
diff changeset
67
251
d782dd481a26 compile
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 184
diff changeset
68 -- Permutation 5 5 include any Permutation 3 3
d782dd481a26 compile
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 184
diff changeset
69 any3 : {i j : ℕ } → Permutation 3 3 → (i ≤ 3 ) → ( j ≤ 4 ) → Permutation 5 5
d782dd481a26 compile
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 184
diff changeset
70 any3 abc i<3 j<4 = (save2 i<3 j<4 ∘ₚ (pprep (pprep abc))) ∘ₚ flip (save2 i<3 j<4 )
74
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 73
diff changeset
71
251
d782dd481a26 compile
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 184
diff changeset
72 any3cong : {i j : ℕ } → {x y : Permutation 3 3 } → {i<3 : i ≤ 3 } → {j<4 : j ≤ 4 } → x =p= y → any3 x i<3 j<4 =p= any3 y i<3 j<4
d782dd481a26 compile
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 184
diff changeset
73 any3cong {i} {j} {x} {y} {i<3} {j<4} x=y = presp {5} {save2 i<3 j<4 ∘ₚ (pprep (pprep x))} {_} {flip (save2 i<3 j<4 )}
116
6022d00a0690 check termination problem remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 115
diff changeset
74 (presp {5} {save2 i<3 j<4} prefl (pprep-cong (pprep-cong x=y)) ) prefl
112
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 111
diff changeset
75
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 111
diff changeset
76 open _=p=_
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 111
diff changeset
77
251
d782dd481a26 compile
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 184
diff changeset
78 -- derving n includes any Permutation 3 3,
d782dd481a26 compile
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 184
diff changeset
79 any3de : {i j : ℕ } → (n : ℕ) → (abc : Permutation 3 3) → (i<3 : i ≤ 3 ) → (j<4 : j ≤ 4 ) → deriving n (any3 abc i<3 j<4)
d782dd481a26 compile
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 184
diff changeset
80 any3de {i} {j} zero abc i<3 j<4 = Level.lift tt
d782dd481a26 compile
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 184
diff changeset
81 any3de {i} {j} (suc n) abc i<3 j<4 = ccong abc-from-comm (comm (any3de n (abc ∘ₚ abc) i<3 j0<4 ) (any3de n (abc ∘ₚ abc) i0<3 j<4 )) where
d782dd481a26 compile
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 184
diff changeset
82 i0 : ℕ
d782dd481a26 compile
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 184
diff changeset
83 i0 = ?
d782dd481a26 compile
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 184
diff changeset
84 j0 : ℕ
d782dd481a26 compile
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 184
diff changeset
85 j0 = ?
d782dd481a26 compile
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 184
diff changeset
86 i0<3 : i0 ≤ 3
d782dd481a26 compile
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 184
diff changeset
87 i0<3 = {!!}
d782dd481a26 compile
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 184
diff changeset
88 j0<4 : j0 ≤ 4
d782dd481a26 compile
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 184
diff changeset
89 j0<4 = {!!}
d782dd481a26 compile
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 184
diff changeset
90 abc-from-comm : [ any3 (abc ∘ₚ abc) i<3 j0<4 , any3 (abc ∘ₚ abc) i0<3 j<4 ] =p= any3 abc i<3 j<4
d782dd481a26 compile
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 184
diff changeset
91 abc-from-comm = {!!}
d782dd481a26 compile
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 184
diff changeset
92
75
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
93 abc : {i j : ℕ } → (i ≤ 3 ) → ( j ≤ 4 ) → Permutation 5 5
251
d782dd481a26 compile
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 184
diff changeset
94 abc i<3 j<4 = any3 3rot i<3 j<4
74
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 73
diff changeset
95
184
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 118
diff changeset
96 counter-example : ¬ (abc 0<3 0<4 =p= pid )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 118
diff changeset
97 counter-example eq with ←pleq _ _ eq
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 118
diff changeset
98 ... | ()
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 118
diff changeset
99