Skip to content

feat: Lean linkage#243

Open
felixpernegger wants to merge 3 commits intopi-base:mainfrom
felixpernegger:checkmarklean
Open

feat: Lean linkage#243
felixpernegger wants to merge 3 commits intopi-base:mainfrom
felixpernegger:checkmarklean

Conversation

@felixpernegger
Copy link
Copy Markdown
Contributor

@felixpernegger felixpernegger commented Mar 27, 2026

This is a rough implementation for Lean linkage discussed various times now.
As you might guess, this was created by Claude Code (since I cant write TypeScript :( ). I tested a little bit and it seems to be working fine though.

The implementation is similar to the on in erdosproblems.com : If in the pibase lean repo there exists an appropriate file for the theorem/property it links to that and otherwise says "No formalisation available.".

We might wanna use a different repository (make one in github.com/pi-base). I am really not in favour to just use the data repo.
This doesnt read the data off a JSON file (which I think is the case for the normal data?) but just fetches the lean repo directly. I think its acceptable to try this version out and if there are issues, maybe change it later.

Two final issues:

  • Formalisations of theorems and especially properties need to be reviewed. It is very easy to get details wrong.
  • If a theorem or property definition is changed slightly (i.e. change if property is true for empty space etc. or conditions in theorem are weakened), the formalisation linked to will be inconsitent with the statement in pibase generally. So some kind of flagging system (in the data repo) might be good to have (like: in each theorem/property file one can add a line: leanOutdated: true to overwrite linking to the lean repo or something).

There are some other things concerning the Lean repo (formatting, CI, tagging IDs properly etc), but this isnt urgent.

I would really appreciate that we can move forward with this PR quickly, so to avoid the issues outlined above, I heavily trimmed the lean repo to only contain definitions which are (basically) in mathlib

@StevenClontz

@felixpernegger felixpernegger changed the title Lean linkage feat: Lean linkage Mar 27, 2026
Copy link
Copy Markdown
Member

@StevenClontz StevenClontz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to considering felixpernegger#2 I'd like to do one more thing...

Look at #241 and see how we added a global store which toggles whether we show redundancies. Add a second checkbox that toggles whether we show LeanLinks. Mark this as experimental and false by default. While we are experimenting, you can do whatever you want with your personal repo that it points to. We'll see how it goes and decide on when/how to make this an official pi-base project. And importantly, we can get this merged over the weekend.

height="20"
viewBox="0 0 486 169"
xmlns="http://www.w3.org/2000/svg"
stroke="auto"
Copy link
Copy Markdown
Contributor

@yhx-12243 yhx-12243 Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto make it invisible in my local env.

Should change to black, or something.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems strange to me -- it should be inheriting the color (#007bff) of the link it shows up in:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants