Skip to content

Add proofs on truth value #2418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 14, 2024
Merged

Conversation

mildsunrise
Copy link
Contributor

Adds a handful of "congruence" proofs on the truth value of a decidable, and also ≐?:

  • Relation.Nullary.Decidable:

    • does-≡: decidables over the same type have the same truth value
    • does-⇔: generalization of does-≡ to mutually implied types
  • Relation.Unary.Properties:

    • ≐?: generalization of Decidable.map to predicates (if two predicates are equivalent, one is decidable if the other is)
    • does-≡: generalization of does-≡ to predicates
    • does-≐: generalization of does-⇔ to predicates

Using these, together with the definitions in Decidable.Core, one can prove the effect of type operations on truth value. For example, proving that Dec (¬ A) and Dec A have negated truth values can be done as does-≡ ¬a? (¬? a?). Same with × / and / .

@MatthewDaggitt MatthewDaggitt added this to the v2.2 milestone Jun 25, 2024
@mildsunrise
Copy link
Contributor Author

(I've simplified the proofs, but the statements remain unchanged)

Copy link
Contributor

@JacquesCarette JacquesCarette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the one name choice, this is great.

mildsunrise and others added 7 commits July 7, 2024 23:07
Adds a handful of properties that prove the truth
value of a decidable:

- `Relation.Nullary.Decidable`:
  - `does-≡`: decidables over the same type have the same truth value
  - `does-⇔`: generalization of `does-≡` to mutually implied types

- `Relation.Unary.Properties`:
  - `≐?`: generalization of `Decidable.map` to predicates
    (if two predicates are equivalent, one is decidable if the other is)
  - `does-≡`: generalization of `does-≡` to predicates
  - `does-≐`: generalization of `does-⇔` to predicates
Co-authored-by: jamesmckinna <31931406+jamesmckinna@users.noreply.github.com>
Co-authored-by: jamesmckinna <31931406+jamesmckinna@users.noreply.github.com>
@MatthewDaggitt
Copy link
Contributor

@JacquesCarette are you willing to approve now?

@JacquesCarette JacquesCarette added this pull request to the merge queue Aug 14, 2024
Merged via the queue into agda:master with commit ab0038b Aug 14, 2024
2 checks passed
does-≡ : (a? b? : Dec A) → does a? ≡ does b?
```

* In `Relation.Nullary.Properties`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We missed this (copy/paste error?) during review: should be Relation.Unary.Properties!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice spot! Any chance of a quick PR?

Copy link
Contributor

@jamesmckinna jamesmckinna Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I have already fixed it on (a couple of ;-)) branches as part of merge conflict resolution for open PRs of mine (eg. on #2383 ), so the alternative would be to merge those... but if you want a cleaner fine-grained git history, happy to do so... #2474

jamesmckinna added a commit to jamesmckinna/agda-stdlib that referenced this pull request Sep 5, 2024
github-merge-queue bot pushed a commit that referenced this pull request Sep 8, 2024
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.

5 participants