Acc
is the accessibility predicate. Given some relation r
(e.g. <
) and a value x
,
Acc r x
means that x
is accessible through r
:
x
is accessible if there exists no infinite sequence ... < y₂ < y₁ < y₀ < x
.
- intro: ∀ {α : Sort u} {r : α → α → Prop} (x : α), (∀ (y : α), r y x → Acc r y) → Acc r x
A value is accessible if for all
y
such thatr y x
,y
is also accessible. Note that if there exists noy
such thatr y x
, thenx
is accessible. Such anx
is called a base case.
Instances For
A relation r
is WellFounded
if all elements of α
are accessible within r
.
If a relation is WellFounded
, it does not allow for an infinite descent along the relation.
If the arguments of the recursive calls in a function definition decrease according to a well founded relation, then the function terminates. Well-founded relations are sometimes called Artinian or said to satisfy the “descending chain condition”.
- intro: ∀ {α : Sort u} {r : α → α → Prop}, (∀ (a : α), Acc r a) → WellFounded r
Instances For
- rel : α → α → Prop
- wf : WellFounded WellFoundedRelation.rel
Instances
Equations
Instances For
Equations
- WellFounded.fixF F x a = Acc.rec (fun (x₁ : α) (h : ∀ (y : α), r y x₁ → Acc r y) (ih : (y : α) → r y x₁ → C y) => F x₁ ih) a
Instances For
Equations
- hwf.fix F x = WellFounded.fixF F x ⋯
Instances For
Equations
- emptyWf = { rel := emptyRelation, wf := ⋯ }
Instances For
Instances For
Equations
Instances For
Equations
Instances For
Equations
- Nat.lt_wfRel = { rel := fun (x1 x2 : Nat) => x1 < x2, wf := Nat.lt_wfRel.proof_1 }
Instances For
Equations
- Nat.strongRecOn n ind = ⋯.fix ind n
Instances For
Equations
- Nat.strongInductionOn n ind = Nat.strongRecOn n ind
Instances For
Equations
- Nat.caseStrongInductionOn a zero ind = Nat.caseStrongRecOn a zero ind
Instances For
Instances For
Equations
- instWellFoundedRelationOfSizeOf = sizeOfWFRel
- left: ∀ {α : Type u} {β : Type v} {ra : α → α → Prop} {rb : β → β → Prop} {a₁ : α} (b₁ : β) {a₂ : α} (b₂ : β), ra a₁ a₂ → Prod.Lex ra rb (a₁, b₁) (a₂, b₂)
- right: ∀ {α : Type u} {β : Type v} {ra : α → α → Prop} {rb : β → β → Prop} (a : α) {b₁ b₂ : β}, rb b₁ b₂ → Prod.Lex ra rb (a, b₁) (a, b₂)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
Instances For
Equations
- Prod.rprod ha hb = { rel := Prod.RProd WellFoundedRelation.rel WellFoundedRelation.rel, wf := ⋯ }
Instances For
- left: ∀ {α : Sort u} {β : α → Sort v} {r : α → α → Prop} {s : (a : α) → β a → β a → Prop} {a₁ : α} (b₁ : β a₁) {a₂ : α} (b₂ : β a₂), r a₁ a₂ → PSigma.Lex r s ⟨a₁, b₁⟩ ⟨a₂, b₂⟩
- right: ∀ {α : Sort u} {β : α → Sort v} {r : α → α → Prop} {s : (a : α) → β a → β a → Prop} (a : α) {b₁ b₂ : β a}, s a b₁ b₂ → PSigma.Lex r s ⟨a, b₁⟩ ⟨a, b₂⟩
Instances For
Equations
- PSigma.lex ha hb = { rel := PSigma.Lex WellFoundedRelation.rel fun (a : α) => WellFoundedRelation.rel, wf := ⋯ }
Instances For
Equations
- PSigma.instWellFoundedRelation = PSigma.lex ha hb
Equations
- PSigma.lexNdep r s = PSigma.Lex r fun (x : α) => s
Instances For
- left: ∀ {α : Sort u} {β : Sort v} {r : α → α → Prop} {s : β → β → Prop} {a₁ a₂ : α} (b : β), r a₁ a₂ → PSigma.RevLex r s ⟨a₁, b⟩ ⟨a₂, b⟩
- right: ∀ {α : Sort u} {β : Sort v} {r : α → α → Prop} {s : β → β → Prop} (a₁ : α) {b₁ : β} (a₂ : α) {b₂ : β}, s b₁ b₂ → PSigma.RevLex r s ⟨a₁, b₁⟩ ⟨a₂, b₂⟩
Instances For
Equations
- PSigma.SkipLeft α s = PSigma.RevLex emptyRelation s
Instances For
Equations
- PSigma.skipLeft α hb = { rel := PSigma.SkipLeft α WellFoundedRelation.rel, wf := ⋯ }