(* ---------------------------------------------- *)

Lemma An_CPiCong_exists2
: ∀ (c : atom) (G : context) (D : available_props)
(g1 g3 : co) (phi1 : constraint) (B1 : tm)
(phi2 : constraint) (B3 B2 : tm),
AnnIso G D g1 phi1 phi2
→ c
`notin` (union (dom G)
(union D
(union (fv_co_co_tm B2)
(union (fv_co_co_tm B1)
(union (fv_co_co_co g3)
(union (fv_co_co_co g1)
(fv_co_co_tm B3)))))))
→ AnnDefEq ([(c, Co phi1)] ++ G) D
(open_co_wrt_co g3 (g_Var_f c))
(open_tm_wrt_co B1 (g_Var_f c))
(open_tm_wrt_co B2 (g_Var_f c))
→ open_tm_wrt_co B3 (g_Var_f c) =
open_tm_wrt_co B2 (g_Cast (g_Var_f c) (g_Sym g1))
→ AnnTyping G (a_CPi phi1 B1) a_Star
→ AnnTyping G (a_CPi phi1 B2) a_Star
→ AnnDefEq G D (g_CPiCong g1 g3) (a_CPi phi1 B1) (a_CPi phi2 B3).