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

Commit e836a72

Browse files
committed
feat(order/galois_connection): add exists_eq_{l,u}, tidy up lemmas (#9904)
This makes some arguments implicit to `compose` as these are inferrable from the other arguments, and changes `u_l_u_eq_u` and `l_u_l_eq_l` to be applied rather than unapplied, which shortens both the proof and the places where the lemma is used.
1 parent 49c6841 commit e836a72

File tree

6 files changed

+29
-17
lines changed

6 files changed

+29
-17
lines changed

src/algebraic_geometry/prime_spectrum.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ lemma gc_set : @galois_connection
167167
(set R) (order_dual (set (prime_spectrum R))) _ _
168168
(λ s, zero_locus s) (λ t, vanishing_ideal t) :=
169169
have ideal_gc : galois_connection (ideal.span) coe := (submodule.gi R R).gc,
170-
by simpa [zero_locus_span, function.comp] using galois_connection.compose _ _ _ _ ideal_gc (gc R)
170+
by simpa [zero_locus_span, function.comp] using ideal_gc.compose (gc R)
171171

172172
lemma subset_zero_locus_iff_subset_vanishing_ideal (t : set (prime_spectrum R)) (s : set R) :
173173
t ⊆ zero_locus s ↔ s ⊆ vanishing_ideal t :=
@@ -191,7 +191,7 @@ begin
191191
end
192192

193193
@[simp] lemma zero_locus_radical (I : ideal R) : zero_locus (I.radical : set R) = zero_locus I :=
194-
vanishing_ideal_zero_locus_eq_radical I ▸ congr_fun (gc R).l_u_l_eq_l I
194+
vanishing_ideal_zero_locus_eq_radical I ▸ (gc R).l_u_l_eq_l I
195195

196196
lemma subset_zero_locus_vanishing_ideal (t : set (prime_spectrum R)) :
197197
t ⊆ zero_locus (vanishing_ideal t) :=
@@ -375,7 +375,7 @@ end
375375

376376
lemma vanishing_ideal_closure (t : set (prime_spectrum R)) :
377377
vanishing_ideal (closure t) = vanishing_ideal t :=
378-
zero_locus_vanishing_ideal_eq_closure t ▸ congr_fun (gc R).u_l_u_eq_u t
378+
zero_locus_vanishing_ideal_eq_closure t ▸ (gc R).u_l_u_eq_u t
379379

380380
section comap
381381
variables {S : Type v} [comm_ring S] {S' : Type*} [comm_ring S']

src/group_theory/submonoid/operations.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,11 @@ lemma monotone_comap {f : M →* N} : monotone (comap f) :=
248248

249249
@[simp, to_additive]
250250
lemma map_comap_map {f : M →* N} : ((S.map f).comap f).map f = S.map f :=
251-
congr_fun ((gc_map_comap f).l_u_l_eq_l) _
251+
(gc_map_comap f).l_u_l_eq_l _
252252

253253
@[simp, to_additive]
254254
lemma comap_map_comap {S : submonoid N} {f : M →* N} : ((S.comap f).map f).comap f = S.comap f :=
255-
congr_fun ((gc_map_comap f).u_l_u_eq_u) _
255+
(gc_map_comap f).u_l_u_eq_u _
256256

257257
@[to_additive]
258258
lemma map_sup (S T : submonoid M) (f : M →* N) : (S ⊔ T).map f = S.map f ⊔ T.map f :=

src/model_theory/basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,12 +637,12 @@ lemma monotone_comap {f : M →[L] N} : monotone (comap f) :=
637637

638638
@[simp]
639639
lemma map_comap_map {f : M →[L] N} : ((S.map f).comap f).map f = S.map f :=
640-
congr_fun ((gc_map_comap f).l_u_l_eq_l) _
640+
(gc_map_comap f).l_u_l_eq_l _
641641

642642
@[simp]
643643
lemma comap_map_comap {S : L.substructure N} {f : M →[L] N} :
644644
((S.comap f).map f).comap f = S.comap f :=
645-
congr_fun ((gc_map_comap f).u_l_u_eq_u) _
645+
(gc_map_comap f).u_l_u_eq_u _
646646

647647
lemma map_sup (S T : L.substructure M) (f : M →[L] N) : (S ⊔ T).map f = S.map f ⊔ T.map f :=
648648
(gc_map_comap f).l_sup

src/order/closure.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def closure_operator :
287287
{ to_fun := λ x, u (l x),
288288
monotone' := l.monotone,
289289
le_closure' := l.le_closure,
290-
idempotent' := λ x, show (u ∘ l ∘ u) (l x) = u (l x), by rw l.gc.u_l_u_eq_u }
290+
idempotent' := λ x, l.gc.u_l_u_eq_u (l x) }
291291

292292
lemma idempotent (x : α) : u (l (u (l x))) = u (l x) :=
293293
l.closure_operator.idempotent _

src/order/galois_connection.lean

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,28 +121,40 @@ section partial_order
121121
variables [partial_order α] [preorder β] {l : α → β} {u : β → α} (gc : galois_connection l u)
122122
include gc
123123

124-
lemma u_l_u_eq_u : u ∘ l ∘ u = u :=
125-
funext (λ x, (gc.monotone_u (gc.l_u_le _)).antisymm (gc.le_u_l _))
124+
lemma u_l_u_eq_u (b : β) : u (l (u b)) = u b :=
125+
(gc.monotone_u (gc.l_u_le _)).antisymm (gc.le_u_l _)
126+
127+
lemma u_l_u_eq_u' : u ∘ l ∘ u = u := funext gc.u_l_u_eq_u
126128

127129
lemma u_unique {l' : α → β} {u' : β → α} (gc' : galois_connection l' u')
128130
(hl : ∀ a, l a = l' a) {b : β} : u b = u' b :=
129131
le_antisymm (gc'.le_u $ hl (u b) ▸ gc.l_u_le _)
130132
(gc.le_u $ (hl (u' b)).symm ▸ gc'.l_u_le _)
131133

134+
/-- If there exists a `b` such that `a = u a`, then `b = l a` is one such element. -/
135+
lemma exists_eq_u (a : α) : (∃ b : β, a = u b) ↔ a = u (l a) :=
136+
⟨λ ⟨S, hS⟩, hS.symm ▸ (gc.u_l_u_eq_u _).symm, λ HI, ⟨_, HI⟩ ⟩
137+
132138
end partial_order
133139

134140
section partial_order
135141
variables [preorder α] [partial_order β] {l : α → β} {u : β → α} (gc : galois_connection l u)
136142
include gc
137143

138-
lemma l_u_l_eq_l : l ∘ u ∘ l = l :=
139-
funext (λ x, (gc.l_u_le _).antisymm (gc.monotone_l (gc.le_u_l _)))
144+
lemma l_u_l_eq_l (a : α) : l (u (l a)) = l a :=
145+
(gc.l_u_le _).antisymm (gc.monotone_l (gc.le_u_l _))
146+
147+
lemma l_u_l_eq_l' : l ∘ u ∘ l = l := funext gc.l_u_l_eq_l
140148

141149
lemma l_unique {l' : α → β} {u' : β → α} (gc' : galois_connection l' u')
142150
(hu : ∀ b, u b = u' b) {a : α} : l a = l' a :=
143151
le_antisymm (gc.l_le $ (hu (l' a)).symm ▸ gc'.le_u_l _)
144152
(gc'.l_le $ hu (l a) ▸ gc.le_u_l _)
145153

154+
/-- If there exists an `a` such that `b = l a`, then `a = u b` is one such element. -/
155+
lemma exists_eq_l (b : β) : (∃ a : α, b = l a) ↔ b = l (u b) :=
156+
⟨λ ⟨S, hS⟩, hS.symm ▸ (gc.l_u_l_eq_l _).symm, λ HI, ⟨_, HI⟩ ⟩
157+
146158
end partial_order
147159

148160
section order_top
@@ -205,15 +217,15 @@ protected lemma id [pα : preorder α] : @galois_connection α α pα pα id id
205217
λ a b, iff.intro (λ x, x) (λ x, x)
206218

207219
protected lemma compose [preorder α] [preorder β] [preorder γ]
208-
(l1 : α → β) (u1 : β → α) (l2 : β → γ) (u2 : γ → β)
220+
{l1 : α → β} {u1 : β → α} {l2 : β → γ} {u2 : γ → β}
209221
(gc1 : galois_connection l1 u1) (gc2 : galois_connection l2 u2) :
210222
galois_connection (l2 ∘ l1) (u1 ∘ u2) :=
211223
by intros a b; rw [gc2, gc1]
212224

213225
protected lemma dfun {ι : Type u} {α : ι → Type v} {β : ι → Type w}
214226
[∀ i, preorder (α i)] [∀ i, preorder (β i)]
215227
(l : Πi, α i → β i) (u : Πi, β i → α i) (gc : ∀ i, galois_connection (l i) (u i)) :
216-
@galois_connection (Π i, α i) (Π i, β i) _ _ (λ a i, l i (a i)) (λ b i, u i (b i)) :=
228+
galois_connection (λ (a : Π i, α i) i, l i (a i)) (λ b i, u i (b i)) :=
217229
λ a b, forall_congr $ λ i, gc i (a i) (b i)
218230

219231
end constructions

src/ring_theory/ideal/operations.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ lemma comap_comap {T : Type*} [ring T] {I : ideal T} (f : R →+* S)
792792

793793
lemma map_map {T : Type*} [ring T] {I : ideal R} (f : R →+* S)
794794
(g : S →+*T) : (I.map f).map g = I.map (g.comp f) :=
795-
((gc_map_comap f).compose _ _ _ _ (gc_map_comap g)).l_unique
795+
((gc_map_comap f).compose (gc_map_comap g)).l_unique
796796
(gc_map_comap (g.comp f)) (λ _, comap_comap _ _)
797797

798798
lemma map_span (f : R →+* S) (s : set R) :
@@ -828,10 +828,10 @@ lemma map_comap_le : (K.comap f).map f ≤ K :=
828828
variables (f I J K L)
829829

830830
@[simp] lemma map_comap_map : ((I.map f).comap f).map f = I.map f :=
831-
congr_fun (gc_map_comap f).l_u_l_eq_l I
831+
(gc_map_comap f).l_u_l_eq_l I
832832

833833
@[simp] lemma comap_map_comap : ((K.comap f).map f).comap f = K.comap f :=
834-
congr_fun (gc_map_comap f).u_l_u_eq_u K
834+
(gc_map_comap f).u_l_u_eq_u K
835835

836836
lemma map_sup : (I ⊔ J).map f = I.map f ⊔ J.map f :=
837837
(gc_map_comap f).l_sup

0 commit comments

Comments
 (0)