{"id":13484354,"url":"https://github.com/dwrensha/compfiles","last_synced_at":"2025-08-02T05:10:25.182Z","repository":{"id":65727271,"uuid":"575144756","full_name":"dwrensha/compfiles","owner":"dwrensha","description":"Catalog Of Math Problems Formalized In Lean","archived":false,"fork":false,"pushed_at":"2025-07-31T00:30:36.000Z","size":2565,"stargazers_count":185,"open_issues_count":1,"forks_count":37,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-07-31T00:53:57.816Z","etag":null,"topics":["lean4"],"latest_commit_sha":null,"homepage":"https://dwrensha.github.io/compfiles/","language":"Lean","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dwrensha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-12-06T21:22:06.000Z","updated_at":"2025-07-31T00:30:40.000Z","dependencies_parsed_at":"2023-09-25T02:45:01.725Z","dependency_job_id":"0cbc791f-f941-4bcd-8b9b-95f7d9488ad3","html_url":"https://github.com/dwrensha/compfiles","commit_stats":null,"previous_names":["dwrensha/compfiles"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/dwrensha/compfiles","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwrensha%2Fcompfiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwrensha%2Fcompfiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwrensha%2Fcompfiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwrensha%2Fcompfiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dwrensha","download_url":"https://codeload.github.com/dwrensha/compfiles/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwrensha%2Fcompfiles/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268338289,"owners_count":24234540,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lean4"],"created_at":"2024-07-31T17:01:22.949Z","updated_at":"2025-08-02T05:10:25.173Z","avatar_url":"https://github.com/dwrensha.png","language":"Lean","funding_links":[],"categories":["Lean"],"sub_categories":[],"readme":"# Compfiles: Catalog Of Math Problems Formalized In Lean, Emphasizing Solutions\n\nA collection of olympiad-style math problems and their solutions,\nformalized in [Lean 4](https://github.com/leanprover/lean4).\n\n## dashboard\n\nA list of all the problems and their status is\navailable as a [dashboard](https://dwrensha.github.io/compfiles/)\nthat gets automatically updated on every push to the `main` branch of this repo.\n\n## building\n\nMake sure you have [`elan`](https://github.com/leanprover/elan) installed.\nThen do:\n\n```\n$ lake exe cache get\n$ lake build\n```\n\n## extracting problems\n\nIn this repo,\neach solution (proof) is recorded inline, in the same file that its problem is declared.\nIn some situations, however, solution data is undesired.\nFor example, we might want a [website](https://dwrensha.github.io/compfiles/)\nto display only the problem statement,\nor we might\nwant to invoke an [IMO Grand Challenge](https://imo-grand-challenge.github.io/)\nsolver without providing spoilers.\n\nTo that end, this repo defines some [special commands](/ProblemExtraction.lean)\nto support problem extraction.\n\n* A `problem_file` command marks a file that should participate in problem extraction.\n* A `problem` declaration is the main theorem to be proved.\n  The body of the declaration (everything to the right of `:=`) is replaced by `sorry`\n  in the extracted problem.\n* A `determine` declaration indicates data the must be provided as part of the solution.\n  Like with `problem`, the body of the declaration is replaced by `sorry` in the\n  extracted problem.\n* A `snip begin` ... `snip end` sequence indicates commands that should be omitted\n  in the extracted problem.\n\nTo generate problem statements with all solution information stripped, do:\n```\n$ lake exe extractProblems\n```\nand then look in the `_extracted/problems` directory.\n\n## extracting solutions\n\nSometimes it's useful to have a version of a solution\nthat does not depend on the `ProblemExtraction` library\n(but still contains all proof information).\nFor example, you might want to share a fully worked solution\non https://live.lean-lang.org/.\n\nTo that end, the `extractProblems` tool described above\nadditionally extracts dependency-stripped solution files into the\n`_extracted/solutions` directory.\n\n## checking solutions\n\nThe `checkSolution` executable takes as input a problem ID\nand a path to a lean source code file. For example:\n```\n$ lake exe checkSolution Imo2022P2 _extracted/solutions/Imo2022P2.lean\n```\nThis will check that the extracted solution file\n`_extracted/solutions/Imo2022P2.lean`\ndoes indeed pass verification for problem `Imo2022P2`. It will print the terms\nfor any `determine` declarations in the solution, so that\nthey can be judged by a human. In this example, that will look like:\n```\ndetermine Imo2022P2.solution_set := {fun x =\u003e 1 / x}\n```\n\nThe intention is that this solution checker could be used as a\ngrader for the [IMO Grand Challenge](https://imo-grand-challenge.github.io/).\n\n## contributing\n\nContributions are welcome!\nYou may take credit for you work by adding yourself\nto the \"authors\" field in the copyright header.\n\n## external sources\n\nSome problems were imported from external sources:\n\n* [mathlib4/Archive/Imo](https://github.com/leanprover-community/mathlib4/tree/master/Archive/Imo).\n* Gian Sanjaya's [Lean 3](https://github.com/mortarsanjaya/imo-A-and-N) and\n  [Lean 4](https://github.com/mortarsanjaya/IMOSLLean4) formalizations of\n  IMO shortlist problems.\n* Joseph Myers's [IMOLean](https://github.com/jsm28/IMOLean/tree/main) repository.\n* Roozbeh Yousefzadeh's [Imo-Steps](https://github.com/roozbeh-yz/IMO-Steps) repository.\n\n## videos\n\n|  |  |\n| ----- | ---- |\n| [IMO 1996 Problem 3](/Compfiles/Imo1996P3.lean) | [\u003cimg src=\"http://img.youtube.com/vi/5NbYtDfXfR4/maxresdefault.jpg\" height=\"120px\"\u003e](https://youtu.be/5NbYtDfXfR4)|\n| [IMO 1987 Problem 4](/Compfiles/Imo1987P4.lean) | [\u003cimg src=\"http://img.youtube.com/vi/gi8ZTjRO-xI/maxresdefault.jpg\" height=\"120px\"\u003e](https://youtu.be/gi8ZTjRO-xI)|\n| [IMO 1964 Problem 4](/Compfiles/Imo1964P4.lean) | [\u003cimg src=\"http://img.youtube.com/vi/TOzS4aC_K1g/maxresdefault.jpg\" height=\"120px\"\u003e](http://youtu.be/TOzS4aC_K1g)|\n| [IMO 1964 Problem 1b](/Compfiles/Imo1964P1.lean) | [\u003cimg src=\"http://img.youtube.com/vi/9d2nicgd68Q/maxresdefault.jpg\" height=\"120px\"\u003e](http://youtu.be/9d2nicgd68Q)|\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwrensha%2Fcompfiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdwrensha%2Fcompfiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwrensha%2Fcompfiles/lists"}