module Math.Projects.Rubik where
import Math.Algebra.Group.PermutationGroup hiding (_D)
import Math.Algebra.Group.SchreierSims as SS
import Math.Algebra.Group.RandomSchreierSims as RSS
import Math.Algebra.Group.Subquotients
f :: Permutation Integer
f = [[Integer]] -> Permutation Integer
forall a. Ord a => [[a]] -> Permutation a
p [[ 1, 3, 9, 7],[ 2, 6, 8, 4],[17,41,33,29],[18,44,32,26],[19,47,31,23]]
b :: Permutation Integer
b = [[Integer]] -> Permutation Integer
forall a. Ord a => [[a]] -> Permutation a
p [[51,53,59,57],[52,56,58,54],[11,27,39,43],[12,24,38,46],[13,21,37,49]]
l :: Permutation Integer
l = [[Integer]] -> Permutation Integer
forall a. Ord a => [[a]] -> Permutation a
p [[21,23,29,27],[22,26,28,24],[ 1,31,59,11],[ 4,34,56,14],[ 7,37,53,17]]
r :: Permutation Integer
r = [[Integer]] -> Permutation Integer
forall a. Ord a => [[a]] -> Permutation a
p [[41,43,49,47],[42,46,48,44],[ 3,13,57,33],[ 6,16,54,36],[ 9,19,51,39]]
u :: Permutation Integer
u = [[Integer]] -> Permutation Integer
forall a. Ord a => [[a]] -> Permutation a
p [[11,13,19,17],[12,16,18,14],[ 1,21,51,41],[ 2,22,52,42],[ 3,23,53,43]]
d :: Permutation Integer
d = [[Integer]] -> Permutation Integer
forall a. Ord a => [[a]] -> Permutation a
p [[31,33,39,37],[32,36,38,34],[ 7,47,57,27],[ 8,48,58,28],[ 9,49,59,29]]
rubikCube :: [Permutation Integer]
rubikCube = [Permutation Integer
f,Permutation Integer
b,Permutation Integer
l,Permutation Integer
r,Permutation Integer
u,Permutation Integer
d]
[cornerFaces :: [Integer]
cornerFaces,edgeFaces :: [Integer]
edgeFaces] = [Permutation Integer] -> [[Integer]]
forall a. Ord a => [Permutation a] -> [[a]]
orbits [Permutation Integer]
rubikCube
(kerCornerFaces :: [Permutation Integer]
kerCornerFaces,imCornerFaces :: [Permutation Integer]
imCornerFaces) = [Permutation Integer]
-> [Integer] -> ([Permutation Integer], [Permutation Integer])
forall a.
(Ord a, Show a) =>
[Permutation a] -> [a] -> ([Permutation a], [Permutation a])
transitiveConstituentHomomorphism [Permutation Integer]
rubikCube [Integer]
cornerFaces
(kerEdgeFaces :: [Permutation Integer]
kerEdgeFaces,imEdgeFaces :: [Permutation Integer]
imEdgeFaces) = [Permutation Integer]
-> [Integer] -> ([Permutation Integer], [Permutation Integer])
forall a.
(Ord a, Show a) =>
[Permutation a] -> [a] -> ([Permutation a], [Permutation a])
transitiveConstituentHomomorphism [Permutation Integer]
rubikCube [Integer]
edgeFaces
[cornerBlocks :: [[Integer]]
cornerBlocks] = [Permutation Integer] -> [[[Integer]]]
forall t. Ord t => [Permutation t] -> [[[t]]]
blockSystems [Permutation Integer]
imCornerFaces
[edgeBlocks :: [[Integer]]
edgeBlocks] = [Permutation Integer] -> [[[Integer]]]
forall t. Ord t => [Permutation t] -> [[[t]]]
blockSystems [Permutation Integer]
imEdgeFaces
(kerCornerBlocks :: [Permutation Integer]
kerCornerBlocks,imCornerBlocks :: [Permutation [Integer]]
imCornerBlocks) = [Permutation Integer]
-> [[Integer]] -> ([Permutation Integer], [Permutation [Integer]])
forall t.
(Ord t, Show t) =>
[Permutation t] -> [[t]] -> ([Permutation t], [Permutation [t]])
blockHomomorphism [Permutation Integer]
imCornerFaces [[Integer]]
cornerBlocks
(kerEdgeBlocks :: [Permutation Integer]
kerEdgeBlocks,imEdgeBlocks :: [Permutation [Integer]]
imEdgeBlocks) = [Permutation Integer]
-> [[Integer]] -> ([Permutation Integer], [Permutation [Integer]])
forall t.
(Ord t, Show t) =>
[Permutation t] -> [[t]] -> ([Permutation t], [Permutation [t]])
blockHomomorphism [Permutation Integer]
imEdgeFaces [[Integer]]
edgeBlocks
_U :: Permutation Integer
_U = [[Integer]] -> Permutation Integer
forall a. Ord a => [[a]] -> Permutation a
p [[1,13,16,4],[2,9,15,8],[3,5,14,12],[6,10,11,7],
[101,201,301,401],[102,202,302,402],[103,203,303,403],[104,204,304,404]]
_u :: Permutation Integer
_u = [[Integer]] -> Permutation Integer
forall a. Ord a => [[a]] -> Permutation a
p [[105,205,305,405],[106,206,306,406],[107,207,307,407],[108,208,308,408]]
_d :: Permutation Integer
_d = [[Integer]] -> Permutation Integer
forall a. Ord a => [[a]] -> Permutation a
p [[109,209,309,409],[110,210,310,410],[111,211,311,411],[112,212,312,412]]
_D :: Permutation Integer
_D = [[Integer]] -> Permutation Integer
forall a. Ord a => [[a]] -> Permutation a
p [[113,213,313,413],[114,214,314,414],[115,215,315,415],[116,216,316,416],
[501,504,516,513],[502,508,515,509],[503,512,514,505],[506,507,511,510]]
bf :: Permutation Integer
bf = [[Integer]] -> Permutation Integer
forall a. Ord a => [[a]] -> Permutation a
p [[1,304,516,113],[2,308,515,109],[3,312,514,105],[4,316,513,101],
[5,303,512,114],[6,307,511,110],[7,311,510,106],[8,315,509,102],
[9,302,508,115],[10,306,507,111],[11,310,506,107],[12,314,505,103],
[13,301,504,116],[14,305,503,112],[15,309,502,108],[16,313,501,104],
[201,204,216,213],[202,208,215,209],[203,212,214,205],[206,207,211,210],
[401,413,416,404],[402,409,415,408],[403,405,414,412],[406,410,411,407]]
_R :: Permutation Integer
_R = Permutation Integer
_U Permutation Integer -> Permutation Integer -> Permutation Integer
forall a. Ord a => Permutation a -> Permutation a -> Permutation a
~^ Permutation Integer
bf
_r :: Permutation Integer
_r = Permutation Integer
_u Permutation Integer -> Permutation Integer -> Permutation Integer
forall a. Ord a => Permutation a -> Permutation a -> Permutation a
~^ Permutation Integer
bf
_l :: Permutation Integer
_l = Permutation Integer
_d Permutation Integer -> Permutation Integer -> Permutation Integer
forall a. Ord a => Permutation a -> Permutation a -> Permutation a
~^ Permutation Integer
bf
_L :: Permutation Integer
_L = Permutation Integer
_D Permutation Integer -> Permutation Integer -> Permutation Integer
forall a. Ord a => Permutation a -> Permutation a -> Permutation a
~^ Permutation Integer
bf
ud :: Permutation Integer
ud = Permutation Integer
_U Permutation Integer -> Permutation Integer -> Permutation Integer
forall a. Num a => a -> a -> a
* Permutation Integer
_u Permutation Integer -> Permutation Integer -> Permutation Integer
forall a. Num a => a -> a -> a
* Permutation Integer
_d Permutation Integer -> Permutation Integer -> Permutation Integer
forall a. Num a => a -> a -> a
* Permutation Integer
_D
_B :: Permutation Integer
_B = Permutation Integer
_R Permutation Integer -> Permutation Integer -> Permutation Integer
forall a. Ord a => Permutation a -> Permutation a -> Permutation a
~^ Permutation Integer
ud
_b :: Permutation Integer
_b = Permutation Integer
_r Permutation Integer -> Permutation Integer -> Permutation Integer
forall a. Ord a => Permutation a -> Permutation a -> Permutation a
~^ Permutation Integer
ud
_f :: Permutation Integer
_f = Permutation Integer
_l Permutation Integer -> Permutation Integer -> Permutation Integer
forall a. Ord a => Permutation a -> Permutation a -> Permutation a
~^ Permutation Integer
ud
_F :: Permutation Integer
_F = Permutation Integer
_L Permutation Integer -> Permutation Integer -> Permutation Integer
forall a. Ord a => Permutation a -> Permutation a -> Permutation a
~^ Permutation Integer
ud