Well-founded relations #
A relation is well-founded if it can be used for induction: for each x
, (∀ y, r y x → P y) → P x
implies P x
. Well-founded relations can be used for induction and recursion, including
construction of fixed points in the space of dependent functions Π x : α , β x
.
The predicate WellFounded
is defined in the core library. In this file we prove some extra lemmas
and provide a few new definitions: WellFounded.min
, WellFounded.sup
, and WellFounded.succ
,
and an induction principle WellFounded.induction_bot
.
Equations
- ⋯ = ⋯
Equations
- ⋯ = ⋯
If r
is a well-founded relation, then any nonempty set has a minimal element
with respect to r
.
A minimal element of a nonempty set in a well-founded order.
If you're working with a nonempty linear order, consider defining a
ConditionallyCompleteLinearOrderBot
instance via
WellFounded.conditionallyCompleteLinearOrderWithBot
and using Inf
instead.
Equations
- H.min s h = Classical.choose ⋯
Instances For
The supremum of a bounded, well-founded order
Equations
- wf.sup s h = wf.min {x : α | ∀ a ∈ s, r a x} h
Instances For
A successor of an element x
in a well-founded order is a minimal element y
such that
x < y
if one exists. Otherwise it is x
itself.
Deprecated. If you have a linear order, consider defining a SuccOrder
instance through
ConditionallyCompleteLinearOrder.toSuccOrder
.
Equations
- wf.succ x = if h : ∃ (y : α), r x y then wf.min {y : α | r x y} h else x
Instances For
A strictly monotone function f
on a well-order satisfies x ≤ f x
for all x
.
A strictly monotone function f
on a cowell-order satisfies f x ≤ x
for all x
.
Given a function f : α → β
where β
carries a well-founded <
, this is an element of α
whose image under f
is minimal in the sense of Function.not_lt_argmin
.
Equations
- Function.argmin f h = ⋯.min Set.univ ⋯
Instances For
Given a function f : α → β
where β
carries a well-founded <
, and a non-empty subset s
of α
, this is an element of s
whose image under f
is minimal in the sense of
Function.not_lt_argminOn
.
Equations
- Function.argminOn f h s hs = ⋯.min s hs
Instances For
Let r
be a relation on α
, let f : α → β
be a function, let C : β → Prop
, and
let bot : α
. This induction principle shows that C (f bot)
holds, given that
- some
a
that is accessible byr
satisfiesC (f a)
, and - for each
b
such thatf b ≠ f bot
andC (f b)
holds, there isc
satisfyingr c b
andC (f c)
.
Let r
be a relation on α
, let C : α → Prop
and let bot : α
.
This induction principle shows that C bot
holds, given that
- some
a
that is accessible byr
satisfiesC a
, and - for each
b ≠ bot
such thatC b
holds, there isc
satisfyingr c b
andC c
.
Let r
be a well-founded relation on α
, let f : α → β
be a function,
let C : β → Prop
, and let bot : α
.
This induction principle shows that C (f bot)
holds, given that
- some
a
satisfiesC (f a)
, and - for each
b
such thatf b ≠ f bot
andC (f b)
holds, there isc
satisfyingr c b
andC (f c)
.
Let r
be a well-founded relation on α
, let C : α → Prop
, and let bot : α
.
This induction principle shows that C bot
holds, given that
- some
a
satisfiesC a
, and - for each
b
that satisfiesC b
, there isc
satisfyingr c b
andC c
.
The naming is inspired by the fact that when r
is transitive, it follows that bot
is
the smallest element w.r.t. r
that satisfies C
.
A nonempty linear order with well-founded <
has a bottom element.
Equations
- WellFoundedLT.toOrderBot = OrderBot.mk ⋯
Instances For
A nonempty linear order with well-founded >
has a top element.
Equations
- WellFoundedGT.toOrderTop = inferInstanceAs (OrderTop αᵒᵈᵒᵈ)