Add proof dependencies (WIP)#301
Draft
ScriptRaccoon wants to merge 2 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WIP
Why we need proof dependencies
Many proofs of properties depend on other properties. While the deduction system takes care of many proofs of this type, some proofs cannot be done automatically via implications. In these cases, this information was stored only in the proof text and was not validated at all.
For example, if a proof referred to the "fact" that Grp is abelian, no contradiction would be detected, even though the database of course contains the information that Grp is not abelian. It might also happen that a proof uses the fact that a certain category has a property, even though the database does not contain this information at all, i.e. the property has not been decided yet.
The mentioned issues can easily be prevented with a good review process. However, the worst case is that we discover that some proof is wrong and cannot be fixed. In that case, we remove the assignment (or even negate it!), but we cannot be sure whether any other proof depends on the removed assignment or how to locate these proofs. This is a non-trivial problem, since the proofs might depend on properties that were deduced from the deleted assignment. (This is actually a big problem in the mathematical literature, which cannot be fixed in that context.)
This PR fixes this by checking that all proof dependencies are valid. As a necessary step, all proof dependencies now need to be documented.
How
Concretely, for every property assignment that depends on another property assignment, this dependency must be added manually alongside the assignment. Here is a typical example from
Alg(R).yaml:The seed script writes these dependencies to a new table in the database called
required_property_assignments. The checks cannot be performed at this point since some requirements refer to deduced properties. (For example, the proof that Cat is infinitary extensive depends on the fact that Set is infinitary extensive, and the latter is deduced from the fact that it is a Grothendieck topos.) Thus, we first let the deduction script run and only perform the checks in the test script (pnpm db:test). There, a new functiontest_proof_dependencieschecks whether all claimed properties are actually valid.References are dependencies
References to facts are treated as dependencies as well, since otherwise they do not make any sense. For example, here is a passage from
CAlg(R)(with a proof excerpt):Here is another example from
CAlg(R):Technical stuff
We need to add the
typeinformation (which is currently eithercategory,functor, ormorphism) to each dependency since a property is no longer uniquely determined by its name (cf. #263). One could derive the type from theid, which still identifies structures, but for now I have decided not to do that.TODOs
Next
Another issue is to prevent circularity. This can be checked in another PR.
This work can also be seen as a preparation for #22.