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

[Merged by Bors] - refactor(topology/discrete_quotient): review API #18401

Closed
wants to merge 2 commits into from

Conversation

urkud
Copy link
Member

@urkud urkud commented Feb 8, 2023

Backport various changes I made to the API while porting to Lean 4 in leanprover-community/mathlib4#2157.

  • extend setoid X;
  • require only that the fibers are open in the definition, prove that they are clopen;
  • golf proofs, reuse lattice structure on setoids;
  • use bundled continuous maps for comap;
  • swap LHS and RHS in some simp lemmas;
  • generalize the order_bot instance from a discrete space to a locally connected space;
  • prove that a discrete topological space is locally connected.

Open in Gitpod

@urkud urkud added awaiting-review The author would like community review of the PR t-topology Topological spaces, uniform spaces, metric spaces, filters mathlib4-pair labels Feb 8, 2023
@urkud urkud requested a review from adamtopaz February 8, 2023 14:52
Comment on lines 77 to +84
def of_clopen {A : set X} (h : is_clopen A) : discrete_quotient X :=
{ rel := λ x y, x ∈ A ∧ y ∈ A ∨ x ∉ A ∧ y ∉ A,
equiv := ⟨by tauto!, by tauto!, by tauto!⟩,
clopen := begin
intros x,
by_cases hx : x ∈ A,
{ apply is_clopen.union,
{ convert h,
ext,
exact ⟨λ i, i.2, λ i, ⟨hx,i⟩⟩ },
{ convert is_clopen_empty,
tidy } },
{ apply is_clopen.union,
{ convert is_clopen_empty,
tidy },
{ convert is_clopen.compl h,
ext,
exact ⟨λ i, i.2, λ i, ⟨hx, i⟩⟩ } },
end }

lemma refl : ∀ x : X, S.rel x x := S.equiv.1
lemma symm : ∀ x y : X, S.rel x y → S.rel y x := S.equiv.2.1
lemma trans : ∀ x y z : X, S.rel x y → S.rel y z → S.rel x z := S.equiv.2.2
{ to_setoid := ⟨λ x y, x ∈ A ↔ y ∈ A, λ _, iff.rfl, λ _ _, iff.symm, λ _ _ _, iff.trans⟩,
is_open_set_of_rel := λ x,
by by_cases hx : x ∈ A; simp [setoid.rel, hx, h.1, h.2, ← compl_set_of] }

lemma refl : ∀ x, S.rel x x := S.refl'
lemma symm {x y : X} : S.rel x y → S.rel y x := S.symm'
lemma trans {x y z} : S.rel x y → S.rel y z → S.rel x z := S.trans'
Copy link
Member

Choose a reason for hiding this comment

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

Nice!

Copy link
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

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

Generally looks good to me.

maintainer merge

@@ -40,7 +40,7 @@ variables (X : Profinite.{u})

/-- The functor `discrete_quotient X ⥤ Fintype` whose limit is isomorphic to `X`. -/
def fintype_diagram : discrete_quotient X ⥤ Fintype :=
{ obj := λ S, Fintype.of S,
{ obj := λ S, by haveI := fintype.of_finite S; exact Fintype.of S,
Copy link
Member

Choose a reason for hiding this comment

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

What's the effect of this change?

Copy link
Member Author

Choose a reason for hiding this comment

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

I changed an instance from noncomputable .. fintype to finite elsewhere, so I have to use fintype.of_finite here.

@github-actions
Copy link

github-actions bot commented Feb 8, 2023

🚀 Pull request has been placed on the maintainer queue by eric-wieser.

1 similar comment
@github-actions
Copy link

github-actions bot commented Feb 8, 2023

🚀 Pull request has been placed on the maintainer queue by eric-wieser.

@ocfnash
Copy link
Collaborator

ocfnash commented Feb 8, 2023

Thanks!

bors merge

@github-actions github-actions bot added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels Feb 8, 2023
@@ -26,22 +26,31 @@ quotients as setoids whose equivalence classes are clopen.
endowed with a `fintype` instance.
Copy link
Member

Choose a reason for hiding this comment

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

Should this say finite?

Suggested change
endowed with a `fintype` instance.
endowed with a `finite` instance.

bors bot pushed a commit that referenced this pull request Feb 8, 2023
Backport various changes I made to the API while porting to Lean 4 in leanprover-community/mathlib4#2157.

* extend `setoid X`;
* require only that the fibers are open in the definition, prove that they are clopen;
* golf proofs, reuse lattice structure on `setoid`s;
* use bundled continuous maps for `comap`;
* swap LHS and RHS in some `simp` lemmas;
* generalize the `order_bot` instance from a discrete space to a locally connected space;
* prove that a discrete topological space is locally connected.
@bors
Copy link

bors bot commented Feb 8, 2023

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title refactor(topology/discrete_quotient): review API [Merged by Bors] - refactor(topology/discrete_quotient): review API Feb 8, 2023
@bors bors bot closed this Feb 8, 2023
@bors bors bot deleted the YK-discr-quot branch February 8, 2023 20:27
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+`.) t-topology Topological spaces, uniform spaces, metric spaces, filters
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants