Zulip Chat Archive

Stream: Is there code for X?

Topic: Is there any theorem related to the existence proof of Rubik


chenjulang (Jan 08 2024 at 06:42):

Is there any theorem related to the existence proof of Rubik's cube solution?
Something in group theory, maybe.
Something providing an existence proof and list of solutions. It doesn't matter whether it's in lean or not.

Johan Commelin (Jan 08 2024 at 06:52):

Can you write down the precise theorem statement that you are after?

chenjulang (Jan 08 2024 at 07:00):

No, i cannot even state the theorem

chenjulang (Jan 08 2024 at 07:00):

I was thinking Mathlib may has something to do with Rubik's Cube

chenjulang (Jan 08 2024 at 07:01):

Something in Group Theory, and i can climb on it

Johan Commelin (Jan 08 2024 at 07:01):

Can you state the theorem informally? What is "the existence proof of Rubik"?

chenjulang (Jan 08 2024 at 07:03):

Maybe what state of a cube can be solved? What is the Iff (Necessary and Sufficient Condition).

chenjulang (Jan 08 2024 at 07:04):

And its most complex moves is under 20(or 26), I was thinking this can be proved.

chenjulang (Jan 08 2024 at 07:06):

All the movements of a cube can be descriped in a "state graph", right?

Johan Commelin (Jan 08 2024 at 07:07):

chenjulang said:

And its most complex moves is under 20(or 26), I was thinking this can be proved.

This is something that can be stated in Lean.

chenjulang (Jan 08 2024 at 07:07):

Great!

Johan Commelin (Jan 08 2024 at 07:07):

chenjulang said:

Maybe what state of a cube can be solved? What is the Iff (Necessary and Sufficient Condition).

How do you want to describe the possible states. You can not simply list all solvable states. Because that list would be gigantic.

chenjulang (Jan 08 2024 at 07:09):

emm...Yeah, but we dont need to list all the "Perm n"(for example n=100). We may find the road to the goal only, maybe?

chenjulang (Jan 08 2024 at 07:10):

And considering the most complex road is less than 26 moves, it is not really really big , right?

chenjulang (Jan 08 2024 at 07:11):

i know it is hard even in traditional maths

chenjulang (Jan 08 2024 at 07:14):

Something about providing and proving an algorithm. (something called Kociemba)

Johan Commelin (Jan 08 2024 at 07:28):

chenjulang said:

emm...Yeah, but we dont need to list all the "Perm n"(for example n=100). We may find the road to the goal only, maybe?

In that case I don't know what the statement is that you are after...

chenjulang (Jan 08 2024 at 07:31):

i dont know either. I think i was looking for an algorithm to solve rubik's cube in lean. And Lean is good at proving things, it may be able to prove the algorithm feasible.

Johan Commelin (Jan 08 2024 at 07:33):

Proving the existence of an algorithm is "easy", because "brute force" is an algorithm that works. But if you want an efficient algorithm, then this is going to be a really hard project.

Jeremy Tan (Jan 08 2024 at 07:34):

For a start you might want to prove that the Cube can be solved in 52 moves (Thistlethwaite's)

chenjulang (Jan 08 2024 at 07:39):

Ok, thanks for advising :smiling_face_with_hearts:

Damiano Testa (Jan 08 2024 at 08:02):

The size of the group generated by moves allowed in the Rubik's cube is

43252003274489856000.

This is therefore also the number of solvable configurations. While this number is much smaller than

48! = 12413915592536072670862289047373375038521486354677760000000000

it is still probably not very practical to simply list all the solvable elements and argue on them separately.

Damiano Testa (Jan 08 2024 at 08:03):

(Information taken from Wikipedia.)

Kim Morrison (Jan 08 2024 at 08:49):

It would be lovely to implement Schreier-Sims!

Here's a 1-page version of solving the Rubik's cube (=understanding a subgroup of S_n given by generators): https://www.math.toronto.edu/~drorbn/Talks/CUMC-0807/NCGE.pdf

It would be tricky to set up nicely, but not particularly harder than Gaussian elimination or Smith Normal Form.

Matt Diamond (Jan 08 2024 at 20:04):

There was some work done on formalizing the Rubik's cube group in Lean 3 by @Kendall Frey: https://github.com/kendfrey/rubiks-cube-group

chenjulang (Jan 09 2024 at 02:27):

(deleted)

chenjulang (Jan 09 2024 at 02:36):

Try this too, this is in LEAN4.
https://github.com/leanprover-community/ProofWidgets4/blob/main/ProofWidgets/Demos/Rubiks.lean

chenjulang (Jan 09 2024 at 02:40):

And this:
https://github.com/AlexDuchnowski/rubiks-cube/tree/main/RubiksCube

chenjulang (Jan 09 2024 at 02:57):

image.png

Kim Morrison (Jan 09 2024 at 10:43):

Scott Morrison said:

It would be lovely to implement Schreier-Sims!

I couldn't resist: branch#schreier_sims has the basics of the Schreier-Sims algorithm (algorithm is there, some sorries about invariants needed in the algorithm, and none of the theorems about it).

It can cope with the Rubik's cube, computing the size of the group correctly just being shown the generators, and it can determine membership. The data structures would need a little updating in order to solve the word problem, but the computation is already happening.

It would be lovely to get this polished up and usable, but I probably won't do this myself. If anyone would like to adopt it (it could be a great project for someone?) please do. I'm happy to talk through what should be done.

Kim Morrison (Jan 09 2024 at 10:45):

It has a partial step in the algorithm that would be easy to make total. It would be fun (but perhaps unrealistic?) to see if Lean could compute the size of the Rubik's cube group by rfl!


Last updated: May 02 2025 at 03:31 UTC