Built with doc-gen4, running Lean4. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑Ctrl+↓to navigate, Ctrl+🖱️to focus. On Mac, use Cmdinstead of Ctrl.
/-
Copyright (c) 2021 Peter Nelson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Peter Nelson, Yaël Dillies

! This file was ported from Lean 3 source module data.fintype.order
! leanprover-community/mathlib commit 1126441d6bccf98c81214a0780c73d499f6721fe
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathlib.Data.Fintype.Lattice
import Mathlib.Data.Finset.Order

/-!
# Order structures on finite types

This file provides order instances on fintypes.

## Computable instances

On a `Fintype`, we can construct
* an `OrderBot` from `SemilatticeInf`.
* an `OrderTop` from `SemilatticeSup`.
* a `BoundedOrder` from `Lattice`.

Those are marked as `def` to avoid defeqness issues.

## Completion instances

Those instances are noncomputable because the definitions of `sSup` and `sInf` use `Set.toFinset`
and set membership is undecidable in general.

On a `Fintype`, we can promote:
* a `Lattice` to a `CompleteLattice`.
* a `DistribLattice` to a `CompleteDistribLattice`.
* a `LinearOrder`  to a `CompleteLinearOrder`.
* a `BooleanAlgebra` to a `CompleteBooleanAlgebra`.

Those are marked as `def` to avoid typeclass loops.

## Concrete instances

We provide a few instances for concrete types:
* `Fin.completeLinearOrder`
* `Bool.completeLinearOrder`
* `Bool.completeBooleanAlgebra`
-/


open Finset

namespace Fintype

variable {
ι: Type ?u.14
ι
α: Type ?u.2924
α
:
Type _: Type (?u.87189+1)
Type _
} [
Fintype: Type ?u.8 → Type ?u.8
Fintype
ι: Type ?u.14
ι
] [
Fintype: Type ?u.2127 → Type ?u.2127
Fintype
α: Type ?u.2924
α
] section Nonempty variable (
α: ?m.26
α
) [
Nonempty: Sort ?u.1001 → Prop
Nonempty
α: ?m.26
α
] -- See note [reducible non-instances] /-- Constructs the `⊥` of a finite nonempty `SemilatticeInf`. -/ @[reducible] def
toOrderBot: (α : Type u_1) → [inst : Fintype α] → [inst : Nonempty α] → [inst : SemilatticeInf α] → OrderBot α
toOrderBot
[
SemilatticeInf: Type ?u.47 → Type ?u.47
SemilatticeInf
α: Type ?u.35
α
] :
OrderBot: (α : Type ?u.50) → [inst : LE α] → Type ?u.50
OrderBot
α: Type ?u.35
α
where bot :=
univ: {α : Type ?u.615} → [inst : Fintype α] → Finset α
univ
.
inf': {α : Type ?u.643} → {β : Type ?u.642} → [inst : SemilatticeInf α] → (s : Finset β) → Finset.Nonempty s(βα) → α
inf'
univ_nonempty: ∀ {α : Type ?u.672} [inst : Fintype α] [inst_1 : Nonempty α], Finset.Nonempty univ
univ_nonempty
id: {α : Sort ?u.811} → αα
id
bot_le
a: ?m.819
a
:=
inf'_le: ∀ {α : Type ?u.822} {β : Type ?u.821} [inst : SemilatticeInf α] {s : Finset β} (f : βα) {b : β} (h : b s), inf' s (_ : x, x s) f f b
inf'_le
_: ?m.824?m.823
_
<|
mem_univ: ∀ {α : Type ?u.829} [inst : Fintype α] (x : α), x univ
mem_univ
a: ?m.819
a
#align fintype.to_order_bot
Fintype.toOrderBot: (α : Type u_1) → [inst : Fintype α] → [inst : Nonempty α] → [inst : SemilatticeInf α] → OrderBot α
Fintype.toOrderBot
-- See note [reducible non-instances] /-- Constructs the `⊤` of a finite nonempty `SemilatticeSup` -/ @[reducible] def
toOrderTop: [inst : SemilatticeSup α] → OrderTop α
toOrderTop
[
SemilatticeSup: Type ?u.1004 → Type ?u.1004
SemilatticeSup
α: Type ?u.992
α
] :
OrderTop: (α : Type ?u.1007) → [inst : LE α] → Type ?u.1007
OrderTop
α: Type ?u.992
α
where top :=
univ: {α : Type ?u.1782} → [inst : Fintype α] → Finset α
univ
.
sup': {α : Type ?u.1810} → {β : Type ?u.1809} → [inst : SemilatticeSup α] → (s : Finset β) → Finset.Nonempty s(βα) → α
sup'
univ_nonempty: ∀ {α : Type ?u.1841} [inst : Fintype α] [inst_1 : Nonempty α], Finset.Nonempty univ
univ_nonempty
id: {α : Sort ?u.1980} → αα
id
-- Porting note: needed to make `id` explicit le_top
a: ?m.1990
a
:=
le_sup': ∀ {α : Type ?u.1993} {β : Type ?u.1992} [inst : SemilatticeSup α] {s : Finset β} (f : βα) {b : β} (h : b s), f b sup' s (_ : x, x s) f
le_sup'
id: {α : Sort ?u.1998} → αα
id
<|
mem_univ: ∀ {α : Type ?u.2004} [inst : Fintype α] (x : α), x univ
mem_univ
a: ?m.1990
a
#align fintype.to_order_top
Fintype.toOrderTop: (α : Type u_1) → [inst : Fintype α] → [inst : Nonempty α] → [inst : SemilatticeSup α] → OrderTop α
Fintype.toOrderTop
-- See note [reducible non-instances] /-- Constructs the `⊤` and `⊥` of a finite nonempty `Lattice`. -/ @[reducible] def
toBoundedOrder: [inst : Lattice α] → BoundedOrder α
toBoundedOrder
[
Lattice: Type ?u.2133 → Type ?u.2133
Lattice
α: Type ?u.2121
α
] :
BoundedOrder: (α : Type ?u.2136) → [inst : LE α] → Type ?u.2136
BoundedOrder
α: Type ?u.2121
α
:=
{ toOrderBot α, toOrderTop α with }: BoundedOrder ?m.2537
{
toOrderBot: (α : Type ?u.2466) → [inst : Fintype α] → [inst : Nonempty α] → [inst : SemilatticeInf α] → OrderBot α
toOrderBot
{ toOrderBot α, toOrderTop α with }: BoundedOrder ?m.2537
α: Type ?u.2121
α
{ toOrderBot α, toOrderTop α with }: BoundedOrder ?m.2537
,
toOrderTop: (α : Type ?u.2502) → [inst : Fintype α] → [inst : Nonempty α] → [inst : SemilatticeSup α] → OrderTop α
toOrderTop
{ toOrderBot α, toOrderTop α with }: BoundedOrder ?m.2537
α: Type ?u.2121
α
{ toOrderBot α, toOrderTop α with }: BoundedOrder ?m.2537
{ toOrderBot α, toOrderTop α with }: BoundedOrder ?m.2537
with
{ toOrderBot α, toOrderTop α with }: BoundedOrder ?m.2537
}
#align fintype.to_bounded_order
Fintype.toBoundedOrder: (α : Type u_1) → [inst : Fintype α] → [inst : Nonempty α] → [inst : Lattice α] → BoundedOrder α
Fintype.toBoundedOrder
end Nonempty section BoundedOrder variable (
α: ?m.2918
α
) open Classical -- See note [reducible non-instances] /-- A finite bounded lattice is complete. -/ @[reducible] noncomputable def
toCompleteLattice: (α : Type u_1) → [inst : Fintype α] → [inst : Lattice α] → [inst : BoundedOrder α] → CompleteLattice α
toCompleteLattice
[
Lattice: Type ?u.2933 → Type ?u.2933
Lattice
α: Type ?u.2924
α
] [
BoundedOrder: (α : Type ?u.2936) → [inst : LE α] → Type ?u.2936
BoundedOrder
α: Type ?u.2924
α
] :
CompleteLattice: Type ?u.3264 → Type ?u.3264
CompleteLattice
α: Type ?u.2924
α
:= { ‹Lattice α›, ‹BoundedOrder α› with sSup := fun
s: ?m.3573
s
=>
s: ?m.3573
s
.
toFinset: {α : Type ?u.3575} → (s : Set α) → [inst : Fintype s] → Finset α
toFinset
.
sup: {α : Type ?u.3659} → {β : Type ?u.3658} → [inst : SemilatticeSup α] → [inst : OrderBot α] → Finset β(βα) → α
sup
id: {α : Sort ?u.3726} → αα
id
sInf := fun
s: ?m.4048
s
=>
s: ?m.4048
s
.
toFinset: {α : Type ?u.4050} → (s : Set α) → [inst : Fintype s] → Finset α
toFinset
.
inf: {α : Type ?u.4107} → {β : Type ?u.4106} → [inst : SemilatticeInf α] → [inst : OrderTop α] → Finset β(βα) → α
inf
id: {α : Sort ?u.4165} → αα
id
le_sSup := fun
_: ?m.3769
_
_: ?m.3772
_
ha: ?m.3775
ha
=>
Finset.le_sup: ∀ {α : Type ?u.3778} {β : Type ?u.3777} [inst : SemilatticeSup α] [inst_1 : OrderBot α] {s : Finset β} {f : βα} {b : β}, b sf b sup s f
Finset.le_sup
(f :=
id: {α : Sort ?u.3784} → αα
id
) (
Set.mem_toFinset: ∀ {α : Type ?u.3865} {s : Set α} [inst : Fintype s] {a : α}, a Set.toFinset s a s
Set.mem_toFinset
.
mpr: ∀ {a b : Prop}, (a b) → ba
mpr
ha: ?m.3775
ha
) sSup_le := fun
s: ?m.3911
s
_: ?m.3914
_
ha: ?m.3917
ha
=>
Finset.sup_le: ∀ {α : Type ?u.3923} {β : Type ?u.3924} [inst : SemilatticeSup α] [inst_1 : OrderBot α] {s : Finset β} {f : βα} {a : α}, (∀ (b : β), b sf b a) → sup s f a
Finset.sup_le
fun
b: ?m.3995
b
hb: ?m.3998
hb
=>
ha: ?m.3917
ha
_: α
_
<|
Set.mem_toFinset: ∀ {α : Type ?u.4001} {s : Set α} [inst : Fintype s] {a : α}, a Set.toFinset s a s
Set.mem_toFinset
.
mp: ∀ {a b : Prop}, (a b) → ab
mp
hb: ?m.3998
hb
sInf_le := fun
_: ?m.4197
_
_: ?m.4200
_
ha: ?m.4203
ha
=>
Finset.inf_le: ∀ {α : Type ?u.4206} {β : Type ?u.4205} [inst : SemilatticeInf α] [inst_1 : OrderTop α] {s : Finset β} {f : βα} {b : β}, b sinf s f f b
Finset.inf_le
(
Set.mem_toFinset: ∀ {α : Type ?u.4275} {s : Set α} [inst : Fintype s] {a : α}, a Set.toFinset s a s
Set.mem_toFinset
.
mpr: ∀ {a b : Prop}, (a b) → ba
mpr
ha: ?m.4203
ha
) le_sInf := fun
s: ?m.4307
s
_: ?m.4310
_
ha: ?m.4313
ha
=>
Finset.le_inf: ∀ {α : Type ?u.4319} {β : Type ?u.4320} [inst : SemilatticeInf α] [inst_1 : OrderTop α] {s : Finset β} {f : βα} {a : α}, (∀ (b : β), b sa f b) → a inf s f
Finset.le_inf
fun
b: ?m.4383
b
hb: ?m.4386
hb
=>
ha: ?m.4313
ha
_: α
_
<|
Set.mem_toFinset: ∀ {α : Type ?u.4389} {s : Set α} [inst : Fintype s] {a : α}, a Set.toFinset s a s
Set.mem_toFinset
.
mp: ∀ {a b : Prop}, (a b) → ab
mp
hb: ?m.4386
hb
} #align fintype.to_complete_lattice
Fintype.toCompleteLattice: (α : Type u_1) → [inst : Fintype α] → [inst : Lattice α] → [inst : BoundedOrder α] → CompleteLattice α
Fintype.toCompleteLattice
-- Porting note: `convert` doesn't work as well as it used to. -- See note [reducible non-instances] /-- A finite bounded distributive lattice is completely distributive. -/ @[reducible] noncomputable def
toCompleteDistribLattice: (α : Type u_1) → [inst : Fintype α] → [inst : DistribLattice α] → [inst : BoundedOrder α] → CompleteDistribLattice α
toCompleteDistribLattice
[
DistribLattice: Type ?u.5033 → Type ?u.5033
DistribLattice
α: Type ?u.5024
α
] [
BoundedOrder: (α : Type ?u.5036) → [inst : LE α] → Type ?u.5036
BoundedOrder
α: Type ?u.5024
α
] :
CompleteDistribLattice: Type ?u.5420 → Type ?u.5420
CompleteDistribLattice
α: Type ?u.5024
α
:= {
toCompleteLattice: (α : Type ?u.5426) → [inst : Fintype α] → [inst : Lattice α] → [inst : BoundedOrder α] → CompleteLattice α
toCompleteLattice
α: Type ?u.5024
α
with iInf_sup_le_sup_sInf := fun
a: ?m.5615
a
s: ?m.5618
s
=>

Goals accomplished! 🐙
ι: Type ?u.5021

α: Type ?u.5024

inst✝³: Fintype ι

inst✝²: Fintype α

inst✝¹: DistribLattice α

inst✝: BoundedOrder α

src✝:= toCompleteLattice α: CompleteLattice α

a: α

s: Set α


(b, h, a b) a sInf s
ι: Type ?u.5021

α: Type ?u.5024

inst✝³: Fintype ι

inst✝²: Fintype α

inst✝¹: DistribLattice α

inst✝: BoundedOrder α

src✝:= toCompleteLattice α: CompleteLattice α

a: α

s: Set α


h.e'_3
(b, h, a b) = inf (Set.toFinset s) fun i => a id i
ι: Type ?u.5021

α: Type ?u.5024

inst✝³: Fintype ι

inst✝²: Fintype α

inst✝¹: DistribLattice α

inst✝: BoundedOrder α

src✝:= toCompleteLattice α: CompleteLattice α

a: α

s: Set α


(b, h, a b) a sInf s
ι: Type ?u.5021

α: Type ?u.5024

inst✝³: Fintype ι

inst✝²: Fintype α

inst✝¹: DistribLattice α

inst✝: BoundedOrder α

src✝:= toCompleteLattice α: CompleteLattice α

a: α

s: Set α


h.e'_3
(b, h, a b) = inf (Set.toFinset s) fun i => a id i
ι: Type ?u.5021

α: Type ?u.5024

inst✝³: Fintype ι

inst✝²: Fintype α

inst✝¹: DistribLattice α

inst✝: BoundedOrder α

src✝:= toCompleteLattice α: CompleteLattice α

a: α

s: Set α


h.e'_3
(b, h, a b) = a_1, h, a id a_1
ι: Type ?u.5021

α: Type ?u.5024

inst✝³: Fintype ι

inst✝²: Fintype α

inst✝¹: DistribLattice α

inst✝: BoundedOrder α

src✝:= toCompleteLattice α: CompleteLattice α

a: α

s: Set α


h.e'_3
(b, h, a b) = a_1, h, a id a_1
ι: Type ?u.5021

α: Type ?u.5024

inst✝³: Fintype ι

inst✝²: Fintype α

inst✝¹: DistribLattice α

inst✝: BoundedOrder α

src✝:= toCompleteLattice α: CompleteLattice α

a: α

s: Set α


(b, h, a b) a sInf s
ι: Type ?u.5021

α: Type ?u.5024

inst✝³: Fintype ι

inst✝²: Fintype α

inst✝¹: DistribLattice α

inst✝: BoundedOrder α

src✝:= toCompleteLattice α: CompleteLattice α

a: α

s: Set α


h.e'_3
(b, x, a b) = a_1, h, a id a_1
ι: Type ?u.5021

α: Type ?u.5024

inst✝³: Fintype ι

inst✝²: Fintype α

inst✝¹: DistribLattice α

inst✝: BoundedOrder α

src✝:= toCompleteLattice α: CompleteLattice α

a: α

s: Set α


h.e'_3
(b, x, a b) = a_1, x, a id a_1
ι: Type ?u.5021

α: Type ?u.5024

inst✝³: Fintype ι

inst✝²: Fintype α

inst✝¹: DistribLattice α

inst✝: BoundedOrder α

src✝:= toCompleteLattice α: CompleteLattice α

a: α

s: Set α


h.e'_3
(b, x, a b) = a_1, x, a id a_1
ι: Type ?u.5021

α: Type ?u.5024

inst✝³: Fintype ι

inst✝²: Fintype α

inst✝¹: DistribLattice α

inst✝: BoundedOrder α

src✝:= toCompleteLattice α: CompleteLattice α

a: α

s: Set α


(b, h, a b) a sInf s

Goals accomplished! 🐙
inf_sSup_le_iSup_inf := fun
a: ?m.5603
a
s: ?m.5606
s
=>

Goals accomplished! 🐙
ι: Type ?u.5021

α: Type ?u.5024

inst✝³: Fintype ι

inst✝²: Fintype α

inst✝¹: DistribLattice α

inst✝: BoundedOrder α

src✝:= toCompleteLattice α: CompleteLattice α

a: α

s: Set α


a sSup s b, h, a b
ι: Type ?u.5021

α: Type ?u.5024

inst✝³: Fintype ι

inst✝²: Fintype α

inst✝¹: DistribLattice α

inst✝: BoundedOrder α

src✝:= toCompleteLattice α: CompleteLattice α

a: α

s: Set α


h.e'_4
(b, h, a b) = sup (Set.toFinset s) fun i => a id i
ι: Type ?u.5021

α: Type ?u.5024

inst✝³: Fintype ι

inst✝²: Fintype α

inst✝¹: DistribLattice α

inst✝: BoundedOrder α

src✝:= toCompleteLattice α: CompleteLattice α

a: α

s: Set α


a sSup s b, h, a b
ι: Type ?u.5021

α: Type ?u.5024

inst✝³: Fintype ι

inst✝²: Fintype α

inst✝¹: DistribLattice α

inst✝: BoundedOrder α

src✝:= toCompleteLattice α: CompleteLattice α

a: α

s: Set α


h.e'_4
(b, h, a b) = sup (Set.toFinset s) fun i => a id i
ι: Type ?u.5021

α: Type ?u.5024

inst✝³: Fintype ι

inst✝²: Fintype α

inst✝¹: DistribLattice α

inst✝: BoundedOrder α

src✝:= toCompleteLattice α: CompleteLattice α

a: α

s: Set α


h.e'_4
(b, h, a b) = a_1, h, a id a_1
ι: Type ?u.5021

α: Type ?u.5024

inst✝³: Fintype ι

inst✝²: Fintype α

inst✝¹: DistribLattice α

inst✝: BoundedOrder α

src✝:= toCompleteLattice α: CompleteLattice α

a: α

s: Set α


h.e'_4
(b, h, a b) = a_1, h, a id a_1
ι: Type ?u.5021

α: Type ?u.5024

inst✝³: Fintype ι

inst✝²: Fintype α

inst✝¹: DistribLattice α

inst✝: BoundedOrder α

src✝:= toCompleteLattice α: CompleteLattice α

a: α

s: Set α


a sSup s b, h, a b
ι: Type ?u.5021

α: Type ?u.5024

inst✝³: Fintype ι

inst✝²: Fintype α

inst✝¹: DistribLattice α

inst✝: BoundedOrder α

src✝:= toCompleteLattice α: CompleteLattice α

a: α

s: Set α


h.e'_4
(b, x, a b) = a_1, h, a id a_1
ι: Type ?u.5021

α: Type ?u.5024

inst✝³: Fintype ι

inst✝²: Fintype α

inst✝¹: DistribLattice α

inst✝: BoundedOrder α

src✝:= toCompleteLattice α: CompleteLattice α

a: α

s: Set α


h.e'_4
(b, x, a b) = a_1, x, a id a_1
ι: Type ?u.5021

α: Type ?u.5024

inst✝³: Fintype ι

inst✝²: Fintype α

inst✝¹: DistribLattice α

inst✝: BoundedOrder α

src✝:= toCompleteLattice α: CompleteLattice α

a: α

s: Set α


h.e'_4
(b, x, a b) = a_1, x, a id a_1
ι: Type ?u.5021

α: Type ?u.5024

inst✝³: Fintype ι

inst✝²: Fintype α

inst✝¹: DistribLattice α

inst✝: BoundedOrder α

src✝:= toCompleteLattice α: CompleteLattice α

a: α

s: Set α


a sSup s b, h, a b

Goals accomplished! 🐙
} #align fintype.to_complete_distrib_lattice
Fintype.toCompleteDistribLattice: (α : Type u_1) → [inst : Fintype α] → [inst : DistribLattice α] → [inst : BoundedOrder α] → CompleteDistribLattice α
Fintype.toCompleteDistribLattice
-- See note [reducible non-instances] /-- A finite bounded linear order is complete. -/ @[reducible] noncomputable def
toCompleteLinearOrder: (α : Type u_1) → [inst : Fintype α] → [inst : LinearOrder α] → [inst : BoundedOrder α] → CompleteLinearOrder α
toCompleteLinearOrder
[
LinearOrder: Type ?u.10332 → Type ?u.10332
LinearOrder
α: Type ?u.10323
α
] [
BoundedOrder: (α : Type ?u.10335) → [inst : LE α] → Type ?u.10335
BoundedOrder
α: Type ?u.10323
α
] :
CompleteLinearOrder: Type ?u.10745 → Type ?u.10745
CompleteLinearOrder
α: Type ?u.10323
α
:=
{ toCompleteLattice α, ‹LinearOrder α› with }: CompleteLinearOrder ?m.10863
{
toCompleteLattice: (α : Type ?u.10751) → [inst : Fintype α] → [inst : Lattice α] → [inst : BoundedOrder α] → CompleteLattice α
toCompleteLattice
{ toCompleteLattice α, ‹LinearOrder α› with }: CompleteLinearOrder ?m.10863
α: Type ?u.10323
α
{ toCompleteLattice α, ‹LinearOrder α› with }: CompleteLinearOrder ?m.10863
, ‹LinearOrder α›
{ toCompleteLattice α, ‹LinearOrder α› with }: CompleteLinearOrder ?m.10863
with
{ toCompleteLattice α, ‹LinearOrder α› with }: CompleteLinearOrder ?m.10863
}
#align fintype.to_complete_linear_order
Fintype.toCompleteLinearOrder: (α : Type u_1) → [inst : Fintype α] → [inst : LinearOrder α] → [inst : BoundedOrder α] → CompleteLinearOrder α
Fintype.toCompleteLinearOrder
-- See note [reducible non-instances] /-- A finite boolean algebra is complete. -/ @[reducible] noncomputable def
toCompleteBooleanAlgebra: [inst : BooleanAlgebra α] → CompleteBooleanAlgebra α
toCompleteBooleanAlgebra
[
BooleanAlgebra: Type ?u.87201 → Type ?u.87201
BooleanAlgebra
α: Type ?u.87192
α
] :
CompleteBooleanAlgebra: Type ?u.87204 → Type ?u.87204
CompleteBooleanAlgebra
α: Type ?u.87192
α
:= -- Porting note: using `Fintype.toCompleteDistribLattice α` caused timeouts {
Fintype.toCompleteLattice: (α : Type ?u.87209) → [inst : Fintype α] → [inst : Lattice α] → [inst : BoundedOrder α] → CompleteLattice α
Fintype.toCompleteLattice
α: Type ?u.87192
α
, ‹BooleanAlgebra α› with iInf_sup_le_sup_sInf := fun
a: ?m.89427
a
s: ?m.89430
s
=>

Goals accomplished! 🐙
ι: Type ?u.87189

α: Type ?u.87192

inst✝²: Fintype ι

inst✝¹: Fintype α

inst✝: BooleanAlgebra α

src✝¹:= toCompleteLattice α: CompleteLattice α

src✝:= inst✝: BooleanAlgebra α

a: α

s: Set α


(b, h, a b) a sInf s
ι: Type ?u.87189

α: Type ?u.87192

inst✝²: Fintype ι

inst✝¹: Fintype α

inst✝: BooleanAlgebra α

src✝¹:= toCompleteLattice α: CompleteLattice α

src✝:= inst✝: BooleanAlgebra α

a: α

s: Set α


h.e'_3
(b, h, a b) = inf (Set.toFinset s) fun i => a id i
ι: Type ?u.87189

α: Type ?u.87192

inst✝²: Fintype ι

inst✝¹: Fintype α

inst✝: BooleanAlgebra α

src✝¹:= toCompleteLattice α: CompleteLattice α

src✝:= inst✝: BooleanAlgebra α

a: α

s: Set α


(b, h, a b) a sInf s
ι: Type ?u.87189

α: Type ?u.87192

inst✝²: Fintype ι

inst✝¹: Fintype α

inst✝: BooleanAlgebra α

src✝¹:= toCompleteLattice α: CompleteLattice α

src✝:= inst✝: BooleanAlgebra α

a: α

s: Set α


h.e'_3
(b, h, a b) = inf (Set.toFinset s) fun i => a id i
ι: Type ?u.87189

α: Type ?u.87192

inst✝²: Fintype ι

inst✝¹: Fintype α

inst✝: BooleanAlgebra α

src✝¹:= toCompleteLattice α: CompleteLattice α

src✝:= inst✝: BooleanAlgebra α

a: α

s: Set α


h.e'_3
(b, h, a b) = a_1, h, a id a_1
ι: Type ?u.87189

α: Type ?u.87192

inst✝²: Fintype ι

inst✝¹: Fintype α

inst✝: BooleanAlgebra α

src✝¹:= toCompleteLattice α: CompleteLattice α

src✝:= inst✝: BooleanAlgebra α

a: α

s: Set α


h.e'_3
(b, h, a b) = a_1, h, a id a_1
ι: Type ?u.87189

α: Type ?u.87192

inst✝²: Fintype ι

inst✝¹: Fintype α

inst✝: BooleanAlgebra α

src✝¹:= toCompleteLattice α: CompleteLattice α

src✝:= inst✝: BooleanAlgebra α

a: α

s: Set α


(b, h, a b) a sInf s
ι: Type ?u.87189

α: Type ?u.87192

inst✝²: Fintype ι

inst✝¹: Fintype α

inst✝: BooleanAlgebra α

src✝¹:= toCompleteLattice α: CompleteLattice α

src✝:= inst✝: BooleanAlgebra α

a: α

s: Set α


h.e'_3
(b, x, a b) = a_1, x, a id a_1
ι: Type ?u.87189

α: Type ?u.87192

inst✝²: Fintype ι

inst✝¹: Fintype α

inst✝: BooleanAlgebra α

src✝¹:= toCompleteLattice α: CompleteLattice α

src✝:= inst✝: BooleanAlgebra α

a: α

s: Set α


h.e'_3
(b, x, a b) = a_1, x, a id a_1
ι: Type ?u.87189

α: Type ?u.87192

inst✝²: Fintype ι

inst✝¹: Fintype α

inst✝: BooleanAlgebra α

src✝¹:= toCompleteLattice α: CompleteLattice α

src✝:= inst✝: BooleanAlgebra α

a: α

s: Set α


h.e'_3
(b, x, a b) = a_1, x, a id a_1
ι: Type ?u.87189

α: Type ?u.87192

inst✝²: Fintype ι

inst✝¹: Fintype α

inst✝: BooleanAlgebra α

src✝¹:= toCompleteLattice α: CompleteLattice α

src✝:= inst✝: BooleanAlgebra α

a: α

s: Set α


(b, h, a b) a sInf s

Goals accomplished! 🐙
inf_sSup_le_iSup_inf := fun
a: ?m.89415
a
s: ?m.89418
s
=>

Goals accomplished! 🐙
ι: Type ?u.87189

α: Type ?u.87192

inst✝²: Fintype ι

inst✝¹: Fintype α

inst✝: BooleanAlgebra α

src✝¹:= toCompleteLattice α: CompleteLattice α

src✝:= inst✝: BooleanAlgebra α

a: α

s: Set α


a sSup s b, h, a b
ι: Type ?u.87189

α: Type ?u.87192

inst✝²: Fintype ι

inst✝¹: Fintype α

inst✝: BooleanAlgebra α

src✝¹:= toCompleteLattice α: CompleteLattice α

src✝:= inst✝: BooleanAlgebra α

a: α

s: Set α


h.e'_4
(b, h, a b) = sup (Set.toFinset s) fun i => a id i
ι: Type ?u.87189

α: Type ?u.87192

inst✝²: Fintype ι

inst✝¹: Fintype α

inst✝: BooleanAlgebra α

src✝¹:= toCompleteLattice α: CompleteLattice α

src✝:= inst✝: BooleanAlgebra α

a: α

s: Set α


a sSup s b, h, a b
ι: Type ?u.87189

α: Type ?u.87192

inst✝²: Fintype ι

inst✝¹: Fintype α

inst✝: BooleanAlgebra α

src✝¹:= toCompleteLattice α: CompleteLattice α

src✝:= inst✝: BooleanAlgebra α

a: α

s: Set α


h.e'_4
(b, h, a b) = sup (Set.toFinset s) fun i => a id i
ι: Type ?u.87189

α: Type ?u.87192

inst✝²: Fintype ι

inst✝¹: Fintype α

inst✝: BooleanAlgebra α

src✝¹:= toCompleteLattice α: CompleteLattice α

src✝:= inst✝: BooleanAlgebra α

a: α

s: Set α


h.e'_4
(b, h, a b) = a_1, h, a id a_1
ι: Type ?u.87189

α: Type ?u.87192

inst✝²: Fintype ι

inst✝¹: Fintype α

inst✝: BooleanAlgebra α

src✝¹:= toCompleteLattice α: CompleteLattice α

src✝:= inst✝: BooleanAlgebra α

a: α

s: Set α


h.e'_4
(b, h, a b) = a_1, h, a id a_1
ι: Type ?u.87189

α: Type ?u.87192

inst✝²: Fintype ι

inst✝¹: Fintype α

inst✝: BooleanAlgebra α

src✝¹:= toCompleteLattice α: CompleteLattice α

src✝:= inst✝: BooleanAlgebra α

a: α

s: Set α


a sSup s b, h, a b
ι: Type ?u.87189

α: Type ?u.87192

inst✝²: Fintype ι

inst✝¹: Fintype α

inst✝: BooleanAlgebra α

src✝¹:= toCompleteLattice α: CompleteLattice α

src✝:= inst✝: BooleanAlgebra α

a: α

s: Set α


h.e'_4
(b, x, a b) = a_1, x, a id a_1
ι: Type ?u.87189

α: Type ?u.87192

inst✝²: Fintype ι

inst✝¹: Fintype α

inst✝: BooleanAlgebra α

src✝¹:= toCompleteLattice α: CompleteLattice α

src✝:= inst✝: BooleanAlgebra α

a: α

s: Set α


h.e'_4
(b, x, a b) = a_1, x, a id a_1
ι: Type ?u.87189

α: Type ?u.87192

inst✝²: Fintype ι

inst✝¹: Fintype α

inst✝: BooleanAlgebra α

src✝¹:= toCompleteLattice α: CompleteLattice α

src✝:= inst✝: BooleanAlgebra α

a: α

s: Set α


h.e'_4
(b, x, a b) = a_1, x, a id a_1
ι: Type ?u.87189

α: Type ?u.87192

inst✝²: Fintype ι

inst✝¹: Fintype α

inst✝: BooleanAlgebra α

src✝¹:= toCompleteLattice α: CompleteLattice α

src✝:= inst✝: BooleanAlgebra α

a: α

s: Set α


a sSup s b, h, a b

Goals accomplished! 🐙
} #align fintype.to_complete_boolean_algebra
Fintype.toCompleteBooleanAlgebra: (α : Type u_1) → [inst : Fintype α] → [inst : BooleanAlgebra α] → CompleteBooleanAlgebra α
Fintype.toCompleteBooleanAlgebra
end BoundedOrder section Nonempty variable (
α: ?m.101245
α
) [
Nonempty: Sort ?u.101248 → Prop
Nonempty
α: ?m.101245
α
] -- See note [reducible non-instances] /-- A nonempty finite lattice is complete. If the lattice is already a `BoundedOrder`, then use `Fintype.toCompleteLattice` instead, as this gives definitional equality for `⊥` and `⊤`. -/ @[reducible] noncomputable def
toCompleteLatticeOfNonempty: (α : Type u_1) → [inst : Fintype α] → [inst : Nonempty α] → [inst : Lattice α] → CompleteLattice α
toCompleteLatticeOfNonempty
[
Lattice: Type ?u.101266 → Type ?u.101266
Lattice
α: Type ?u.101254
α
] :
CompleteLattice: Type ?u.101269 → Type ?u.101269
CompleteLattice
α: Type ?u.101254
α
:= @
toCompleteLattice: (α : Type ?u.101272) → [inst : Fintype α] → [inst : Lattice α] → [inst : BoundedOrder α] → CompleteLattice α
toCompleteLattice
_: Type ?u.101272
_
_ _ <| @
toBoundedOrder: (α : Type ?u.101322) → [inst : Fintype α] → [inst : Nonempty α] → [inst : Lattice α] → BoundedOrder α
toBoundedOrder
α: Type ?u.101254
α
_ ⟨
Classical.arbitrary: (α : Sort ?u.101329) → [h : Nonempty α] → α
Classical.arbitrary
α: Type ?u.101254
α
⟩ _ #align fintype.to_complete_lattice_of_nonempty
Fintype.toCompleteLatticeOfNonempty: (α : Type u_1) → [inst : Fintype α] → [inst : Nonempty α] → [inst : Lattice α] → CompleteLattice α
Fintype.toCompleteLatticeOfNonempty
-- See note [reducible non-instances] /-- A nonempty finite linear order is complete. If the linear order is already a `BoundedOrder`, then use `Fintype.toCompleteLinearOrder` instead, as this gives definitional equality for `⊥` and `⊤`. -/ @[reducible] noncomputable def
toCompleteLinearOrderOfNonempty: (α : Type u_1) → [inst : Fintype α] → [inst : Nonempty α] → [inst : LinearOrder α] → CompleteLinearOrder α
toCompleteLinearOrderOfNonempty
[
LinearOrder: Type ?u.101398 → Type ?u.101398
LinearOrder
α: Type ?u.101386
α
] :
CompleteLinearOrder: Type ?u.101401 → Type ?u.101401
CompleteLinearOrder
α: Type ?u.101386
α
:=
{ toCompleteLatticeOfNonempty α, ‹LinearOrder α› with }: CompleteLinearOrder ?m.101552
{
toCompleteLatticeOfNonempty: (α : Type ?u.101406) → [inst : Fintype α] → [inst : Nonempty α] → [inst : Lattice α] → CompleteLattice α
toCompleteLatticeOfNonempty
{ toCompleteLatticeOfNonempty α, ‹LinearOrder α› with }: CompleteLinearOrder ?m.101552
α: Type ?u.101386
α
{ toCompleteLatticeOfNonempty α, ‹LinearOrder α› with }: CompleteLinearOrder ?m.101552
, ‹LinearOrder α›
{ toCompleteLatticeOfNonempty α, ‹LinearOrder α› with }: CompleteLinearOrder ?m.101552
with
{ toCompleteLatticeOfNonempty α, ‹LinearOrder α› with }: CompleteLinearOrder ?m.101552
}
#align fintype.to_complete_linear_order_of_nonempty
Fintype.toCompleteLinearOrderOfNonempty: (α : Type u_1) → [inst : Fintype α] → [inst : Nonempty α] → [inst : LinearOrder α] → CompleteLinearOrder α
Fintype.toCompleteLinearOrderOfNonempty
end Nonempty end Fintype /-! ### Concrete instances -/ noncomputable instance
Fin.completeLinearOrder: {n : } → CompleteLinearOrder (Fin (n + 1))
Fin.completeLinearOrder
{
n:
n
:
: Type
} :
CompleteLinearOrder: Type ?u.178720 → Type ?u.178720
CompleteLinearOrder
(
Fin: Type
Fin
(
n:
n
+
1: ?m.178725
1
)) :=
Fintype.toCompleteLinearOrder: (α : Type ?u.178787) → [inst : Fintype α] → [inst : LinearOrder α] → [inst : BoundedOrder α] → CompleteLinearOrder α
Fintype.toCompleteLinearOrder
_: Type ?u.178787
_
noncomputable instance
Bool.completeLinearOrder: CompleteLinearOrder Bool
Bool.completeLinearOrder
:
CompleteLinearOrder: Type ?u.178921 → Type ?u.178921
CompleteLinearOrder
Bool: Type
Bool
:=
Fintype.toCompleteLinearOrder: (α : Type ?u.178923) → [inst : Fintype α] → [inst : LinearOrder α] → [inst : BoundedOrder α] → CompleteLinearOrder α
Fintype.toCompleteLinearOrder
_: Type ?u.178923
_
noncomputable instance
Bool.completeBooleanAlgebra: CompleteBooleanAlgebra Bool
Bool.completeBooleanAlgebra
:
CompleteBooleanAlgebra: Type ?u.179033 → Type ?u.179033
CompleteBooleanAlgebra
Bool: Type
Bool
:=
Fintype.toCompleteBooleanAlgebra: (α : Type ?u.179035) → [inst : Fintype α] → [inst : BooleanAlgebra α] → CompleteBooleanAlgebra α
Fintype.toCompleteBooleanAlgebra
_: Type ?u.179035
_
/-! ### Directed Orders -/ variable {
α: Type ?u.179088
α
:
Type _: Type (?u.179088+1)
Type _
} theorem
Directed.fintype_le: ∀ {r : ααProp} [inst : IsTrans α r] {β : Type u_2} {γ : Type u_3} [inst : Nonempty γ] {f : γα} [inst : Fintype β], Directed r f∀ (g : βγ), z, ∀ (i : β), r (f (g i)) (f z)
Directed.fintype_le
{
r: ααProp
r
:
α: Type ?u.179091
α
α: Type ?u.179091
α
Prop: Type
Prop
} [
IsTrans: (α : Type ?u.179100) → (ααProp) → Prop
IsTrans
α: Type ?u.179091
α
r: ααProp
r
] {
β: Type ?u.179105
β
γ: Type u_3
γ
:
Type _: Type (?u.179105+1)
Type _
} [
Nonempty: Sort ?u.179111 → Prop
Nonempty
γ: Type ?u.179108
γ
] {
f: γα
f
:
γ: Type ?u.179108
γ
α: Type ?u.179091
α
} [
Fintype: Type ?u.179118 → Type ?u.179118
Fintype
β: Type ?u.179105
β
] (
D: Directed r f
D
:
Directed: {α : Type ?u.179122} → {ι : Sort ?u.179121} → (ααProp) → (ια) → Prop
Directed
r: ααProp
r
f: γα
f
) (
g: βγ
g
:
β: Type ?u.179105
β
γ: Type ?u.179108
γ
) : ∃
z: ?m.179143
z
, ∀
i: ?m.179146
i
,
r: ααProp
r
(
f: γα
f
(
g: βγ
g
i: ?m.179146
i
)) (
f: γα
f
z: ?m.179143
z
) :=

Goals accomplished! 🐙
α: Type u_1

r: ααProp

inst✝²: IsTrans α r

β: Type u_2

γ: Type u_3

inst✝¹: Nonempty γ

f: γα

inst✝: Fintype β

D: Directed r f

g: βγ


z, ∀ (i : β), r (f (g i)) (f z)
α: Type u_1

r: ααProp

inst✝²: IsTrans α r

β: Type u_2

γ: Type u_3

inst✝¹: Nonempty γ

f: γα

inst✝: Fintype β

D: Directed r f

g: βγ


z, ∀ (i : β), r (f (g i)) (f z)
α: Type u_1

r: ααProp

inst✝²: IsTrans α r

β: Type u_2

γ: Type u_3

inst✝¹: Nonempty γ

f: γα

inst✝: Fintype β

D: Directed r f

g: βγ

z: γ

hz: ∀ (i : γ), i image g univr (f i) (f z)


intro
z, ∀ (i : β), r (f (g i)) (f z)
α: Type u_1

r: ααProp

inst✝²: IsTrans α r

β: Type u_2

γ: Type u_3

inst✝¹: Nonempty γ

f: γα

inst✝: Fintype β

D: Directed r f

g: βγ


z, ∀ (i : β), r (f (g i)) (f z)

Goals accomplished! 🐙
#align directed.fintype_le
Directed.fintype_le: ∀ {α : Type u_1} {r : ααProp} [inst : IsTrans α r] {β : Type u_2} {γ : Type u_3} [inst : Nonempty γ] {f : γα} [inst : Fintype β], Directed r f∀ (g : βγ), z, ∀ (i : β), r (f (g i)) (f z)
Directed.fintype_le
theorem
Fintype.exists_le: ∀ {α : Type u_1} [inst : Nonempty α] [inst : Preorder α] [inst_1 : IsDirected α fun x x_1 => x x_1] {β : Type u_2} [inst_2 : Fintype β] (f : βα), M, ∀ (i : β), f i M
Fintype.exists_le
[
Nonempty: Sort ?u.179628 → Prop
Nonempty
α: Type ?u.179625
α
] [
Preorder: Type ?u.179631 → Type ?u.179631
Preorder
α: Type ?u.179625
α
] [
IsDirected: (α : Type ?u.179634) → (ααProp) → Prop
IsDirected
α: Type ?u.179625
α
(· ≤ ·): ααProp
(· ≤ ·)
] {
β: Type u_2
β
:
Type _: Type (?u.179658+1)
Type _
} [
Fintype: Type ?u.179661 → Type ?u.179661
Fintype
β: Type ?u.179658
β
] (
f: βα
f
:
β: Type ?u.179658
β
α: Type ?u.179625
α
) : ∃
M: ?m.179671
M
, ∀
i: ?m.179674
i
,
f: βα
f
i: ?m.179674
i
M: ?m.179671
M
:=
directed_id: ∀ {α : Type ?u.179696} {r : ααProp} [inst : IsDirected α r], Directed r id
directed_id
.
fintype_le: ∀ {α : Type ?u.179712} {r : ααProp} [inst : IsTrans α r] {β : Type ?u.179713} {γ : Type ?u.179714} [inst : Nonempty γ] {f : γα} [inst : Fintype β], Directed r f∀ (g : βγ), z, ∀ (i : β), r (f (g i)) (f z)
fintype_le
_: ?m.179728?m.179729
_
#align fintype.exists_le
Fintype.exists_le: ∀ {α : Type u_1} [inst : Nonempty α] [inst : Preorder α] [inst_1 : IsDirected α fun x x_1 => x x_1] {β : Type u_2} [inst_2 : Fintype β] (f : βα), M, ∀ (i : β), f i M
Fintype.exists_le
theorem
Fintype.bddAbove_range: ∀ [inst : Nonempty α] [inst : Preorder α] [inst_1 : IsDirected α fun x x_1 => x x_1] {β : Type u_2} [inst_2 : Fintype β] (f : βα), BddAbove (Set.range f)
Fintype.bddAbove_range
[
Nonempty: Sort ?u.179933 → Prop
Nonempty
α: Type ?u.179930
α
] [
Preorder: Type ?u.179936 → Type ?u.179936
Preorder
α: Type ?u.179930
α
] [
IsDirected: (α : Type ?u.179939) → (ααProp) → Prop
IsDirected
α: Type ?u.179930
α
(· ≤ ·): ααProp
(· ≤ ·)
] {
β: Type u_2
β
:
Type _: Type (?u.179963+1)
Type _
} [
Fintype: Type ?u.179966 → Type ?u.179966
Fintype
β: Type ?u.179963
β
] (
f: βα
f
:
β: Type ?u.179963
β
α: Type ?u.179930
α
) :
BddAbove: {α : Type ?u.179973} → [inst : Preorder α] → Set αProp
BddAbove
(
Set.range: {α : Type ?u.179999} → {ι : Sort ?u.179998} → (ια) → Set α
Set.range
f: βα
f
) :=

Goals accomplished! 🐙
α: Type u_1

inst✝³: Nonempty α

inst✝²: Preorder α

inst✝¹: IsDirected α fun x x_1 => x x_1

β: Type u_2

inst✝: Fintype β

f: βα


α: Type u_1

inst✝³: Nonempty α

inst✝²: Preorder α

inst✝¹: IsDirected α fun x x_1 => x x_1

β: Type u_2

inst✝: Fintype β

f: βα

M: α

hM: ∀ (i : β), f i M


intro
α: Type u_1

inst✝³: Nonempty α

inst✝²: Preorder α

inst✝¹: IsDirected α fun x x_1 => x x_1

β: Type u_2

inst✝: Fintype β

f: βα


α: Type u_1

inst✝³: Nonempty α

inst✝²: Preorder α

inst✝¹: IsDirected α fun x x_1 => x x_1

β: Type u_2

inst✝: Fintype β

f: βα

M: α

hM: ∀ (i : β), f i M

a: α

ha: a Set.range f


intro
a M
α: Type u_1

inst✝³: Nonempty α

inst✝²: Preorder α

inst✝¹: IsDirected α fun x x_1 => x x_1

β: Type u_2

inst✝: Fintype β

f: βα


α: Type u_1

inst✝³: Nonempty α

inst✝²: Preorder α

inst✝¹: IsDirected α fun x x_1 => x x_1

β: Type u_2

inst✝: Fintype β

f: βα

M: α

hM: ∀ (i : β), f i M

b: β


intro.intro
f b M
α: Type u_1

inst✝³: Nonempty α

inst✝²: Preorder α

inst✝¹: IsDirected α fun x x_1 => x x_1

β: Type u_2

inst✝: Fintype β

f: βα



Goals accomplished! 🐙
#align fintype.bdd_above_range
Fintype.bddAbove_range: ∀ {α : Type u_1} [inst : Nonempty α] [inst : Preorder α] [inst_1 : IsDirected α fun x x_1 => x x_1] {β : Type u_2} [inst_2 : Fintype β] (f : βα), BddAbove (Set.range f)
Fintype.bddAbove_range