-
Notifications
You must be signed in to change notification settings - Fork 312
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] - fix(Data/Set/Image): simp confluence issues with image_subset_iff
#8683
Closed
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c1667b0
fix(Data/Set/Image): simp confluence issues with `image_subset_iff`
timotree3 5629828
Document confluence issues with explicit tests
timotree3 919ee48
fix style
timotree3 6d70b96
move examples to tests/
timotree3 5c73ab3
update implicit arguments as recommended in review
timotree3 895522d
Merge branch 'master' into TCB/image-subset-confl
timotree3 a050646
add `Set.subset_range_of_surjective`
timotree3 108a976
add `Set.preimage_eq_univ_iff`
timotree3 8ed6824
fix simpnf lint
timotree3 2e991ff
remove spurious newline
timotree3 e0edc8c
add Finset.univ_subset_iff
timotree3 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import Mathlib | ||
|
||
namespace Set | ||
|
||
open Function | ||
|
||
variable {α β : Type*} | ||
|
||
/-- Without `subset_range_of_surjective`, `image_subset_iff` and `image_preimage_eq` create a simp | ||
confluence issue. -/ | ||
example {f : α → β} (s t : Set β) (h : Surjective f) : | ||
f '' (f ⁻¹' s) ⊆ t ↔ f '' (f ⁻¹' s) ⊆ t := by | ||
conv => | ||
congr | ||
· simp [h, -image_preimage_eq, -subset_range_of_surjective] | ||
· simp [h, -image_subset_iff, -subset_range_of_surjective] | ||
fail_if_success simp [h, -subset_range_of_surjective] | ||
simp [h] | ||
|
||
/-- Without `Nonempty.subset_preimage_const`, `image_subset_iff` and `Nonempty.image_const` create a | ||
simp confluence issue. -/ | ||
example {s : Set α} (hs : Set.Nonempty s) (t : Set β) (a : β) : | ||
(fun _ => a) '' s ⊆ t ↔ (fun _ => a) '' s ⊆ t := by | ||
conv => | ||
congr | ||
· simp [hs, -Nonempty.image_const, -Nonempty.subset_preimage_const] | ||
· simp [hs, -image_subset_iff, -Nonempty.subset_preimage_const] | ||
fail_if_success simp [hs, -Nonempty.subset_preimage_const] | ||
simp [hs] | ||
|
||
/-- Without `preimage_eq_univ_iff`, `image_subset_iff` and `image_univ` create a | ||
simp confluence issue. -/ | ||
example {f : α → β} (s) : f '' univ ⊆ s ↔ f '' univ ⊆ s := by | ||
conv => | ||
congr | ||
· simp [-image_univ, -preimage_eq_univ_iff] | ||
· simp [-image_subset_iff, -preimage_eq_univ_iff] | ||
fail_if_success simp [-preimage_eq_univ_iff] | ||
simp | ||
|
||
end Set |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Would you mind adding the corresponding lemma for
Finset
?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.
Done