Tactics & Keyframes: Visualizing Lean 4 Proofs in Blender

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 พ.ย. 2024

ความคิดเห็น • 47

  • @RPG_Guy-fx8ns
    @RPG_Guy-fx8ns 4 หลายเดือนก่อน +33

    I think you should change the color of the text you are about to transform, so people are looking at that part when the animation begins.

    • @dwrensha
      @dwrensha  4 หลายเดือนก่อน +6

      Ah, thanks! That particular idea had not occurred to me. I would like to add standard syntax coloring to the Lean code, and I have also imagined maybe highlighting hypotheses when they get used (e.g. `rw [hab]` would highlight the hypothesis `hab` in addition to transforming the target).

  • @aze4308
    @aze4308 4 หลายเดือนก่อน +16

    “end of proof, end of video” nice and succinct

    • @dwrensha
      @dwrensha  4 หลายเดือนก่อน +5

      I didn't say it in the video, so I'll say it now: thanks for watching!

  • @jsbarretto
    @jsbarretto 4 หลายเดือนก่อน +10

    This is really making me want to learn Lean, thanks for the superb video!

    • @dwrensha
      @dwrensha  4 หลายเดือนก่อน +2

      You should do it!

  • @jit_rs
    @jit_rs 4 หลายเดือนก่อน +6

    That's incredibly creative, especially the animated chess demo. I knew that Lean had meta programming, but this took it to a new level!

  • @pmmeurcatpics
    @pmmeurcatpics 4 หลายเดือนก่อน +1

    This video made me look up Lean, and now I've completed all the Games on the site that you showed, and i really liked them! Wish there were more of them or something like them. The only idea I've had was formalizing some of the proofs that we have at the uni for fun, but not much else, which is unfortunate. Maybe I can now rewatch some of the other videos on your channel where you prove theorems from olympiads or something, since that went way over my head on the first watch

  • @acortis
    @acortis 2 หลายเดือนก่อน +1

    excellent video! a few suggestions if I may, as a reaction and not having not having tried yet your library first hand.
    - Colors for animation and syntax, as suggested below.
    - Also a way of tracing the tree backwards.
    - Ideally, a verbose way of describing the steps, maybe with a LLM specifically designed for this scope

    • @dwrensha
      @dwrensha  2 หลายเดือนก่อน +1

      See my more recent two videos for syntax coloring!

  • @danproposkanovovski
    @danproposkanovovski 4 หลายเดือนก่อน +4

    Cool video. Somewhere in the elaboration of rewrite to an actual call to the eliminator for equality, you should have the motive i.e. precisely the context pointing out the locations being rewritten that your greedy matcher is trying to reconstruct.

    • @dwrensha
      @dwrensha  4 หลายเดือนก่อน +1

      That's good to know! Not all goal transitions are rewrites, but maybe other kinds of transitions have similar ways to get the precise correct matching.

  • @goesbymoon
    @goesbymoon 4 หลายเดือนก่อน +3

    oh my GOD this is so cool wow

  • @98danielray
    @98danielray 2 หลายเดือนก่อน +3

    nice Ben Eater voice

  • @strangeWaters
    @strangeWaters 4 หลายเดือนก่อน +1

    I was thinking of doing a project like this, this is super cool. There's another project called Lean Widgets that lets you embed visualizations directly in the proof state, it could be fun to have an interactive version of this in there.

  • @somcho
    @somcho 4 หลายเดือนก่อน

    good job i like how the exposition finally came out. I remember you demoing this in the lean immunity meeting and wondering how you were going to use

  • @RubeusHagrid-k3i
    @RubeusHagrid-k3i 2 หลายเดือนก่อน

    Great Work🎉 You have inspired me to try to recreate this using MANIM

  • @kak2ze
    @kak2ze 4 หลายเดือนก่อน

    An amazing idea and great execution! It would be cool to add a visual grammar of animations for the different tactics so it's instantly obvious what's happening: for `rfl` for instance you could make the symbols jump in sync on either side of the expression as they disappear, for proof by assumption the respective assumption can be briefly highlighted etc.

    • @dwrensha
      @dwrensha  4 หลายเดือนก่อน

      I agree that would be cool!

  • @authenticallysuperficial9874
    @authenticallysuperficial9874 4 หลายเดือนก่อน +1

    Wow! Great work

  • @MertGorMG
    @MertGorMG หลายเดือนก่อน

    interesting cool Thanks !

  • @joeeeee8738
    @joeeeee8738 4 หลายเดือนก่อน

    I didn't understand anything but it looked like a fabulous project!

  • @taylormanning2709
    @taylormanning2709 4 หลายเดือนก่อน +3

    This makes Lean way more accessible (at 0.5x speed)

    • @redpepper74
      @redpepper74 4 หลายเดือนก่อน +2

      It’s so cool right? But yeah I could _not_ figure out what was going on so there was a lot of pausing and rewinding for me lol

  • @luiswirth
    @luiswirth 4 หลายเดือนก่อน

    wow, great work

  • @connemignonne
    @connemignonne 4 หลายเดือนก่อน

    oh my god I have been thinking about trying to do this exact thing for the last couple weeks and you have already done it

    • @connemignonne
      @connemignonne 4 หลายเดือนก่อน

      I have been thinking about trying to make a videogame around the calculus of inductive constructions to spoonfeed theorem proving to people but where the expressions already in your environment are like cards in your hand with different abilities and where you also have a few contextual tactics you can apply to the goal

    • @dwrensha
      @dwrensha  4 หลายเดือนก่อน +1

      @@connemignonne Have you tried the Natural Number Game? It does a pretty good job at presenting a non-overwhelming set of possible next moves.

    • @connemignonne
      @connemignonne 4 หลายเดือนก่อน

      @@dwrensha I have looked at it a little bit but I should play more, I'm always so impressed with the whole Lean community.
      What I really want to do is make something that doesn't scare off people who are afraid of notation or maybe the idea of it even really being a math activity rather than just a puzzle game. I have lots of friends who really enjoy games like Magic The Gathering but who believe that they could never be good at math, even though the way they think through their strategy in-game is no less deductively sophisticated than a math proof. So I was hoping that presenting it all in a more familiar format (and putting it on a platform like Steam or for the Switch) would make it more accessible to people, but so far I've spent most of my development time over the past couple weeks just messing around with font rendering and not even making a start with the core systems. I wasn't sure whether I would want to build it off of Lean or just make my own bespoke less sophisticated thing, since trying to build a game around actual Lean itself seems like it could be challenging. But this video has made me think that I should consider it more.

  • @swathikumar980
    @swathikumar980 4 หลายเดือนก่อน +1

    bro, only one question. from which planet are you? nice work

  • @shortc1rcuit326
    @shortc1rcuit326 3 หลายเดือนก่อน

    Incredible video! What I’m wondering is if the code for the chess puzzles could be reworked/extended to a sudoku game? Someone did make sudoku in lean before but it required you to know the solution beforehand/get a computer to solve it first. I feel like with your method, that wouldn’t be necessary.

    • @dwrensha
      @dwrensha  3 หลายเดือนก่อน +1

      Yes, encoding sudoku in a similar manner should be quite possible. I expect it would be a fun exercise, if you wanted to try it. Note also that Lean 4 has "user widgets" that support arbitrary visualization, but I still think there's a strong appeal to encoding everything directly in Lean syntax.

    • @shortc1rcuit326
      @shortc1rcuit326 3 หลายเดือนก่อน

      It seems that TH-cam removes my reply if I include a link to my code, but it works! It's very much a prototype right now, but I was able to solve a *very* simple sudoku (i.e. only one number was missing). I think this could be really cool.

    • @dwrensha
      @dwrensha  3 หลายเดือนก่อน +1

      Nice!
      Yeah, TH-cam really doesn't like links in comments.

    • @shortc1rcuit326
      @shortc1rcuit326 3 หลายเดือนก่อน

      It seems that TH-cam is so trigger happy with this that I can't even put the name of the repository here, so I guess I'll have to give it in the form of a riddle. It's on Github. I'm the person who added the BMO questions to Compfiles.

    • @shortc1rcuit326
      @shortc1rcuit326 3 หลายเดือนก่อน

      It won't even let me describe where I put the code.

  • @qwqeqrqtqz
    @qwqeqrqtqz 4 หลายเดือนก่อน +1

    This looks really good. Maybe using Blender for the animation is a bit overkill. Have you thought about using manim since you are using python anyway?

    • @dwrensha
      @dwrensha  4 หลายเดือนก่อน +2

      Yes, Manim would work too! I'm in fact using Manim in this video for almost everything that isn't a Blender animation.
      Although it's not strictly needed here, one thing I have found to be tricky in Manim is drawing an animation that has multiple independent things happening simultaneously.

    • @qwqeqrqtqz
      @qwqeqrqtqz 4 หลายเดือนก่อน

      @@dwrensha I believe, and don't quote me on that, there is a way to assign with indices which symbol in an original line if text corresponds to which symbol in the resulting line of text when animating one line of text transforming into another

  • @AIShipped
    @AIShipped 4 หลายเดือนก่อน

    Amazing video! How did you animate your visuals and how long does it usually take?

    • @dwrensha
      @dwrensha  4 หลายเดือนก่อน +1

      Software I used for this video: Manim, Blender, OBS, GIMP, Final Cut Pro, and Apple Motion.
      It took me about a month to do all the animation, video editing, and audio recording.

    • @AIShipped
      @AIShipped 4 หลายเดือนก่อน

      @@dwrensha wow, that is a crazy amount of dedication! love to see it!

    • @dwrensha
      @dwrensha  4 หลายเดือนก่อน

      I should clarify that the Blender animations took only a couple days, because now that I have automatic tools to create them, those are straightforward to crank out. It's all the lead-up that took so long.

    • @AIShipped
      @AIShipped 4 หลายเดือนก่อน

      @@dwrensha oh i see

  • @atifatif8897
    @atifatif8897 4 หลายเดือนก่อน

    great video! are you using lean in emacs?

    • @dwrensha
      @dwrensha  4 หลายเดือนก่อน +2

      Affirmative!

  • @aze4308
    @aze4308 4 หลายเดือนก่อน

    nice