Skip to content

Commit a0d377a

Browse files
committed
chore(Order/FixedPoints): use where notation (leanprover-community#33952)
This also avoids constructing auxiliary `CompleteSemilatticeInf` and `CompleteSemilatticeSup` instances. These are meant exclusively to build a `CompleteLattice` from one without the other; this isn't what's happening here. See [Zulip](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Ditch.20CompleteSemilatticeSup/near/567390440).
1 parent 6546a40 commit a0d377a

1 file changed

Lines changed: 27 additions & 36 deletions

File tree

Mathlib/Order/FixedPoints.lean

Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -232,47 +232,38 @@ open OrderHom
232232

233233
variable [CompleteLattice α] (f : α →o α)
234234

235-
instance : SemilatticeSup (fixedPoints f) :=
236-
{ Subtype.partialOrder _ with
237-
sup := fun x y => f.nextFixed (x ⊔ y) (f.le_map_sup_fixedPoints x y)
238-
le_sup_left := fun _ _ => Subtype.coe_le_coe.1 <| le_sup_left.trans (f.le_nextFixed _)
239-
le_sup_right := fun _ _ => Subtype.coe_le_coe.1 <| le_sup_right.trans (f.le_nextFixed _)
240-
sup_le := fun _ _ _ hxz hyz => f.nextFixed_le _ <| sup_le hxz hyz }
241-
242-
instance : SemilatticeInf (fixedPoints f) :=
243-
{ OrderDual.instSemilatticeInf (fixedPoints f.dual) with
244-
inf := fun x y => f.prevFixed (x ⊓ y) (f.map_inf_fixedPoints_le x y) }
245-
246-
instance : CompleteSemilatticeSup (fixedPoints f) :=
247-
{ Subtype.partialOrder _ with
248-
sSup := fun s =>
249-
f.nextFixed (sSup (Subtype.val '' s))
250-
(f.le_map_sSup_subset_fixedPoints (Subtype.val '' s)
251-
fun _ ⟨x, hx⟩ => hx.2 ▸ x.2)
252-
le_sSup := fun _ _ hx =>
253-
Subtype.coe_le_coe.1 <| le_trans (le_sSup <| Set.mem_image_of_mem _ hx) (f.le_nextFixed _)
254-
sSup_le := fun _ _ hx => f.nextFixed_le _ <| sSup_le <| Set.forall_mem_image.2 hx }
255-
256-
instance : CompleteSemilatticeInf (fixedPoints f) :=
257-
{ Subtype.partialOrder _ with
258-
sInf := fun s =>
259-
f.prevFixed (sInf (Subtype.val '' s))
260-
(f.map_sInf_subset_fixedPoints_le (Subtype.val '' s) fun _ ⟨x, hx⟩ => hx.2 ▸ x.2)
261-
le_sInf := fun _ _ hx => f.le_prevFixed _ <| le_sInf <| Set.forall_mem_image.2 hx
262-
sInf_le := fun _ _ hx =>
263-
Subtype.coe_le_coe.1 <| le_trans (f.prevFixed_le _) (sInf_le <| Set.mem_image_of_mem _ hx) }
264-
265-
/-- **Knaster-Tarski Theorem**: The fixed points of `f` form a complete lattice. -/
266-
instance completeLattice : CompleteLattice (fixedPoints f) where
267-
__ := inferInstanceAs (SemilatticeInf (fixedPoints f))
268-
__ := inferInstanceAs (SemilatticeSup (fixedPoints f))
269-
__ := inferInstanceAs (CompleteSemilatticeInf (fixedPoints f))
270-
__ := inferInstanceAs (CompleteSemilatticeSup (fixedPoints f))
235+
instance : BoundedOrder (fixedPoints f) where
271236
top := ⟨f.gfp, f.isFixedPt_gfp⟩
272237
bot := ⟨f.lfp, f.isFixedPt_lfp⟩
273238
le_top x := f.le_gfp x.2.ge
274239
bot_le x := f.lfp_le x.2.le
275240

241+
instance : SemilatticeSup (fixedPoints f) where
242+
sup x y := f.nextFixed (x ⊔ y) (f.le_map_sup_fixedPoints x y)
243+
le_sup_left _ _ := Subtype.coe_le_coe.1 <| le_sup_left.trans (f.le_nextFixed _)
244+
le_sup_right _ _ := Subtype.coe_le_coe.1 <| le_sup_right.trans (f.le_nextFixed _)
245+
sup_le _ _ _ hxz hyz := f.nextFixed_le _ <| sup_le hxz hyz
246+
247+
instance : SemilatticeInf (fixedPoints f) where
248+
inf x y := f.prevFixed (x ⊓ y) (f.map_inf_fixedPoints_le x y)
249+
__ := OrderDual.instSemilatticeInf (fixedPoints f.dual)
250+
251+
/-- **Knaster-Tarski Theorem**: The fixed points of `f` form a complete lattice. -/
252+
instance completeLattice : CompleteLattice (fixedPoints f) where
253+
sSup s :=
254+
f.nextFixed (sSup (Subtype.val '' s))
255+
(f.le_map_sSup_subset_fixedPoints (Subtype.val '' s)
256+
fun _ ⟨x, hx⟩ => hx.2 ▸ x.2)
257+
le_sSup _ _ hx :=
258+
Subtype.coe_le_coe.1 <| le_trans (le_sSup <| Set.mem_image_of_mem _ hx) (f.le_nextFixed _)
259+
sSup_le _ _ hx := f.nextFixed_le _ <| sSup_le <| Set.forall_mem_image.2 hx
260+
sInf s :=
261+
f.prevFixed (sInf (Subtype.val '' s))
262+
(f.map_sInf_subset_fixedPoints_le (Subtype.val '' s) fun _ ⟨x, hx⟩ => hx.2 ▸ x.2)
263+
le_sInf _ _ hx := f.le_prevFixed _ <| le_sInf <| Set.forall_mem_image.2 hx
264+
sInf_le _ _ hx :=
265+
Subtype.coe_le_coe.1 <| le_trans (f.prevFixed_le _) (sInf_le <| Set.mem_image_of_mem _ hx)
266+
276267
open OmegaCompletePartialOrder fixedPoints
277268

278269
/-- **Kleene's fixed point Theorem**: The least fixed point in a complete lattice is

0 commit comments

Comments
 (0)