Skip to content

Lemmata for if_then_else_ #2747

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 12 commits into from
Jul 2, 2025
Merged

Lemmata for if_then_else_ #2747

merged 12 commits into from
Jul 2, 2025

Conversation

pmbittner
Copy link
Contributor

We used if_then_else_ a lot in one of our projects and it turned out that sometimes these basic lemmata on if_then_else_ are quite useful. While it is typically straightforward to resolve if_then_else_ expressions by pattern matching on the boolean condition instead, sometimes it is convenient to use these lemmata when an if_then_else_ occurs somewhere deep in an equational-reasoning chain.

@pmbittner pmbittner force-pushed the if-lemmas branch 2 times, most recently from 6740db7 to 317ecfb Compare June 26, 2025 06:50
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.

Nice.

A lot of these generalize to partitions and piecewise functions. Which I should implement.

@pmbittner pmbittner changed the title Lemmata for if_then_else Lemmata for if_then_else_ Jun 26, 2025
@MatthewDaggitt
Copy link
Contributor

I'm dubious about the utility of the cong proofs but happy to approve if either i) they are removed or ii) they turn out to be actually needed. See my comment above.

pmbittner added 3 commits July 2, 2025 10:31
This (1) follows the style guide of having a line length limit of 72
characters and (2) increases readability because it enables
immediately seeing which sub-terms of an if_then_else_ expression
are substituted.
@MatthewDaggitt MatthewDaggitt added this pull request to the merge queue Jul 2, 2025
Merged via the queue into agda:master with commit 327ec79 Jul 2, 2025
12 checks passed
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.

6 participants