So I’ve been working on formalizing a proof of the Church-Rosser theorem for beta-reduction in the untyped lambda calculus following Peter Selinger’s Lecture notes on the Lambda Calculus, and I’ve managed to do so for all the major lemmas leading up to the main theorem, but somehow, I spent hours on trying to prove that “diamond property implies confluence” (probably the last step to completing the proof for the main theorem) to no avail, even though its informal proof is already given as a nice little diagram in Figure 3. I’m probably missing something obvious here, so any hints on how to proceed would be much appreciated.
Here is a minimal reproducible snippet of my code:
From Coq Require Import Relations.
Ltac inv H := inversion H; subst; clear H.
Hint Constructors clos_refl_trans_1n.
Lemma diamond_property_implies_confluence :
forall {A : Type} (R : A -> A -> Prop),
(forall x y z,
R x y ->
R x z ->
exists w, R y w /\ R z w) ->
forall x y z,
clos_refl_trans_1n A R x y ->
clos_refl_trans_1n A R x z ->
exists w, clos_refl_trans_1n A R y w /\
clos_refl_trans_1n A R z w.
Proof.
intros.
generalize dependent z.
induction H0; intros; eauto.
inv H2; eauto.
destruct (H _ _ _ H0 H3) as [? [? ?]].
(* TODO *)
Admitted.
Specifically, I am stuck at the following context:
1 subgoal
A : Type
R : A -> A -> Prop
H : forall x y z : A,
R x y -> R x z -> exists w : A, R y w /\ R z w
x, y, z : A
H0 : R x y
H1 : clos_refl_trans_1n A R y z
IHclos_refl_trans_1n : forall z0 : A,
clos_refl_trans_1n A R y z0 ->
exists w : A,
clos_refl_trans_1n A R z
w /\
clos_refl_trans_1n A R z0
w
z0, y0 : A
H3 : R x y0
H4 : clos_refl_trans_1n A R y0 z0
x0 : A
H2 : R y x0
H5 : R y0 x0
______________________________________(1/1)
exists w : A,
clos_refl_trans_1n A R z w /\
clos_refl_trans_1n A R z0 w
Directly applying the inductive hypothesis at this stage to transform the goal to clos_refl_trans_1n A R y z0
seems like a dead end. The other thing that I tried was show that clos_refl_trans_1n A R y x0
and then apply the induction hypothesis to that to yield two new hypotheses clos_refl_trans_1n A R z w
and clos_refl_trans_1n A R x0 w
for some w
, but that doesn’t seem to lead me to a proof of clos_refl_trans_1n A R z0 w
either.