A value x : α
is accessible from r
when every value that's lesser under r
is also
accessible. Note that any value that's minimal under r
is vacuously accessible.
Equivalently, acc r x
when there is no infinite chain of elements starting at x
that are related
under r
.
This is used to state the definition of well-foundedness (see well_founded
).
A relation r : α → α → Prop
is well-founded when ∀ x, (∀ y, r y x → P y → P x) → P x
for all
predicates P
. Equivalently, acc r x
for all x
.
Once you know that a relation is well_founded, you can use it to define fixpoint functions on α
.
@[class]
- r : α → α → Prop
- wf : well_founded has_well_founded.r
Instances of this typeclass
Instances of other typeclasses for has_well_founded
- has_well_founded.has_sizeof_inst
theorem
well_founded.fix_F_eq
{α : Sort u}
{r : α → α → Prop}
{C : α → Sort v}
(F : Π (x : α), (Π (y : α), r y x → C y) → C x)
(x : α)
(acx : acc r x) :
well_founded.fix_F F x acx = F x (λ (y : α) (p : r y x), well_founded.fix_F F y _)
def
well_founded.fix
{α : Sort u}
{C : α → Sort v}
{r : α → α → Prop}
(hwf : well_founded r)
(F : Π (x : α), (Π (y : α), r y x → C y) → C x)
(x : α) :
C x
Well-founded fixpoint
Equations
- hwf.fix F x = well_founded.fix_F F x _
Subrelation of a well-founded relation is well-founded
theorem
subrelation.accessible
{α : Sort u}
{r Q : α → α → Prop}
(h₁ : subrelation Q r)
{a : α}
(ac : acc r a) :
acc Q a
theorem
subrelation.wf
{α : Sort u}
{r Q : α → α → Prop}
(h₁ : subrelation Q r)
(h₂ : well_founded r) :
theorem
inv_image.wf
{α : Sort u}
{β : Sort v}
{r : β → β → Prop}
(f : α → β)
(h : well_founded r) :
well_founded (inv_image r f)
Equations
@[protected, instance]
Equations
- has_well_founded_of_has_sizeof α = {r := sizeof_measure α _inst_1, wf := _}
theorem
prod.lex_wf
{α : Type u}
{β : Type v}
{ra : α → α → Prop}
{rb : β → β → Prop}
(ha : well_founded ra)
(hb : well_founded rb) :
well_founded (prod.lex ra rb)
theorem
prod.rprod_wf
{α : Type u}
{β : Type v}
{ra : α → α → Prop}
{rb : β → β → Prop}
(ha : well_founded ra)
(hb : well_founded rb) :
well_founded (prod.rprod ra rb)
@[protected, instance]
def
prod.has_well_founded
{α : Type u}
{β : Type v}
[s₁ : has_well_founded α]
[s₂ : has_well_founded β] :
has_well_founded (α × β)