- 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
def
well_founded.recursion
{α : Sort u}
{r : α → α → Prop}
(hwf : well_founded r)
{C : α → Sort v}
(a : α)
(h : Π (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 : α)
(h : ∀ (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 : α)
(a : 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
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.accessible
{α : Sort u}
{β : Sort v}
{r : β → β → Prop}
(f : α → β)
{a : α}
(ac : acc r (f a)) :
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 := _}
- 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₂)
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_sub_lex
{α : Type u}
{β : Type v}
{ra : α → α → Prop}
{rb : β → β → Prop}
(a b : α × β) :
prod.rprod ra rb a b → prod.lex ra rb a b
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 (α × β)