Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

feat(ring_theory/congruence): add the complete_lattice instance #18588

Closed
wants to merge 1 commit into from

Conversation

eric-wieser
Copy link
Member

This should be easy to forward-port since all the results are just at the end of the file.

The code is copied from group_theory/congruence.lean, and then modified to fix the errors.

I haven't copied the full contents of group_theory/congruence, only the results about the lattice structure.


Open in Gitpod

@eric-wieser eric-wieser added awaiting-review The author would like community review of the PR t-algebra Algebra (groups, rings, fields etc) modifies-synchronized-file This PR touches a files that has already been ported to mathlib4, and may need a synchronization PR. labels Mar 15, 2023
src/ring_theory/congruence.lean Show resolved Hide resolved
lt := λ c d, c ≤ d ∧ ¬d ≤ c,
le_refl := λ c _ _, id,
le_trans := λ c1 c2 c3 h1 h2 x y h, h2 $ h1 h,
lt_iff_le_not_le := λ _ _, iff.rfl,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
lt_iff_le_not_le := λ _ _, iff.rfl,

src/ring_theory/congruence.lean Show resolved Hide resolved
src/ring_theory/congruence.lean Show resolved Hide resolved
Comment on lines +326 to +343
instance : complete_lattice (ring_con R) :=
{ inf := λ c d,
{ to_setoid := (c.to_setoid ⊓ d.to_setoid),
mul' := λ _ _ _ _ h1 h2, ⟨c.mul h1.1 h2.1, d.mul h1.2 h2.2⟩,
add' := λ _ _ _ _ h1 h2, ⟨c.add h1.1 h2.1, d.add h1.2 h2.2⟩ },
inf_le_left := λ _ _ _ _ h, h.1,
inf_le_right := λ _ _ _ _ h, h.2,
le_inf := λ _ _ _ hb hc _ _ h, ⟨hb h, hc h⟩,
top := { mul' := λ _ _ _ _ _ _, trivial,
add' := λ _ _ _ _ _ _, trivial,
..(⊤ : setoid R) },
le_top := λ _ _ _ h, trivial,
bot := { mul' := λ _ _ _ _, congr_arg2 _,
add' := λ _ _ _ _, congr_arg2 _,
..(⊥ : setoid R) },
bot_le := λ c x y h, h ▸ c.refl x,
.. complete_lattice_of_Inf (ring_con R) $ assume s,
⟨λ r hr x y h, (h : ∀ r ∈ s, (r : ring_con R) x y) r hr, λ r hr x y h r' hr', hr hr' h⟩ }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you first get distrib_lattice (ring_con R) by pulling back from ,R → R → Prop? See simple_graph.distrib_lattice for what I mean precisely.

Copy link
Member Author

Choose a reason for hiding this comment

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

No, because it's not true; the sup of two congruence relations is not obviously the sup of their relations.

Copy link
Collaborator

Choose a reason for hiding this comment

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

You can at least pull back semilattice_inf (ring_con R), then.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a good idea, I'll do it in a follow-up PR


/-- The complete lattice of congruence relations on a given type with multiplication and
addition. -/
instance : complete_lattice (ring_con R) :=
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is that true? My bet is "probably".

Suggested change
instance : complete_lattice (ring_con R) :=
instance : complete_distrib_lattice (ring_con R) :=

Copy link
Member Author

Choose a reason for hiding this comment

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

Is it true on setoid? Either way, this instance is just copied from the instance for con M and add_con M; there no novel generalization going on in this PR, it's just mechanistic copying.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you mind changing group_theory.congruence then? This PR needs forward-porting anyway.

@YaelDillies YaelDillies added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels Mar 28, 2023
@kim-em kim-em added the too-late This PR was ready too late for inclusion in mathlib3 label Jul 16, 2023
eric-wieser added a commit to leanprover-community/mathlib4 that referenced this pull request Nov 10, 2023
@YaelDillies YaelDillies deleted the eric-wieser/ring_con-lattice branch November 10, 2023 13:14
mathlib-bors bot pushed a commit to leanprover-community/mathlib4 that referenced this pull request Dec 12, 2023
The code is copied from `GroupTheory/Congruence.lean`, and then modified to fix the errors.

I haven't copied the full contents of `GroupTheory/Congruencee`, only the results about the lattice structure.

This replaces leanprover-community/mathlib3#18588
mathlib-bors bot pushed a commit to leanprover-community/mathlib4 that referenced this pull request Dec 16, 2023
The code is copied from `GroupTheory/Congruence.lean`, and then modified to fix the errors.

I haven't copied the full contents of `GroupTheory/Congruencee`, only the results about the lattice structure.

This replaces leanprover-community/mathlib3#18588
awueth pushed a commit to leanprover-community/mathlib4 that referenced this pull request Dec 19, 2023
The code is copied from `GroupTheory/Congruence.lean`, and then modified to fix the errors.

I haven't copied the full contents of `GroupTheory/Congruencee`, only the results about the lattice structure.

This replaces leanprover-community/mathlib3#18588
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
awaiting-author A reviewer has asked the author a question or requested changes modifies-synchronized-file This PR touches a files that has already been ported to mathlib4, and may need a synchronization PR. t-algebra Algebra (groups, rings, fields etc) too-late This PR was ready too late for inclusion in mathlib3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants