-
Notifications
You must be signed in to change notification settings - Fork 297
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 by Bors] - feat(data/bool/basic): Kaminski's equation #14159
Conversation
bool.apply_apply_apply : ∀ (f : bool → bool) (x : bool), f (f (f x)) = f x
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one minor suggestion. Thanks!
bors d+
✌️ slerpyyy can now approve this pull request. To approve and merge a pull request, simply reply with |
Co-authored-by: Bryan Gin-ge Chen <bryangingechen@gmail.com>
Co-authored-by: Bryan Gin-ge Chen <bryangingechen@gmail.com>
theorem apply_apply_apply (f : bool → bool) (x : bool) : f (f (f x)) = f x := | ||
by cases x; cases h₁ : f tt; cases h₂ : f ff; simp only [h₁, h₂] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this shorter proof work in this file?
theorem apply_apply_apply (f : bool → bool) (x : bool) : f (f (f x)) = f x := | |
by cases x; cases h₁ : f tt; cases h₂ : f ff; simp only [h₁, h₂] | |
theorem apply_apply_apply : ∀ (f : bool → bool) (x : bool), f (f (f x)) = f x := | |
dec_trivial |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked locally and it seems like it doesn't
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neither does Patrick Johnson's fin_cases
proof
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eric-wieser What imports did that need? This module is a mathlib root (no imports!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It needs data.fintype.basic
:
import data.fintype.basic
lemma foo : ∀ (f : bool → bool) {x : bool}, f (f (f x)) = f x :=
dec_trivial
as it uses pi.fintype
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surely this would make for a nice (if niche) simp
theorem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not valid for simp
because the head symbol is not a constant, so lean can infer f = fun x, x
and get stuck in a loop
We should probably wait for the ongoing Zulip discussion about whether "Kaminski's equation" is a reasonable name to resolve before merging this. |
It seems there is no more discussion about this so I will go ahead and merge it |
bors r+ |
`bool.apply_apply_apply : ∀ (f : bool → bool) (x : bool), f (f (f x)) = f x`
Pull request successfully merged into master. Build succeeded: |
bool.apply_apply_apply : ∀ (f : bool → bool) (x : bool), f (f (f x)) = f x