Skip to content
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

Add @[simp] for Bool.or_assoc and Bool.and_assoc #2017

Closed
1 task done
4e554c4c opened this issue Jan 8, 2023 · 1 comment
Closed
1 task done

Add @[simp] for Bool.or_assoc and Bool.and_assoc #2017

4e554c4c opened this issue Jan 8, 2023 · 1 comment

Comments

@4e554c4c
Copy link

4e554c4c commented Jan 8, 2023

Prerequisites

  • Put an X between the brackets on this line if you have done all of the following:
    • Checked that your issue isn't already filed.
    • Reduced the issue to a self-contained, reproducible test case.

Description

Bool.or_assoc and Bool.and_assoc are not marked as @[simp] even though they are defined in Init.SimpLemmas

theorem Bool.and_assoc (a b c : Bool) : (a && b && c) = (a && (b && c)) := by
cases a <;> cases b <;> cases c <;> decide
theorem Bool.or_assoc (a b c : Bool) : (a || b || c) = (a || (b || c)) := by
cases a <;> cases b <;> cases c <;> decide

This causes a digression in behavior between the simplifier in Lean3 and Lean4.

Versions

version observed: Lean (version 4.0.0-nightly-2023-01-06, commit fedf235cba35, Release)
OS: Linux 6.1.2-arch1-1 GNU/Linux

Additional Information

Related mathport PR: leanprover-community/mathlib4#1404

bors bot pushed a commit to leanprover-community/mathlib4 that referenced this issue Jan 9, 2023
depends on
- [x] depends on: #1407
- [ ] depends on: #1415 otherwise simp cannot unify past a panic

would be nice:
- [ ] leanprover/lean4#2017 will simplify `bitwise_assoc_tac`

Co-authored-by: Calvin Lee <calvins.lee@utah.edu>
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Co-authored-by: ART0 <18333981+0Art0@users.noreply.github.com>
@gebner
Copy link
Member

gebner commented Jan 18, 2023

FWIW, we explicitly removed and_assoc and or_assoc from the simp set in Lean 3. It's only consistent to do the same for Bool.and_assoc and Bool.or_assoc.

jcommelin pushed a commit to leanprover-community/mathlib4 that referenced this issue Jan 23, 2023
depends on
- [x] depends on: #1407
- [ ] depends on: #1415 otherwise simp cannot unify past a panic

would be nice:
- [ ] leanprover/lean4#2017 will simplify `bitwise_assoc_tac`

Co-authored-by: Calvin Lee <calvins.lee@utah.edu>
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Co-authored-by: ART0 <18333981+0Art0@users.noreply.github.com>
@4e554c4c 4e554c4c closed this as not planned Won't fix, can't repro, duplicate, stale Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants