File: .lake/packages/lean4/src/lean/Init/WF.lean

full_name: Acc.intro
code: /--
`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`.
-/
inductive Acc {α : Sort u} (r : α → α → Prop) : α → Prop where
  /--
  A value is accessible if for all `y` such that `r y x`, `y` is also accessible.
  Note that if there exists no `y` such that `r y x`, then `x` is accessible. Such an `x` is called a
  _base case_.
  -/
  | intro (x : α) (h : (y : α) → r y x → Acc r y) : Acc r x
goal: Acc r x

full_name: Acc
code: /--
`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`.
-/
inductive Acc {α : Sort u} (r : α → α → Prop) : α → Prop where
  /--
  A value is accessible if for all `y` such that `r y x`, `y` is also accessible.
  Note that if there exists no `y` such that `r y x`, then `x` is accessible. Such an `x` is called a
  _base case_.
  -/
  | intro (x : α) (h : (y : α) → r y x → Acc r y) : Acc r x
goal: α → Prop

full_name: Acc.ndrec
code: noncomputable abbrev Acc.ndrec.{u1, u2} {α : Sort u2} {r : α → α → Prop} {C : α → Sort u1}
    (m : (x : α) → ((y : α) → r y x → Acc r y) → ((y : α) → (a : r y x) → C y) → C x)
    {a : α} (n : Acc r a) : C a 
goal: C a

full_name: Acc.ndrecOn
code: noncomputable abbrev Acc.ndrecOn.{u1, u2} {α : Sort u2} {r : α → α → Prop} {C : α → Sort u1}
    {a : α} (n : Acc r a)
    (m : (x : α) → ((y : α) → r y x → Acc r y) → ((y : α) → (a : r y x) → C y) → C x)
    : C a 
goal: C a

full_name: Acc.inv
code: theorem inv {x y : α} (h₁ : Acc r x) (h₂ : r y x) : Acc r y 
goal: Acc r y

full_name: WellFounded.intro
code: /--
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”.
-/
inductive WellFounded {α : Sort u} (r : α → α → Prop) : Prop where
  | intro (h : ∀ a, Acc r a) : WellFounded r
goal: WellFounded r

full_name: WellFounded
code: /--
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”.
-/
inductive WellFounded {α : Sort u} (r : α → α → Prop) : Prop where
  | intro (h : ∀ a, Acc r a) : WellFounded r
goal: Prop

full_name: WellFoundedRelation.wf
code: class WellFoundedRelation (α : Sort u) where
  rel : α → α → Prop
  wf  : WellFounded rel
goal: WellFounded WellFoundedRelation.rel

full_name: WellFoundedRelation
code: class WellFoundedRelation (α : Sort u) where
  rel : α → α → Prop
  wf  : WellFounded rel
goal: Sort (max 1 u)

full_name: WellFoundedRelation.rel
code: class WellFoundedRelation (α : Sort u) where
  rel : α → α → Prop
  wf  : WellFounded rel
goal: α → α → Prop

full_name: WellFounded.apply
code: theorem apply {α : Sort u} {r : α → α → Prop} (wf : WellFounded r) (a : α) : Acc r a 
goal: Acc r a

full_name: WellFounded.recursion
code: noncomputable def recursion {C : α → Sort v} (a : α) (h : ∀ x, (∀ y, r y x → C y) → C x) : C a 
goal: C a

full_name: WellFounded.induction
code: theorem induction {C : α → Prop} (a : α) (h : ∀ x, (∀ y, r y x → C y) → C x) : C a 
goal: C a

full_name: WellFounded.fixF
code: noncomputable def fixF (x : α) (a : Acc r x) : C x 
goal: C x

full_name: WellFounded.fixFEq
code: theorem fixFEq (x : α) (acx : Acc r x) : fixF F x acx = F x (fun (y : α) (p : r y x) => fixF F y (Acc.inv acx p)) 
goal: WellFounded.fixF F x acx = F x fun y p => WellFounded.fixF F y ⋯

full_name: WellFounded.fix
code: noncomputable def fix (hwf : WellFounded r) (F : ∀ x, (∀ y, r y x → C y) → C x) (x : α) : C x 
goal: C x

full_name: WellFounded.fix_eq
code: theorem fix_eq (hwf : WellFounded r) (F : ∀ x, (∀ y, r y x → C y) → C x) (x : α) :
    fix hwf F x = F x (fun y _ => fix hwf F y) 
goal: hwf.fix F x = F x fun y x => hwf.fix F y

full_name: emptyWf
code: def emptyWf {α : Sort u} : WellFoundedRelation α 
goal: WellFoundedRelation α

full_name: Subrelation.accessible
code: theorem accessible {a : α} (h₁ : Subrelation q r) (ac : Acc r a) : Acc q a 
goal: Acc q a

full_name: Subrelation.wf
code: theorem wf (h₁ : Subrelation q r) (h₂ : WellFounded r) : WellFounded q 
goal: WellFounded q

full_name: _private.«.lake».packages.lean4.src.lean.Init.WF.0.InvImage.accAux
code: private def accAux (f : α → β) {b : β} (ac : Acc r b) : (x : α) → f x = b → Acc (InvImage r f) x 
goal: f x = b → Acc (InvImage r f) x

full_name: InvImage.accessible
code: theorem accessible {a : α} (f : α → β) (ac : Acc r (f a)) : Acc (InvImage r f) a 
goal: Acc (InvImage r f) a

full_name: InvImage.wf
code: theorem wf (f : α → β) (h : WellFounded r) : WellFounded (InvImage r f) 
goal: WellFounded (InvImage r f)

full_name: invImage
code: @[reducible] def invImage (f : α → β) (h : WellFoundedRelation β) : WellFoundedRelation α 
goal: WellFoundedRelation α

full_name: TC.accessible
code: theorem accessible {z : α} (ac : Acc r z) : Acc (TC r) z 
goal: Acc (TC r) z

full_name: TC.wf
code: theorem wf (h : WellFounded r) : WellFounded (TC r) 
goal: WellFounded (TC r)

full_name: Nat.lt_wfRel
code: def lt_wfRel : WellFoundedRelation Nat 
goal: WellFoundedRelation Nat

full_name: Nat.strongInductionOn
code: protected noncomputable def strongInductionOn
    {motive : Nat → Sort u}
    (n : Nat)
    (ind : ∀ n, (∀ m, m < n → motive m) → motive n) : motive n 
goal: motive n

full_name: Nat.caseStrongInductionOn
code: protected noncomputable def caseStrongInductionOn
    {motive : Nat → Sort u}
    (a : Nat)
    (zero : motive 0)
    (ind : ∀ n, (∀ m, m ≤ n → motive m) → motive (succ n)) : motive a 
goal: motive a

full_name: measure
code: abbrev measure {α : Sort u} (f : α → Nat) : WellFoundedRelation α 
goal: WellFoundedRelation α

full_name: sizeOfWFRel
code: abbrev sizeOfWFRel {α : Sort u} [SizeOf α] : WellFoundedRelation α 
goal: WellFoundedRelation α

full_name: instWellFoundedRelationOfSizeOf
code: instance (priority := low) [SizeOf α] : WellFoundedRelation α 
goal: WellFoundedRelation α

full_name: Prod.Lex
code: protected inductive Lex : α × β → α × β → Prop where
  | left  {a₁} (b₁) {a₂} (b₂) (h : ra a₁ a₂) : Prod.Lex (a₁, b₁) (a₂, b₂)
  | right (a) {b₁ b₂} (h : rb b₁ b₂)         : Prod.Lex (a, b₁)  (a, b₂)
goal: α × β → α × β → Prop

full_name: Prod.Lex.left
code: protected inductive Lex : α × β → α × β → Prop where
  | left  {a₁} (b₁) {a₂} (b₂) (h : ra a₁ a₂) : Prod.Lex (a₁, b₁) (a₂, b₂)
  | right (a) {b₁ b₂} (h : rb b₁ b₂)         : Prod.Lex (a, b₁)  (a, b₂)
goal: Prod.Lex ra rb { fst := a₁, snd := b₁ } { fst := a₂, snd := b₂ }

full_name: Prod.Lex.right
code: protected inductive Lex : α × β → α × β → Prop where
  | left  {a₁} (b₁) {a₂} (b₂) (h : ra a₁ a₂) : Prod.Lex (a₁, b₁) (a₂, b₂)
  | right (a) {b₁ b₂} (h : rb b₁ b₂)         : Prod.Lex (a, b₁)  (a, b₂)
goal: Prod.Lex ra rb { fst := a, snd := b₁ } { fst := a, snd := b₂ }

full_name: Prod.lex_def
code: theorem lex_def (r : α → α → Prop) (s : β → β → Prop) {p q : α × β} :
    Prod.Lex r s p q ↔ r p.1 q.1 ∨ p.1 = q.1 ∧ s p.2 q.2 
goal: Prod.Lex r s p q ↔ r p.fst q.fst ∨ p.fst = q.fst ∧ s p.snd q.snd

full_name: Prod.Lex.instDecidableRelOfDecidableEq
code: instance [αeqDec : DecidableEq α] {r : α → α → Prop} [rDec : DecidableRel r]
    {s : β → β → Prop} [sDec : DecidableRel s] : DecidableRel (Prod.Lex r s)
  
goal: DecidableRel (Prod.Lex r s)

full_name: Prod.Lex.right'
code: theorem right' {a₁ : Nat} {b₁ : β} (h₁ : a₁ ≤ a₂) (h₂ : rb b₁ b₂) : Prod.Lex Nat.lt rb (a₁, b₁) (a₂, b₂) 
goal: Prod.Lex Nat.lt rb { fst := a₁, snd := b₁ } { fst := a₂, snd := b₂ }

full_name: Prod.RProd
code: inductive RProd : α × β → α × β → Prop where
  | intro {a₁ b₁ a₂ b₂} (h₁ : ra a₁ a₂) (h₂ : rb b₁ b₂) : RProd (a₁, b₁) (a₂, b₂)
goal: α × β → α × β → Prop

full_name: Prod.RProd.intro
code: inductive RProd : α × β → α × β → Prop where
  | intro {a₁ b₁ a₂ b₂} (h₁ : ra a₁ a₂) (h₂ : rb b₁ b₂) : RProd (a₁, b₁) (a₂, b₂)
goal: Prod.RProd ra rb { fst := a₁, snd := b₁ } { fst := a₂, snd := b₂ }

full_name: Prod.lexAccessible
code: theorem lexAccessible {a : α} (aca : Acc ra a) (acb : (b : β) → Acc rb b) (b : β) : Acc (Prod.Lex ra rb) (a, b) 
goal: Acc (Prod.Lex ra rb) { fst := a, snd := b }

full_name: Prod.lex
code: @[reducible] def lex (ha : WellFoundedRelation α) (hb : WellFoundedRelation β) : WellFoundedRelation (α × β) 
goal: WellFoundedRelation (α × β)

full_name: Prod.instWellFoundedRelation
code: instance [ha : WellFoundedRelation α] [hb : WellFoundedRelation β] : WellFoundedRelation (α × β) 
goal: WellFoundedRelation (α × β)

full_name: Prod.RProdSubLex
code: def RProdSubLex (a : α × β) (b : α × β) (h : RProd ra rb a b) : Prod.Lex ra rb a b 
goal: Prod.Lex ra rb a b

full_name: Prod.rprod
code: def rprod (ha : WellFoundedRelation α) (hb : WellFoundedRelation β) : WellFoundedRelation (α × β) 
goal: WellFoundedRelation (α × β)

full_name: PSigma.Lex
code: inductive Lex : PSigma β → PSigma β → Prop where
  | left  : ∀ {a₁ : α} (b₁ : β a₁) {a₂ : α} (b₂ : β a₂), r a₁ a₂ → Lex ⟨a₁, b₁⟩ ⟨a₂, b₂⟩
  | right : ∀ (a : α)  {b₁ b₂ : β a}, s a b₁ b₂ → Lex ⟨a, b₁⟩ ⟨a, b₂⟩
goal: PSigma β → PSigma β → Prop

full_name: PSigma.Lex.left
code: inductive Lex : PSigma β → PSigma β → Prop where
  | left  : ∀ {a₁ : α} (b₁ : β a₁) {a₂ : α} (b₂ : β a₂), r a₁ a₂ → Lex ⟨a₁, b₁⟩ ⟨a₂, b₂⟩
  | right : ∀ (a : α)  {b₁ b₂ : β a}, s a b₁ b₂ → Lex ⟨a, b₁⟩ ⟨a, b₂⟩
goal: r a₁ a₂ → PSigma.Lex r s ⟨a₁, b₁⟩ ⟨a₂, b₂⟩

full_name: PSigma.Lex.right
code: inductive Lex : PSigma β → PSigma β → Prop where
  | left  : ∀ {a₁ : α} (b₁ : β a₁) {a₂ : α} (b₂ : β a₂), r a₁ a₂ → Lex ⟨a₁, b₁⟩ ⟨a₂, b₂⟩
  | right : ∀ (a : α)  {b₁ b₂ : β a}, s a b₁ b₂ → Lex ⟨a, b₁⟩ ⟨a, b₂⟩
goal: s a b₁ b₂ → PSigma.Lex r s ⟨a, b₁⟩ ⟨a, b₂⟩

full_name: PSigma.lexAccessible
code: def lexAccessible {a} (aca : Acc r a) (acb : (a : α) → WellFounded (s a)) (b : β a) : Acc (Lex r s) ⟨a, b⟩ 
goal: Acc (PSigma.Lex r s) ⟨a, b⟩

full_name: PSigma.lex
code: @[reducible] def lex (ha : WellFoundedRelation α) (hb : (a : α) → WellFoundedRelation (β a)) : WellFoundedRelation (PSigma β) 
goal: WellFoundedRelation (PSigma β)

full_name: PSigma.instWellFoundedRelation
code: instance [ha : WellFoundedRelation α] [hb : (a : α) → WellFoundedRelation (β a)] : WellFoundedRelation (PSigma β) 
goal: WellFoundedRelation (PSigma β)

full_name: PSigma.lexNdep
code: def lexNdep (r : α → α → Prop) (s : β → β → Prop) 

full_name: PSigma.lexNdepWf
code: theorem lexNdepWf {r  : α → α → Prop} {s : β → β → Prop} (ha : WellFounded r) (hb : WellFounded s) : WellFounded (lexNdep r s) 
goal: WellFounded (PSigma.lexNdep r s)

full_name: PSigma.RevLex
code: inductive RevLex (r  : α → α → Prop) (s  : β → β → Prop) : @PSigma α (fun _ => β) → @PSigma α (fun _ => β) → Prop where
  | left  : {a₁ a₂ : α} → (b : β) → r a₁ a₂ → RevLex r s ⟨a₁, b⟩ ⟨a₂, b⟩
  | right : (a₁ : α) → {b₁ : β} → (a₂ : α) → {b₂ : β} → s b₁ b₂ → RevLex r s ⟨a₁, b₁⟩ ⟨a₂, b₂⟩

full_name: PSigma.RevLex.left
code: inductive RevLex (r  : α → α → Prop) (s  : β → β → Prop) : @PSigma α (fun _ => β) → @PSigma α (fun _ => β) → Prop where
  | left  : {a₁ a₂ : α} → (b : β) → r a₁ a₂ → RevLex r s ⟨a₁, b⟩ ⟨a₂, b⟩
  | right : (a₁ : α) → {b₁ : β} → (a₂ : α) → {b₂ : β} → s b₁ b₂ → RevLex r s ⟨a₁, b₁⟩ ⟨a₂, b₂⟩
goal: r a₁ a₂ → PSigma.RevLex r s ⟨a₁, b⟩ ⟨a₂, b⟩

full_name: PSigma.RevLex.right
code: inductive RevLex (r  : α → α → Prop) (s  : β → β → Prop) : @PSigma α (fun _ => β) → @PSigma α (fun _ => β) → Prop where
  | left  : {a₁ a₂ : α} → (b : β) → r a₁ a₂ → RevLex r s ⟨a₁, b⟩ ⟨a₂, b⟩
  | right : (a₁ : α) → {b₁ : β} → (a₂ : α) → {b₂ : β} → s b₁ b₂ → RevLex r s ⟨a₁, b₁⟩ ⟨a₂, b₂⟩
goal: s b₁ b₂ → PSigma.RevLex r s ⟨a₁, b₁⟩ ⟨a₂, b₂⟩

full_name: PSigma.revLexAccessible
code: theorem revLexAccessible {b} (acb : Acc s b) (aca : (a : α) → Acc r a): (a : α) → Acc (RevLex r s) ⟨a, b⟩ 
goal: Acc (PSigma.RevLex r s) ⟨a, b⟩

full_name: PSigma.revLex
code: theorem revLex (ha : WellFounded r) (hb : WellFounded s) : WellFounded (RevLex r s) 
goal: WellFounded (PSigma.RevLex r s)

full_name: PSigma.SkipLeft
code: def SkipLeft (α : Type u) {β : Type v} (s : β → β → Prop) : @PSigma α (fun _ => β) → @PSigma α (fun _ => β) → Prop 

full_name: PSigma.skipLeft
code: def skipLeft (α : Type u) {β : Type v} (hb : WellFoundedRelation β) : WellFoundedRelation (PSigma fun _ : α => β) 

full_name: PSigma.mkSkipLeft
code: theorem mkSkipLeft {α : Type u} {β : Type v} {b₁ b₂ : β} {s : β → β → Prop} (a₁ a₂ : α) (h : s b₁ b₂) : SkipLeft α s ⟨a₁, b₁⟩ ⟨a₂, b₂⟩ 
goal: PSigma.SkipLeft α s ⟨a₁, b₁⟩ ⟨a₂, b₂⟩