Introducing Lemma: an open-source macOS PDF reader for mathematics (SwiftUI, AppKit, PDFKit)

Hi all,

I've been building Lemma, a free and open-source (GPL-3.0) PDF reader for math-heavy books and papers on macOS: GitHub - fus3r/lemma: An IDE for reading mathematics: a free, open-source PDF reader for the Mac that turns references into links, proofs into steps and checks derivations as you write them. · GitHub

It reads a PDF once and turns references like "Theorem 2.3" or "(3.41)" into links. Hovering shows a preview, clicking opens the statement in a panel right under the line you're reading, and proofs can be folded. There's also a derivation checker: each line you type is evaluated with random values of the right shapes, so a sign slip comes back as a counterexample.

On the Swift side: the app is SwiftUI on top of AppKit and PDFKit, laid out as a VS Code-style workbench (editor groups, side bar, panel, command palette, themes). The PDF analysis (numbering, references, proofs, the book's index) runs in a separate helper process so long books don't stall the UI. Hosting PDFView and WKWebView in SwiftUI took a few workarounds (scroll forwarding, one NSView shared by two representables), happy to go into details.

It needs macOS 15. Builds aren't notarized yet, so macOS asks you to allow it once.

If you'd like to contribute, the issues tagged good first issue are a reasonable way in (one is a small addition to the peek UI). Feedback on the architecture is welcome too.

3 Likes