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

refactor(algebra/big_operators,data/finset): use finset.disjoint in definitions #1456

Merged
merged 6 commits into from
Sep 18, 2019

Conversation

Vierkantor
Copy link
Collaborator

In algebra/big_operators.lean, some definitions don't use finset.disjoint but write out
out s₁ ∩ s₂ = ∅ (which is slightly incompatible with disjoint). This pull request changes those definitions to use disjoint instead, and includes updates to fix dependencies on these definitions. Since many uses included the lemma finset.filter_inter_filter_neg_eq, I introduced a lemma finset.disjoint_filter which serves the same role.

Zulip discussion: https://leanprover.zulipchat.com/#narrow/stream/113489-new-members/topic/disjoint.20in.20algebra.2Ebig_operators

For reviewers: code review check list

@Vierkantor Vierkantor requested a review from a team as a code owner September 18, 2019 12:33
src/group_theory/order_of_element.lean Outdated Show resolved Hide resolved
src/data/zmod/quadratic_reciprocity.lean Outdated Show resolved Hide resolved
@Vierkantor
Copy link
Collaborator Author

It actually seems that the other tactics are up to the job so we can simply remove the simps.

@jcommelin
Copy link
Member

Heh, nice!

@jcommelin jcommelin added the ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) label Sep 18, 2019
(∀x, p x → ¬ q x) → disjoint (s.filter p) (s.filter q) :=
assume h, by simp only [disjoint_iff_ne, mem_filter]; rintros a ⟨_, ha⟩ b ⟨_, hb⟩ eq;
rw [eq] at ha; exact h _ ha hb

Copy link
Member

Choose a reason for hiding this comment

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

This could be stated as disjoint (s.filter p) (s.filter q) \iff (∀x \in s, p x → ¬ q x)

@mergify mergify bot merged commit 08390f5 into leanprover-community:master Sep 18, 2019
JaredCorduan pushed a commit to JaredCorduan/mathlib that referenced this pull request Oct 12, 2019
… definitions (leanprover-community#1456)

* Use `finset.disjoint` in `algebra/big_operators`

* New lemma `disjoint_filter`

It should be a painless step from using `filter_inter_filter_neg_eq`
to using this lemma

* Update other dependencies of finset.prod_union and finset.prod_bind

* Reformat some lines to make them fit within 100 characters

* We can actually do away with two non-terminal `simp`s now
anrddh pushed a commit to anrddh/mathlib that referenced this pull request May 15, 2020
… definitions (leanprover-community#1456)

* Use `finset.disjoint` in `algebra/big_operators`

* New lemma `disjoint_filter`

It should be a painless step from using `filter_inter_filter_neg_eq`
to using this lemma

* Update other dependencies of finset.prod_union and finset.prod_bind

* Reformat some lines to make them fit within 100 characters

* We can actually do away with two non-terminal `simp`s now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants