David Renshaw
David Renshaw
  • 16
  • 111 466
Improving on AlphaProof: IMO 2024 Problem 2 in Lean 4
Animated formal proof of problem 2 from the 2024 International Mathematical Olympiad, with commentary.
Submitted to Summer of Mathematical Exposition 2024: some.3b1b.co/
#SoMEpi #SoMEπ
Links
The proof: gist.github.com/dwrensha/68de74feb8f0b0700ba5454ae056a191
Proof animation tool: github.com/dwrensha/animate-lean-proofs
DeepMind announcement: deepmind.google/discover/blog/ai-solves-imo-problems-at-silver-medal-level/
Chapters
00:00 - intro
00:53 - the proof
มุมมอง: 2 713

วีดีโอ

IMO 1987 Problem 4: Animated Lean 4 Proof
มุมมอง 2.1K3 หลายเดือนก่อน
Animated formal proof of problem 4 from the 1987 International Mathematical Olympiad, with commentary. Links Lean 4 animation tools: github.com/dwrensha/animate-lean-proofs Compfiles page for IMO1987P4: dwrensha.github.io/compfiles/problems/Compfiles.Imo1987P4.html
Tactics & Keyframes: Visualizing Lean 4 Proofs in Blender
มุมมอง 8K4 หลายเดือนก่อน
Can we make formal mathematics more fun to watch? Links proof animation: github.com/dwrensha/animate-lean-proofs chess in Lean: github.com/dwrensha/Chess.lean Natural Number Game: adam.math.hhu.de/#/g/leanprover-community/nng4 maze game: github.com/dwrensha/lean4-maze Compfiles: dwrensha.github.io/compfiles/ Mathlib: github.com/leanprover-community/mathlib4 Chapters 00:00 - intro 01:09 - the pl...
Kernel Reduction Explosion: a surprisingly inefficient computation in Lean 4
มุมมอง 1.7K10 หลายเดือนก่อน
Why does "well-founded recursion" sometimes make Lean 4 definitional equality (kernel reduction) very slow? Try the interactive trace stepper tool here: dwrensha.github.io/kernel-reduction-explosion/. 00:00 - reducing decimalDigits function 01:05 - compilation stages and kernel reduction 03:11 - Zulip suggests adding a fuel parameter 04:26 - printing elaborated function bodies 05:07 - a rundown...
Nicer Trees Spend Fewer Bytes: compressing 12947 Wordle words into 12155 bytes
มุมมอง 87Kปีที่แล้ว
What's the smallest javascript program you can write whose output is the Wordle wordlist? A lively "code golf" competition to answer that question is currently underway at the website golf.horse/. This video describes how one particular entry achieved an impressive amount of compression by using binary trees to divide the space of possible words. Made in collaboration with @jedgrabman . Submitt...
Automated Acronymy: computer-assisted backronym generation
มุมมอง 6Kปีที่แล้ว
How to automatically expand any word as an acronym (i.e. a "backronym") using neural networks. Presented at SIGBOVIK 2023. Acronymy Assistant: github.com/dwrensha/acronymy-assistant Acronymy: acronymy.net 00:00 - acronyms 00:08 - acronymy.net 00:28 - title 00:29 - autocomplete 00:57 - using the model 01:19 - scoring 01:35 - pseudotokens and enforcing validity 01:58 - letting it churn 02:16 - Ac...
Lean 4 formalization of 1964 International Mathematical Olympiad Problem 4
มุมมอง 1.1Kปีที่แล้ว
Formalizing a combinatorics IMO problem in Lean 4. Originally streamed live at twitch.tv/dwrensha Code is here: github.com/dwrensha/compfiles/blob/1391c57e82b3ee8be8350f3059235fbed06c5904/Compfiles/Imo1964P4.lean 00:00 - Problem statement 01:07 - Setting up Lemma 1 (6 people and 2 colors). 06:50 - Constructing a 3-element finset. 08:41 - Case analysis into 9 branches. 10:30 - Other main branch ...
Lean 4 formalization of 1964 International Mathemetical Olympiad Problem 1b
มุมมอง 941ปีที่แล้ว
Formalizing an IMO problem in Lean 4. Originally streamed live at twitch.tv/dwrensha Code is here: github.com/dwrensha/math-puzzles-in-lean4/blob/f4b785bd64d11b64fe05a016c4ad9e84e8f8a5bf/MathPuzzles/imo1964_q1b.lean 00:00 - Intro. 00:25 - First proof attempt. 06:10 - trying new approach. Works much better! 10:42 - Cleaning up the completed proof.
Lean 3 formalization of 1998 Hungarian Mathematical Olympiad Problem 6
มุมมอง 290ปีที่แล้ว
Formalizing an olympiad problem in Lean 3. Originally streamed live at twitch.tv/dwrensha Code is here: github.com/dwrensha/math-puzzles-in-lean/blob/f11517a7aa4e54db2f8998ecc689fd9000ad6182/src/hungary1998_q6.lean 00:00 - problem statement 01:09 - starting the proof 02:29 - using congruence on a sum 03:49 - splitting into separate sums 05:30 - closed form for 1 2 ... 99 07:54 - sum of squares ...
Lean 3 formalization of 1998 Bulgarian Mathematical Olympiad Problem 8
มุมมอง 711ปีที่แล้ว
Formalizing an olympiad problem in Lean 3. Originally streamed live at twitch.tv/dwrensha Code is here: github.com/dwrensha/math-puzzles-in-lean/blob/347859c06af87915591a14f8df9975be1c69eb57/src/bulgaria1998_q8.lean 0:00 - problem statement 1:57 - setting up the induction 4:20 - lemma 1 9:16 - lemma 2, stuck due to typo 16:14 - unstuck 17:13 - the homestretch
Remember Me [music video]
มุมมอง 1334 ปีที่แล้ว
Music video for another original song from my 2019 birthday party. Asta: vocals Mason: guitar Tom: camera
Tell Me You're Being Ironic [music video]
มุมมอง 2234 ปีที่แล้ว
Music video of an original song composed and recorded during my 2019 birthday party. full album at dwrensha.bandcamp.com/album/photuris-pensylvanica camerawork by Tom 7
duoludo data for ZEPTO: April 6 - April 27, 2013
มุมมอง 32811 ปีที่แล้ว
Yet more recorded data of many people playing my javascript platformer game "Zepto". The music is "Zeptodance", by me. dwrensha.ws/duoludo
a view of the duoludo data for ZEPTO: April 6 - April 20, 2013
มุมมอง 14511 ปีที่แล้ว
More recorded data of many people playing my javascript platformer game "Zepto". The music is "Zeptodance", by me. dwrensha.ws/duoludo
duoludo: the start of ZEPTO
มุมมอง 17311 ปีที่แล้ว
Recorded data of many people playing my javascript platformer game "Zepto". The music is "Zeptodance", by me. dwrensha.ws/duoludo
duoludo playback preview
มุมมอง 8811 ปีที่แล้ว
duoludo playback preview

ความคิดเห็น

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

    Way too many cuts and too much jumping around to be able to follow. A slower pace would make this more helpful, given how much information one needs to absorb, both from the lean file and from the info view.

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

    interesting cool Thanks !

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

    very nice!

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

    nice Ben Eater voice

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

    I don't understand y tbh but it's impressive and cool. The editing looks great btw.

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

    It is unbelievable that the author doesn't dwell on the characterization of the definition of the set which is the main difficulty for humans.

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

    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 หลายเดือนก่อน

      See my more recent two videos for syntax coloring!

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

    man am i glad im not doing math anymore

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

    Here's how the proof works in simple terms: We must prove that there "does not exist a function on such that a nested function with of a unknown non-negative number that equals to number that adds up to 1,987 for all N" However we can this to saying that: We must prove that there "does not exist a function on such that a nested function with of a unknown non-negative number that equals to number that adds one to a multiple of two for another number M. Braces are use to identify tactics, brackets mean theorems We first use {intro} that changes the inductive goal into a assumption. We need a contradiction to support the proof. We first need to prove that the function is injective, meaning it has a one to one relationship. This means is that need to show that if the function with variable X is equal to the function with variable Y, it means that x is equal to Y. We create a hypothesis similar to one of hypothesis (the function with variable x is equal to the function with variable Y) using {have} but we replace N with X Next we use {rw} (a tactic that rewrite values based theorem or assumption) to change all X's to Y's. Then we can use the theorem from Nat [Nat.add_right_cancel] to cancel the two values. y + (2 * m + 1) = x + (2 * m + 1) -> x=y We finish the proof of the injective function by using {symm} to flip and {rw} to replace the values finish this sub-goal. Now we can create a contradiction. *Lean is a functional language. People who come from functional programming languages like Haskell will know what is happening. Graph theory is intertwined with functional programming because Functions are like a set of inputs and outputs. When you put a set inputs in the function you ger a set of outputs. That's how functions work when your are taught about the in middle school. Lean forces you to use this knowledge of functional programming to prove theorems. So for right now let's think about functions as sets and elements as values.* It's time for the hard part. Comment if I get something wrong. In any proof you must prove in every case the proof contradicts or not. So we have to do that for both cases. Lets create two sets or function cases. with the set or function that is not in the range (meaning it does not have a pair) of the function and another function function case of a function pair of A under the function. This is the foundation of our contradiction. We will have to prove that contradiction. We know that both of the cases contain numbers that are not greater than two M plus one. To prove that we need a two step calculation using the {calc} tactic: To prove that the cases are the range of the non-pair nested function. We use {unfold_let} (that extracts the value but {simp} can be used as an alternative) and the difference between the injective functions we proved. We need to cancel the arguments next, that which requires us to prove even more cases. Remember you must prove in every case the proof contradicts or not. The first can be solved using a subset and the second can have its goal canceled using the [set.image.mono] theorem. Next we have to prove that the numbers that are not in the range that are less than two M plus one. We use the {ext} tactic that uses extensionality theorems. Meaning that "two things are the same if they are built up with the same things." So we have to show that X that it exists in both sets. After many {rw} and a {simp} tactic that tries to simplify the value. We can use {simp_rw} with [eq_comm](equal_comminality) to close the proof. With this we know its cardinality as two M plus one. We also know that the function or set is disjoint as seen as what we proved, that can be resolved using the {aesop} tactic that will recursively resolve the current goal if it works at first. Now let's think about the function itself. We know that that the function cases are limited because both of them have a limit of two m plus one. Using that and being that it's disjointed we can prove that union is the sum of the cardinality of A and B. With that we know that the the function is injective and one of the case that does not have a pair. Now we can {rw} B in B.ncard to A. Making one side even and the other odd. An even cannot equal to an odd. That's a contradiction, so we use the {omega} tactic that checks if there's a contradiction and if it does finishes the proof. This finishes the proof. End of proof End of comment

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

    I see theorem prover I subscribe

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

      Greetings, fellow theorem prover enjoyer.

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

    Great video, the animations are really nice. It seems like it would be kinda hard to follow without knowledge of lean. Even though I understood every step I still have no idea what the big picture of the proof is

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

    Beautiful video! I hope for more content in the same style in the future!

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

    Great work! Your exposition is solid, I expected this to be a much bigger channel.

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

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

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

    Amazing video. I only would slow down both the pace of exposition and animation, with some different use of color. Nonetheless amazing

  • @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 หลายเดือนก่อน

      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 หลายเดือนก่อน

      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.

  • @Sjoerd-gk3wr
    @Sjoerd-gk3wr 4 หลายเดือนก่อน

    when you showed the problem I paused the video and tried to solve the problem myself, and 40 minutes later I had solved my first IMO question ever without help in the same way you did

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

      Wow, cool!

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

    awesome

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

    Also I think it'd be useful during each frame to show how the current "proving goal" fits into the bigger picture. Like a small visualization of the proof tree next to the main visualization.

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

    Nice! Please make more. It's very cool seeing how Lean can prove different theorems in practice, such as IMO ones.

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

    amazing video will wait for more lean prover content!

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

    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

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

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

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

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

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

      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

  • @authenticallysuperficial9874
    @authenticallysuperficial9874 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 หลายเดือนก่อน

      @@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.

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

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

  • @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!

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

    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.

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

    wow, great work

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

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

  • @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

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

    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 หลายเดือนก่อน

      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

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

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

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

      You should do it!

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

    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 หลายเดือนก่อน

      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).

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

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

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

      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

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

    oh my GOD this is so cool wow

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

    great video! are you using lean in emacs?

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

      Affirmative!

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

    woahhhh

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

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

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

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

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

    nice

  • @danproposkanovovski
    @danproposkanovovski 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 หลายเดือนก่อน

      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.

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

    Gold, real gold. Thank you so much for this videos.

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

    Impeccable content!!! This editing style fits this kind of video so well.

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

    How many times can you acronym the same word while retaining that all parts of the string have some relevance to the original meaning?

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

      Yeah, that's a fun challenge, especially if you're not allowed to reuse words!

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

    Took me a surprisingly long time to figure out that the thumbnail puzzle’s solution was “First”

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

    I think the real thing to fix about Lean is that it should play the explosion sound whenever you use well-founded induction!

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

      Suckerpinch Lean content???? 🥺👉👈

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

      yes please

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

      yes pleaseeee

  • @luck-xc7dy
    @luck-xc7dy 10 หลายเดือนก่อน

    ive never been more confused 😅

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

    woah!!! super cool :> i remember having a similar max_heartbeats error when trying to use the continuity tactic a while back. maybe i should pop by the zulip chat and say hi to everyone there