intros P Q a pa ex
A : Type
R : A → A → Prop
inhabited_A : Nonempty A
⊢ ∀ (P : A → Prop) (Q : A → A → Prop) (a : A),
    P a → (∀ (a : A), P a → ∃ b, P b ∧ Q a b) → ∃ f, f 0 = a ∧ ∀ (n : ℕ), P (f n) ∧ Q (f n) (f (n + 1))
A : Type
R : A → A → Prop
inhabited_A : Nonempty A
P : A → Prop
Q : A → A → Prop
a : A
pa : P a
ex : ∀ (a : A), P a → ∃ b, P b ∧ Q a b
⊢ ∃ f, f 0 = a ∧ ∀ (n : ℕ), P (f n) ∧ Q (f n) (f (n + 1))