Zulip Chat Archive

Stream: general

Topic: animating Lean proofs in Blender: a video and github repo


David Renshaw (Jun 26 2024 at 19:06):

I released a new video about automatically animating Lean proofs:
https://youtu.be/KuxFWwwlEtc

You can try it yourself by downloading the code:
https://github.com/dwrensha/animate-lean-proofs

David Renshaw (Jun 26 2024 at 19:08):

As part of this project, I implemented chess (well, most of the rules), including a syntax embedding so that you can do stuff like:

theorem morphy_mates_in_two :
    ForcedWin .white
      ╔════════════════╗
      ║░░▓▓░░▓▓♚]]░░♜]
      ║♟]░░▓▓♞]▓▓♟]]]
      ║░░▓▓░░▓▓♛]▓▓░░▓▓║
      ║▓▓░░▓▓░░♟]░░♗]░░║
      ║░░▓▓░░▓▓♙]▓▓░░▓▓║
      ║▓▓♕]▓▓░░▓▓░░▓▓░░║
      ║♙]]]▓▓░░♙]]]
      ║▓▓░░♔}]▓▓░░▓▓░░║
      ╚════════════════╝ := by
  move "Qb8"
  opponent_move
  move "Rd8"
  checkmate

David Renshaw (Jun 26 2024 at 19:08):

check it out in Chess.lean in the above-linked repo

David Renshaw (Jun 26 2024 at 19:09):

(cc @Julian Berman @Yakov Pechersky )

Kim Morrison (Jun 27 2024 at 01:34):

What is opponent_move doing?

David Renshaw (Jun 27 2024 at 01:38):

It creates a new subgoal for each possible move.

David Renshaw (Jun 27 2024 at 02:35):

It could be rolled into the move tactic, but then the animation would show the two pieces moving at the same time.

David Renshaw (Jun 27 2024 at 02:39):

If pos1 is a position with white to move, then:

  • the way to prove ForcedWin .white pos1 is by showing that there exists a move to a position pos2 such that ForcedWin .White pos2.

  • the way to prove ForcedWin .black pos1 is by showing that for all legal next positions pos2, we have ForcedWin .black pos2.

David Renshaw (Jul 13 2024 at 00:55):

I published a new video, animating a solution to IMO1987P4: https://youtu.be/gi8ZTjRO-xI

David Renshaw (Jul 13 2024 at 00:58):

Now it has basic syntax highlighting, thanks to Pygments.

David Michael Roberts (Jul 15 2024 at 02:54):

Visually nice, but too fast for my eyeballs. The speaking pace is fine that fast (for me at least), but when something appears on screen for a fraction of a second and is changing size and moving, it might as well not be there from a visual representation standpoint. So I feel it defeats the purpose of the video somewhat.

David Renshaw (Jul 15 2024 at 02:59):

Thanks for the feedback!


Last updated: May 02 2025 at 03:31 UTC