@@ -49,10 +49,10 @@ section
4949
5050variable [Preorder α] [Preorder β] {l : α → β} {u : β → α}
5151
52- @[to_dual self (reorder := α β, 3 4 , l u, hu hl, hul hlu )]
53- theorem monotone_intro (hu : Monotone u) (hl : Monotone l) (hul : ∀ a, a ≤ u (l a))
54- (hlu : ∀ a, l (u a) ≤ a) : GaloisConnection l u := fun _ _ =>
55- ⟨fun h => (hul _).trans (hu h), fun h => (hl h).trans (hlu _)⟩
52+ @[to_dual self (reorder := α β, 3 4 , l u, hu hl, h_u_l h_l_u )]
53+ theorem monotone_intro (hu : Monotone u) (hl : Monotone l) (h_u_l : ∀ a, a ≤ u (l a))
54+ (h_l_u : ∀ a, l (u a) ≤ a) : GaloisConnection l u := fun _ _ =>
55+ ⟨fun h => (h_u_l _).trans (hu h), fun h => (hl h).trans (h_l_u _)⟩
5656
5757@[to_dual self]
5858protected theorem dual {l : α → β} {u : β → α} (gc : GaloisConnection l u) :
@@ -63,7 +63,7 @@ protected theorem dual {l : α → β} {u : β → α} (gc : GaloisConnection l
6363variable (gc : GaloisConnection l u)
6464include gc
6565
66- @[to_dual le_iff_le' ]
66+ @[to_dual none ]
6767theorem le_iff_le {a : α} {b : β} : l a ≤ b ↔ a ≤ u b :=
6868 gc _ _
6969
@@ -146,7 +146,7 @@ section LinearOrder
146146
147147variable [LinearOrder α] [LinearOrder β] {l : α → β} {u : β → α}
148148
149- @[to_dual lt_iff_lt' ]
149+ @[to_dual none ]
150150theorem lt_iff_lt (gc : GaloisConnection l u) {a : α} {b : β} : b < l a ↔ u b < a :=
151151 lt_iff_lt_of_le_iff_le (gc a b)
152152
@@ -209,16 +209,34 @@ structure GaloisInsertion {α β : Type*} [Preorder α] [Preorder β] (l : α
209209 /-- Property of the choice function. -/
210210 choice_eq : ∀ a h, choice a h = l a
211211
212+ /-- A Galois coinsertion is a Galois connection where `u ∘ l = id`. It also contains a constructive
213+ choice function, to give better definitional equalities when lifting order structures. Dual to
214+ `GaloisInsertion` -/
215+ @[to_dual (reorder := α β, 3 4 , l u)]
216+ structure GaloisCoinsertion [Preorder α] [Preorder β] (l : α → β) (u : β → α) where
217+ /-- A constructive choice function for images of `u`. -/
218+ choice : ∀ x : β, x ≤ l (u x) → α
219+ /-- The Galois connection associated to a Galois coinsertion. -/
220+ gc : GaloisConnection l u
221+ /-- Main property of a Galois coinsertion. -/
222+ u_l_le : ∀ x, u (l x) ≤ x
223+ /-- Property of the choice function. -/
224+ choice_eq : ∀ a h, choice a h = u a
225+
212226/-- A constructor for a Galois insertion with the trivial `choice` function. -/
227+ @[to_dual (reorder := hu hl)
228+ /-- A constructor for a Galois coinsertion with the trivial `choice` function. -/ ]
213229def GaloisInsertion.monotoneIntro {α β : Type *} [Preorder α] [Preorder β] {l : α → β} {u : β → α}
214- (hu : Monotone u) (hl : Monotone l) (hul : ∀ a, a ≤ u (l a)) (hlu : ∀ b, l (u b) = b) :
230+ (hu : Monotone u) (hl : Monotone l) (h_u_l : ∀ a, a ≤ u (l a)) (h_l_u : ∀ b, l (u b) = b) :
215231 GaloisInsertion l u where
216232 choice x _ := l x
217- gc := GaloisConnection.monotone_intro hu hl hul fun b => le_of_eq (hlu b)
218- le_l_u b := le_of_eq <| (hlu b).symm
233+ gc := GaloisConnection.monotone_intro hu hl h_u_l fun b => le_of_eq (h_l_u b)
234+ le_l_u b := le_of_eq <| (h_l_u b).symm
219235 choice_eq _ _ := rfl
220236
221237/-- Make a `GaloisInsertion l u` from a `GaloisConnection l u` such that `∀ b, b ≤ l (u b)` -/
238+ @[to_dual /-- Make a `GaloisCoinsertion` between `αᵒᵈ` and `βᵒᵈ` from a `GaloisInsertion` between
239+ `α` and `β`. -/ ]
222240def GaloisConnection.toGaloisInsertion {α β : Type *} [Preorder α] [Preorder β] {l : α → β}
223241 {u : β → α} (gc : GaloisConnection l u) (h : ∀ b, b ≤ l (u b)) : GaloisInsertion l u :=
224242 { choice := fun x _ => l x
@@ -227,7 +245,7 @@ def GaloisConnection.toGaloisInsertion {α β : Type*} [Preorder α] [Preorder
227245 choice_eq := fun _ _ => rfl }
228246
229247/-- Lift the bottom along a Galois connection -/
230- @[implicit_reducible]
248+ @[to_dual (attr := implicit_reducible) /-- Lift the top along a Galois connection -/ ]
231249def GaloisConnection.liftOrderBot {α β : Type *} [Preorder α] [OrderBot α] [PartialOrder β]
232250 {l : α → β} {u : β → α} (gc : GaloisConnection l u) :
233251 OrderBot β where
@@ -238,116 +256,53 @@ namespace GaloisInsertion
238256
239257variable {l : α → β} {u : β → α}
240258
259+ @[to_dual]
241260theorem l_u_eq [Preorder α] [PartialOrder β] (gi : GaloisInsertion l u) (b : β) : l (u b) = b :=
242261 (gi.gc.l_u_le _).antisymm (gi.le_l_u _)
243262
263+ @[to_dual]
244264theorem leftInverse_l_u [Preorder α] [PartialOrder β] (gi : GaloisInsertion l u) :
245265 LeftInverse l u :=
246266 gi.l_u_eq
247267
268+ @[deprecated (since := " 2026-03-06" )]
269+ alias _root_.GaloisCoinsertion.u_l_leftInverse := GaloisCoinsertion.leftInverse_u_l
270+
271+ @[to_dual]
248272theorem l_top [Preorder α] [PartialOrder β] [OrderTop α] [OrderTop β]
249273 (gi : GaloisInsertion l u) : l ⊤ = ⊤ :=
250274 top_unique <| (gi.le_l_u _).trans <| gi.gc.monotone_l le_top
251275
276+ @[to_dual]
252277theorem l_surjective [Preorder α] [PartialOrder β] (gi : GaloisInsertion l u) : Surjective l :=
253278 gi.leftInverse_l_u.surjective
254279
280+ @[to_dual]
255281theorem u_injective [Preorder α] [PartialOrder β] (gi : GaloisInsertion l u) : Injective u :=
256282 gi.leftInverse_l_u.injective
257283
284+ @[to_dual]
258285theorem u_le_u_iff [Preorder α] [Preorder β] (gi : GaloisInsertion l u) {a b} : u a ≤ u b ↔ a ≤ b :=
259286 ⟨fun h => (gi.le_l_u _).trans (gi.gc.l_le h), fun h => gi.gc.monotone_u h⟩
260287
288+ @[to_dual]
261289theorem strictMono_u [Preorder α] [Preorder β] (gi : GaloisInsertion l u) : StrictMono u :=
262290 strictMono_of_le_iff_le fun _ _ => gi.u_le_u_iff.symm
263291
264292end GaloisInsertion
265293
266- /-- A Galois coinsertion is a Galois connection where `u ∘ l = id`. It also contains a constructive
267- choice function, to give better definitional equalities when lifting order structures. Dual to
268- `GaloisInsertion` -/
269- structure GaloisCoinsertion [Preorder α] [Preorder β] (l : α → β) (u : β → α) where
270- /-- A constructive choice function for images of `u`. -/
271- choice : ∀ x : β, x ≤ l (u x) → α
272- /-- The Galois connection associated to a Galois coinsertion. -/
273- gc : GaloisConnection l u
274- /-- Main property of a Galois coinsertion. -/
275- u_l_le : ∀ x, u (l x) ≤ x
276- /-- Property of the choice function. -/
277- choice_eq : ∀ a h, choice a h = u a
278-
279294/-- Make a `GaloisInsertion` between `αᵒᵈ` and `βᵒᵈ` from a `GaloisCoinsertion` between `α` and
280295`β`. -/
296+ @[to_dual /-- Make a `GaloisCoinsertion` between `αᵒᵈ` and `βᵒᵈ` from a `GaloisInsertion` between
297+ `α` and `β`. -/ ]
281298def GaloisCoinsertion.dual [Preorder α] [Preorder β] {l : α → β} {u : β → α} :
282299 GaloisCoinsertion l u → GaloisInsertion (toDual ∘ u ∘ ofDual) (toDual ∘ l ∘ ofDual) :=
283300 fun x => ⟨x.1 , x.2 .dual, x.3 , x.4 ⟩
284301
285- /-- Make a `GaloisCoinsertion` between `αᵒᵈ` and `βᵒᵈ` from a `GaloisInsertion` between `α` and
286- `β`. -/
287- def GaloisInsertion.dual [Preorder α] [Preorder β] {l : α → β} {u : β → α} :
288- GaloisInsertion l u → GaloisCoinsertion (toDual ∘ u ∘ ofDual) (toDual ∘ l ∘ ofDual) :=
289- fun x => ⟨x.1 , x.2 .dual, x.3 , x.4 ⟩
290-
291302/-- Make a `GaloisInsertion` between `α` and `β` from a `GaloisCoinsertion` between `αᵒᵈ` and
292303`βᵒᵈ`. -/
304+ @[to_dual /-- Make a `GaloisCoinsertion` between `α` and `β` from a `GaloisInsertion` between `αᵒᵈ`
305+ and `βᵒᵈ`. -/ ]
293306def GaloisCoinsertion.ofDual [Preorder α] [Preorder β] {l : αᵒᵈ → βᵒᵈ} {u : βᵒᵈ → αᵒᵈ} :
294307 GaloisCoinsertion l u → GaloisInsertion (ofDual ∘ u ∘ toDual) (ofDual ∘ l ∘ toDual) :=
295308 fun x => ⟨x.1 , x.2 .dual, x.3 , x.4 ⟩
296-
297- /-- Make a `GaloisCoinsertion` between `α` and `β` from a `GaloisInsertion` between `αᵒᵈ` and
298- `βᵒᵈ`. -/
299- def GaloisInsertion.ofDual [Preorder α] [Preorder β] {l : αᵒᵈ → βᵒᵈ} {u : βᵒᵈ → αᵒᵈ} :
300- GaloisInsertion l u → GaloisCoinsertion (ofDual ∘ u ∘ toDual) (ofDual ∘ l ∘ toDual) :=
301- fun x => ⟨x.1 , x.2 .dual, x.3 , x.4 ⟩
302-
303- /-- A constructor for a Galois coinsertion with the trivial `choice` function. -/
304- def GaloisCoinsertion.monotoneIntro [Preorder α] [Preorder β] {l : α → β} {u : β → α}
305- (hu : Monotone u) (hl : Monotone l) (hlu : ∀ b, l (u b) ≤ b) (hul : ∀ a, u (l a) = a) :
306- GaloisCoinsertion l u :=
307- (GaloisInsertion.monotoneIntro hl.dual hu.dual hlu hul).ofDual
308-
309- /-- Make a `GaloisCoinsertion l u` from a `GaloisConnection l u` such that `∀ a, u (l a) ≤ a` -/
310- def GaloisConnection.toGaloisCoinsertion {α β : Type *} [Preorder α] [Preorder β] {l : α → β}
311- {u : β → α} (gc : GaloisConnection l u) (h : ∀ a, u (l a) ≤ a) : GaloisCoinsertion l u :=
312- { choice := fun x _ => u x
313- gc
314- u_l_le := h
315- choice_eq := fun _ _ => rfl }
316-
317- /-- Lift the top along a Galois connection -/
318- @[implicit_reducible]
319- def GaloisConnection.liftOrderTop {α β : Type *} [PartialOrder α] [Preorder β] [OrderTop β]
320- {l : α → β} {u : β → α} (gc : GaloisConnection l u) :
321- OrderTop α where
322- top := u ⊤
323- le_top _ := gc.le_u <| le_top
324-
325- namespace GaloisCoinsertion
326-
327- variable {l : α → β} {u : β → α}
328-
329- theorem u_l_eq [PartialOrder α] [Preorder β] (gi : GaloisCoinsertion l u) (a : α) : u (l a) = a :=
330- gi.dual.l_u_eq a
331-
332- theorem u_l_leftInverse [PartialOrder α] [Preorder β] (gi : GaloisCoinsertion l u) :
333- LeftInverse u l :=
334- gi.u_l_eq
335-
336- theorem u_bot [PartialOrder α] [Preorder β] [OrderBot α] [OrderBot β] (gi : GaloisCoinsertion l u) :
337- u ⊥ = ⊥ :=
338- gi.dual.l_top
339-
340- theorem u_surjective [PartialOrder α] [Preorder β] (gi : GaloisCoinsertion l u) : Surjective u :=
341- gi.dual.l_surjective
342-
343- theorem l_injective [PartialOrder α] [Preorder β] (gi : GaloisCoinsertion l u) : Injective l :=
344- gi.dual.u_injective
345-
346- theorem l_le_l_iff [Preorder α] [Preorder β] (gi : GaloisCoinsertion l u) {a b} :
347- l a ≤ l b ↔ a ≤ b :=
348- gi.dual.u_le_u_iff
349-
350- theorem strictMono_l [Preorder α] [Preorder β] (gi : GaloisCoinsertion l u) : StrictMono l :=
351- fun _ _ h => gi.dual.strictMono_u h
352-
353- end GaloisCoinsertion
0 commit comments