Zulip Chat Archive
Stream: Is there code for X?
Topic: naming some lemmas about Prop
Kim Morrison (Nov 05 2024 at 03:29):
What should these be called?
@[simp] theorem or_and_left_self_left : a ∨ (a ∧ b) ↔ a := sorry
@[simp] theorem or_and_left_self_right : a ∨ (b ∧ a) ↔ a := sorry
@[simp] theorem and_or_right_self_left : (a ∧ b) ∨ a ↔ a := sorry
@[simp] theorem and_or_right_self_right : (b ∧ a) ∨ a ↔ a := sorry
Bjørn Kjos-Hanssen (Nov 05 2024 at 05:25):
@[simp] theorem left_absorbs_or_self_left : a ∨ (a ∧ b) ↔ a := sorry
@[simp] theorem left_absorbs_or_self_right : a ∨ (b ∧ a) ↔ a := sorry
@[simp] theorem right_absorbs_or_self_left : (a ∧ b) ∨ a ↔ a := sorry
@[simp] theorem right_absorbs_or_self_right : (b ∧ a) ∨ a ↔ a := sorry
with duals having names starting like left_absorbs_and_self_left
. At any rate, maybe include something about "absorb"?
Kim Morrison (Nov 05 2024 at 06:34):
Hmm, I'm hesitant to introduce a new keyword in the name scheme.
Floris van Doorn (Nov 05 2024 at 08:40):
How about following docs#add_sub_cancel_left ?
or_and_cancel_left
or_and_cancel_right
and_or_cancel_left
and_or_cancel_right
Yaël Dillies (Nov 05 2024 at 08:49):
But there's no cancellation, only absorption
Yaël Dillies (Nov 05 2024 at 08:50):
What about
or_and_absorbs_right
or_and_absorbs_left
and_or_absorbs_right
and_or_absorbs_left
Sébastien Gouëzel (Nov 05 2024 at 09:04):
I don't think absorbs
is already used in this sense in Mathlib (as far as I can tell, it's mostly used for topological vector spaces, in a rather precise sense), so I'd rather avoid introducing new terminology that users couldn't guess. cancel
would be more standard in this respect.
Sébastien Gouëzel (Nov 05 2024 at 09:06):
Another possibility is or_and_iff_self_left
, or_and_iff_self_right
, and_or_iff_self_left
and and_or_iff_self_right
.
Yaël Dillies (Nov 05 2024 at 09:21):
And what about these lemmas?
@[simp] theorem or_and_left_self_left : a ∧ (a ∨ b) ↔ a := sorry
@[simp] theorem or_and_left_self_right : a ∧ (b ∨ a) ↔ a := sorry
@[simp] theorem and_or_right_self_left : (a ∨ b) ∧ a ↔ a := sorry
@[simp] theorem and_or_right_self_right : (b ∨ a) ∧ a ↔ a := sorry
Yaël Dillies (Nov 05 2024 at 09:22):
Sébastien Gouëzel said:
I don't think
absorbs
is already used in this sense in Mathlib (as far as I can tell, it's mostly used for topological vector spaces, in a rather precise sense), so I'd rather avoid introducing new terminology that users couldn't guess.
Indeed, I am suggesting we introduce a new naming convention for lemmas of a new kind. We successfully similarly introduced anticomm
, rotate
and antidistrib
in the past
Yaël Dillies (Nov 05 2024 at 09:23):
I maintain that these are not cancel
lemmas
Bjørn Kjos-Hanssen (Nov 05 2024 at 17:24):
https://en.wikipedia.org/wiki/Absorption_law
Last updated: May 02 2025 at 03:31 UTC