- apply : ∀ (a : α), acc r a
A relation r : α → α → Prop
is well-founded when ∀ x, (∀ y, r y x → P y → P x) → P x
for all predicates P
.
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
theorem
well_founded.recursion
{α : Sort u}
{r : α → α → Prop}
(hwf : well_founded r)
{C : α → Sort v}
(a : α) :
(Π (x : α), (Π (y : α), r y x → C y) → C x) → C a
theorem
well_founded.induction
{α : Sort u}
{r : α → α → Prop}
(hwf : well_founded r)
{C : α → Prop}
(a : α) :
(∀ (x : α), (∀ (y : α), r y x → C y) → C x) → C a
def
well_founded.fix_F
{α : Sort u}
{r : α → α → Prop}
{C : α → Sort v}
(F : Π (x : α), (Π (y : α), r y x → C y) → C x)
(x : α) :
acc r x → C x
Equations
- well_founded.fix_F F x a = a.rec_on (λ (x₁ : α) (ac₁ : ∀ (y : α), r y x₁ → acc r y) (ih : Π (y : α), r y x₁ → C y), F x₁ ih)
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 _
theorem
well_founded.fix_eq
{α : Sort u}
{C : α → Sort v}
{r : α → α → Prop}
(hwf : well_founded r)
(F : Π (x : α), (Π (y : α), r y x → C y) → C x)
(x : α) :
Well-founded fixpoint satisfies fixpoint equation
Empty relation is well-founded
Equations
- _ = _
def
subrelation.wf
{α : Sort u}
{r Q : α → α → Prop} :
subrelation Q r → well_founded r → well_founded Q
Equations
- _ = _
def
inv_image.wf
{α : Sort u}
{β : Sort v}
{r : β → β → Prop}
(f : α → β) :
well_founded r → well_founded (inv_image r f)
Equations
- _ = _
Equations
- _ = _
Equations
Equations
- _ = _
@[instance]
Equations
- has_well_founded_of_has_sizeof α = {r := sizeof_measure α _inst_1, wf := _}
- intro : ∀ {α : Type u} {β : Type v} (ra : α → α → Prop) (rb : β → β → Prop) {a₁ : α} {b₁ : β} {a₂ : α} {b₂ : β}, ra a₁ a₂ → rb b₁ b₂ → prod.rprod ra rb (a₁, b₁) (a₂, b₂)
def
prod.lex_wf
{α : Type u}
{β : Type v}
{ra : α → α → Prop}
{rb : β → β → Prop} :
well_founded ra → well_founded rb → well_founded (prod.lex ra rb)
Equations
- _ = _
def
prod.rprod_sub_lex
{α : Type u}
{β : Type v}
{ra : α → α → Prop}
{rb : β → β → Prop}
(a b : α × β) :
prod.rprod ra rb a b → prod.lex ra rb a b
Equations
def
prod.rprod_wf
{α : Type u}
{β : Type v}
{ra : α → α → Prop}
{rb : β → β → Prop} :
well_founded ra → well_founded rb → well_founded (prod.rprod ra rb)
Equations
- _ = _
@[instance]
def
prod.has_well_founded
{α : Type u}
{β : Type v}
[s₁ : has_well_founded α]
[s₂ : has_well_founded β] :
has_well_founded (α × β)