Zulip Chat Archive
Stream: general
Topic: Advent Of Code 2025 - Day 1
Alfredo Moreira-Rosa (Dec 02 2025 at 18:59):
Not sure if it's allowed to post advent of code solutions here or if it's against our zulip policy. Tell me.
So here is my solution for Day 1. No proofs, just algorithm. I'm insterrested in participating in formal proofs of some of them, it may be fun.
Solution
Kim Morrison (Dec 03 2025 at 05:07):
I have Claude working on AoC in Lean at https://github.com/kim-em/AoC2025. I set up the repository initially (based on https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents), without looking at any problems. The first 3 days of problems were successfully completed (including submission) by: claude -p 'Work on AoC'. It took ~10 minutes.
(No proofs here, just programming.)
Alfredo Moreira-Rosa (Dec 03 2025 at 06:39):
The parsing code part of Claude has some flows. It assumes input data is well formed. It's usually true, but if we want to derive a proof on top of the solution, it will give bad results.
Maybe add some instructions to tell it to handle all parsing edge cases.
I think parsing is one of the most important part of AOC, because it can have the most impact on proper modeling of the problem.
Kim Morrison (Dec 03 2025 at 11:19):
I don't think it would be cheating to observe what it did on Days 1-3, and then adjust the prompting and throw out its progress and start over. I had initially intended to ask it to write proofs, but did want to put any significant time into this. If someone wants to fork that repo and write prompts that ask for robust code, and specs, and proofs, that would be fun. :-)
Chris Henson (Dec 03 2025 at 11:59):
For parsing AoC I like to use docs#Std.Internal.Parsec. I think it makes things a lot simpler and more readable.
Markus Himmel (Dec 03 2025 at 12:22):
Consider using https://github.com/fgdorais/lean4-parser instead. I hear it has more features and it's better supported
Alfredo Moreira-Rosa (Dec 03 2025 at 12:23):
Thank you Markus, i'll try it.
Joseph (Dec 09 2025 at 02:30):
https://github.com/josephmate/AdventOfCode2025/blob/main/AdventOfCode2025/Day01.lean
I regret not solving click by click. It resulted in a lot of edge cases to figure it which left me missing a debugger.
Yaël Dillies (Dec 15 2025 at 14:51):
Here's my solution for AoC day 1, without the parsing part, and formally verified (very easy thanks to grind :heart_eyes:):
Eric Rodriguez (Dec 19 2025 at 03:06):
I'm not sure if this is PEBKAC, but I'm finding it quite hard to get decent compile times. On mathlib@v4.27.0-rc1, this file takes 10s every time I run lake build:
import Parser -- fgdorais one
import Std
import Mathlib.Data.ZMod.Basic
If I import all of Mathlib it's more like 51 seconds. When I get it going / on VSCode after it loads, it's fine, but it's kind of surprising it takes that long to me. It seems to be mostly Mathlib. Is this a side-effect of the module system for non-modules? I can't use a module here sadly as Parser hasn't been updated...
Eric Rodriguez (Dec 19 2025 at 03:10):
hmm, I actually can't repro anymore after some fiddling, now it remains OK after lake building enough after editing a file. But I do swear it was very slow before starting to type this up... alas ^^
Kevin Buzzard (Dec 19 2025 at 09:48):
When I had repeated lake builds taking a long time it was my antivirus. The n+1st build would be quick if it was straight after the n'th build but slow if I waited for a few minutes.
Eric Rodriguez (Dec 19 2025 at 13:05):
Hmm, I'm on a mac so I didn't consider this but I do know that apple now has a default antivirus too
Shreyas Srinivas (Dec 19 2025 at 13:06):
Are you sure it's not something your institution installed?
Shreyas Srinivas (Dec 19 2025 at 13:06):
In Kevin's case, I think it was Sophos
Eric Rodriguez (Dec 19 2025 at 15:08):
this is my personal laptop haha
Kevin Buzzard (Dec 19 2025 at 15:53):
(I'm on a mac and it was Microsoft Defender)
Last updated: Dec 20 2025 at 21:32 UTC