Skip to content

Add Redundancy Tests#155

Merged
ScriptRaccoon merged 19 commits intomainfrom
redundancy-tests
May 7, 2026
Merged

Add Redundancy Tests#155
ScriptRaccoon merged 19 commits intomainfrom
redundancy-tests

Conversation

@ScriptRaccoon
Copy link
Copy Markdown
Owner

@ScriptRaccoon ScriptRaccoon commented May 3, 2026

This PR resolves #153 by adding a script pnpm db:redundancies that checks for redundant assignments of properties.

This PR also removes all 39 redundant assignments of unsatisfied properties. Some proofs generated by CatDat are quite clever, some are easy. It also removes 25 redundant assignments of satisfied properties.

For satisfied properties, I did not remove all redundant assignments, because in some cases, there were good reasons to keep them (see below). Accordingly, I also added an option to let the script skip these.

Documentation in Contribution Guidelines

"As noted above, avoid redundant property assignments to a category. To detect redundancies, run pnpm db:redundancies.

The script reports at most one redundant assignment per category for each of satisfied and unsatisfied properties, even if multiple exist. After removing an assignment, run the script again to ensure that all remaining redundancies are handled.

Removing redundant assignments is not required, but it is recommended, especially for all unsatisfied properties. For satisfied properties, removal depends on context: keep them if the proof is meaningful, otherwise consider removing them if it is purely technical or uninformative.

In particular, it often makes sense to keep a redundant assignment of a satisfied property in the following cases:

  • The proof for the property is straight forward anyway (e.g. showing that a category is pointed).
  • The proof provides useful insight.
  • The proof constructs objects (especially limits or colimits) that are used later.
  • Removing the assignment would lead to an overly complex deduction generated by CatDat.
  • The proof establishes an intermediate result that is used as an assumption in a later argument.

For example, you may first prove that a category has zero morphisms, and then prove that it is normal. Although the database contains the implication "normal => zero morphisms", in practice the latter is used as a prerequisite. Similarly, when proving that a category is extensive, it is often clearer to first show that finite coproducts exist, rather than relying on the implication "extensive => finite coproducts". Also, an explicit description of finite coproducts is useful for deciding other properties involving coproducts.

Every redundant assignment of a satisfied property that is intentionally kept must be explicitly marked to skip the redundancy check. See N.sql for an example."

How to keep redundant assignments

--- File: N.sql
 
-- properties that should be ignored by the redundancy check script
UPDATE category_property_assignments
SET check_redundancy = FALSE
WHERE category_id = 'N'
AND property_id IN ('thin', 'finitely cocomplete');

Example Output

--- Check redundant category property assignments ---
🟠 Redundant satisfied property for Man: "well-powered" is implied by others.
🟠 Redundant satisfied property for TorsAb: "cocomplete" is implied by others.
🟠 Redundant satisfied property for TorsFreeAb: "complete" is implied by others.
🟠 Redundant satisfied property for BN: "pullbacks" is implied by others.
🟠 Redundant satisfied property for BOn: "pullbacks" is implied by others.
🟠 Redundant satisfied property for N_oo: "coproducts" is implied by others.
🟠 Redundant satisfied property for Z_div: "products" is implied by others.
Found 7 redundant assignments

@ScriptRaccoon ScriptRaccoon marked this pull request as ready for review May 3, 2026 23:00
@ScriptRaccoon ScriptRaccoon force-pushed the redundancy-tests branch 3 times, most recently from 3f5a01a to 5b68e0c Compare May 5, 2026 09:47
@ScriptRaccoon ScriptRaccoon force-pushed the redundancy-tests branch 2 times, most recently from 33cb1a1 to 3da0d03 Compare May 5, 2026 20:47
@ScriptRaccoon ScriptRaccoon changed the title Add Redundancy Tests (WIP) Add Redundancy Tests May 6, 2026
Comment thread DATABASE.md Outdated
@dschepler
Copy link
Copy Markdown
Contributor

Looks good to me.

@ScriptRaccoon
Copy link
Copy Markdown
Owner Author

Thank you for having a look!

@ScriptRaccoon ScriptRaccoon merged commit 579a725 into main May 7, 2026
1 check passed
@ScriptRaccoon ScriptRaccoon deleted the redundancy-tests branch May 7, 2026 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include a test for redundant explicit assignments

2 participants