Skip to content

Commit 1b221a1

Browse files
committed
more citations
1 parent 3163590 commit 1b221a1

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

scripts/build_proof_notes.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,15 @@ def note_for(lean_name: str, notes: dict[str, tuple[Path, str]]):
131131
for key in (lean_name.casefold(), lean_name.rsplit(".", 1)[-1].casefold()):
132132
if key in notes:
133133
return notes[key]
134+
# The earliest notes were filed under a *module*-qualified name
135+
# (`QuantumSingleton.dist_implies_correctable.md`) while the Lean declaration is
136+
# root-namespaced (`dist_implies_correctable`), so neither key above matches. Fall
137+
# back to a note whose stem ends with `.<lean_name>`, which recovers those without
138+
# letting a bare suffix collide with an unrelated declaration.
139+
suffix = "." + lean_name.casefold()
140+
matches = [value for key, value in notes.items() if key.endswith(suffix)]
141+
if len(matches) == 1:
142+
return matches[0]
134143
return None
135144

136145

0 commit comments

Comments
 (0)