[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"8mCKuEkd5G":3},"# PalomarTemplate\n\n[![CI](https://github.com/PalomarRegistry/PalomarTemplate/actions/workflows/ci.yml/badge.svg)](https://github.com/PalomarRegistry/PalomarTemplate/actions/workflows/ci.yml)\n\nA best-practice starting point for a\n[Palomar](https://palomar-registry.org/) submission. Use this as a\nGitHub template, replace the toy theorem and all `TEMPLATE` metadata, and keep\nthe separation between the human-auditable statement and the proof.\n\n## Repository map\n\n- `Challenge.lean` is the small statement surface a reader audits.\n- `Solution.lean` connects the same declaration to the completed proof.\n- `PalomarTemplate/` contains the full proof development.\n- `comparator.json` tells Comparator which declarations must match.\n- `formalization.yaml` records the public result description, provenance,\n  authorship, automation, fidelity, and review information.\n- `LICENSE` contains the Apache License 2.0 terms declared by\n  `project.license`.\n- `docbuild/` is the recommended nested doc-gen4 project.\n- `scripts/verify-comparator.sh` runs pinned Comparator, lean4export, NanoDa,\n  and Landrun revisions using the checked-in `comparator.json`, which enables\n  the independent NanoDa replay; `scripts/landrun-wrapper.sh` preserves\n  lean4export's command delimiter when invoked through Landrun's current CLI\n  and refuses any Comparator request to switch off part of the sandbox.\n\nThe root uses `lakefile.toml`, a supported stable Lean toolchain, and committed\nLake manifests. The verifier reads `lean-toolchain` and checks that its pinned\nlean4export revision targets the same toolchain. When changing that exporter\npin, review whether Comparator and NanoDa remain compatible with its export\nformat. GitHub Actions builds the Lean project with `lean-action`, generates API\ndocumentation with doc-gen4, and independently checks the advertised statement\nwith Comparator. Actions and verification tools are pinned to immutable\ncommits.\n\n## Start a real project\n\n1. Click **Use this template** on GitHub and clone the new repository.\n2. Rename `PalomarTemplate` in the Lake package, module directory, namespace,\n   Comparator declaration, and metadata.\n3. Replace the example library, `Challenge.lean`, and `Solution.lean`.\n   Keep `Challenge.lean` as the small statement-only surface, with one `sorry`\n   for each advertised declaration; put the proofs in `Solution.lean`, where\n   Comparator checks them against those statements. The proof-status counts in\n   `formalization.yaml` exclude the deliberate Challenge `sorry`s.\n4. Replace every `TEMPLATE` value in `formalization.yaml`. Values that might\n   otherwise look like plausible defaults—including repository role,\n   classifications, proof counts, automation method, and review status—are\n   deliberately invalid until you choose them. Replace a placeholder list with\n   an empty list only where its adjacent comment permits that; lists described\n   as required must remain nonempty.\n   Write `project.description` as the concise public registry abstract for the\n   formalization as a whole. It should let a mathematical reader identify the\n   subject and principal result families; it is not an inventory of Comparator\n   declarations, and the README and Challenge documentation can carry the\n   fuller account. `status.main_results` is optional: add it only when a short\n   curated project-level list is useful, not to mirror Comparator declarations.\n   The `sources` list must remain nonempty. Every source relationship must be\n   exactly `formalizes`, `adapts`, `independently-proves`, `background`, or\n   `other`. Choose one result origin: for a result first presented by the\n   formalization, include a descriptive source with `type: original-proof` and\n   `relationship: other`; every additional source must use `background` or\n   `other`. Otherwise, omit `type: original-proof`, and give at least one cited\n   mathematical source a `formalizes`, `adapts`, or `independently-proves`\n   relationship. A new proof of a known published result is source-based and\n   uses `independently-proves`, not `original-proof`.\n\n   Every source needs a title and relationship. Its `type`, authors,\n   contributors, identifier, location, licence, and endorsement may be removed\n   when genuinely inapplicable. Use authors only for bibliographic authorship;\n   use contributors with a name and free-form role for credits such as editors\n   and problem proposers. A retained type is a concise free-text description\n   such as `article`, `paper`, `book`, `formalization`, `web post`,\n   `folklore`, or `conversation`. The exact value `original-proof` is\n   reserved for the result-origin declaration above. Set\n   `repository.role` to `substantive-development` and omit\n   `substantive_formalization`, or set it to `thin-wrapper` and provide the\n   underlying `owner/repository` or `https://github.com/owner/repository` URL\n   plus its full 40-character lowercase commit SHA. Remove\n   `related_formalizations` or set it to `[]` when none are known.\n   Keep the repository's Apache-2.0 `LICENSE` file and the matching\n   `project.license: \"Apache-2.0\"` metadata. This starter template supports\n   only that root licence. If the project deliberately uses another root\n   licence permitted by Palomar policy, use another starting point or own and\n   maintain the project's licence-validation CI contract. Cited sources and\n   dependencies retain their own licences.\n5. Update and commit dependency pins:\n\n   Before fetching and building the dependency closure, budget several GiB of\n   free space. After the root cache fetch and build, a clean local checkout of\n   the template's pinned Lean v4.32.0 manifest occupied about 7.7 GiB across\n   about 123,000 files under `.lake/`. The documentation build adds doc-gen4 and\n   its dependency closure under the shared `.lake/packages/` plus generated\n   output under `docbuild/.lake/`. The precise footprint changes with the\n   filesystem, cache contents, and any dependency updates. Both `.lake/`\n   directories are generated and must not be committed.\n\n   ```text\n   lake update\n   (cd docbuild && MATHLIB_NO_CACHE_ON_UPDATE=1 lake update)\n   ```\n\n6. Run the project checks before submitting:\n\n   ```text\n   lake exe cache get\n   lake build\n   (cd docbuild && lake build PalomarTemplate:docs)\n   ruby scripts/validate-formalization.rb\n   ./scripts/verify-comparator.sh\n   ```\n\n   The metadata command parses the YAML, requires the Apache-2.0 root-licence\n   declaration, and reports the path of every retained template sentinel. CI\n   also detects the checked-in `LICENSE` file independently and runs an\n   explicit `--expect-template` check only in the canonical\n   `PalomarRegistry/PalomarTemplate` repository, proving that the shipped toy\n   metadata still has exactly the intended sentinel surface. Pull requests\n   from contribution forks run in that upstream repository context. Every\n   other repository—including standalone forks and repositories made with\n   **Use this template**—runs the ordinary command and requires every sentinel\n   to be replaced. CI also runs the corresponding build, documentation, cache,\n   and Comparator checks. Run the final command from the repository root. The\n   full check set requires Linux, Git, Go, Ruby, Rust/Cargo, Python 3, and a\n   working Landrun sandbox.\n\n   The pinned `lean-action` likewise runs `lake exe cache get` in CI and caches\n   `.lake/`. A successful canonical starter run deliberately includes the\n   statement-surface `sorry` warning and demonstrates the wiring, not submission\n   completeness.\n\n7. Read the current\n   [Palomar submission policy](https://github.com/PalomarRegistry/PalomarPolicy/blob/main/CONTRIBUTING.md),\n   commit the final snapshot, and\n   [open the submission form](https://submit.palomar-registry.org/)\n   with the full 40-character commit SHA.\n\n   Submit only if you are a responsible author or maintainer of the substantive\n   formalization, or have approval from one. For a thin wrapper, answer about\n   the underlying formalization rather than the wrapper; the form records that\n   relationship and allows optional evidence.\n\n## Important boundaries\n\nThis repository is structurally valid but its toy theorem does **not** meet\nPalomar's editorial floor. A green build or Comparator check establishes only\nthat Lean accepts the project and that the recorded solution proves the recorded\nstatement using the permitted axioms. It does not establish mathematical\nsignificance, fidelity to a source, novelty, or peer review.\n\nKeep `Challenge.lean` ordinary and readable. Definitions needed by the statement\nmust have precise mathematical meanings and docstrings. Its transitive imports\nmust resolve to Lean core, Mathlib, Tau Ceti, or CSLib; a Tau Ceti or CSLib\nimport enlarges the trust surface and is prominently flagged. Dependencies used\nonly by the proof may be arbitrary pinned Git dependencies.\nThe root licence covers this repository snapshot only; cited papers, reused\nformalizations, and dependencies retain their own licences.\n\nQuestions are welcome in the\n[Palomar channel on the Lean Zulip](https://leanprover.zulipchat.com/#narrow/channel/621638-Palomar).\n",1788025907053]