proposition: Lemma well_founded_well_founded_acc_relation_of_opt B f fA : well_founded (@well_founded_acc_relation_of_opt B f fA).
proof: Proof. intro b. constructor. unfold well_founded_acc_relation_of_opt. generalize (fA b). generalize (f b). intros [fb|]. { revert fb. lazymatch goal with | [ |- forall a' wf', @?P a' wf' ] => apply (@Acc_ind_dep A RA P) end. intros a Ha IH y. constructor. generalize dependent (fA y). destruct (f y) as [fy|] eqn:Hfy. { intros y0 [pf Hy]. intros z Hz. specialize (IH fy pf z). apply IH; clear IH. destruct Hy. apply Hz. } { intros ? []. } } { intros ?? []. } Defined.
imports: Coq.Setoids.Setoid Coq.Program.Program Coq.Program.Wf Coq.Arith.Wf_nat Coq.Classes.Morphisms Coq.Init.Wf Coq.Lists.SetoidList Coq.Arith.PeanoNat Fiat.Common.Coq__8_4__8_5__Compat