Datasets:
File size: 2,471 Bytes
8ca48d7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | /-
Copyright 2026 The Formal Conjectures Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-/
module
public import Lean
/-!
# Canonical problem metadata
The website, the Erdős status checker, the proof-link checker, the comparator
workspace generator and the review tooling all need overlapping facts about
this repository's declarations, and each has been re-deriving them. This
module is where the shared representation lives, so that one semantic fact is
interpreted once.
It starts deliberately small: `FormalProofInfo` is the schema
`extract_names` exports as `formalProofs` (`schemaVersion` 2), moved here so
its next consumer imports it rather than restating it. A `ProblemSpec`
bundling declaration, module, category, subjects, question kind and source
range belongs here too, and arrives when `extract_names`' internal
`TheoremInfo` migrates; growing it ahead of its consumers would be schema
fiction.
-/
public section
open Lean
namespace FormalConjectures.Metadata
/-- One formal proof attached to a declaration. Assumptions belong to the
individual proof, not to the conjecture: a statement can carry a conditional
proof and an unconditional one at once, and Erdős 427 does. -/
public structure FormalProofInfo where
kind : String
link : String
conditions : List String
public def FormalProofInfo.toJson (proof : FormalProofInfo) : Json :=
Json.mkObj
[("kind", Lean.toJson proof.kind),
("link", Lean.toJson proof.link),
("conditions", Lean.toJson proof.conditions)]
/-- A key that orders the proofs of one declaration deterministically.
The attribute state is a `HashSet`, so it does not preserve the order the
annotations were written in. Conditions are part of the key: two proofs may
share kind and link and differ only in what they assume. -/
public def FormalProofInfo.sortKey (proof : FormalProofInfo) : String :=
proof.kind ++ " " ++ proof.link ++ " " ++ String.intercalate "," proof.conditions
end FormalConjectures.Metadata
end
|