proposition: Lemma FiniteTables_AbsR_Delete {qs_schema} : forall r_o r_n idx P (P_dec : DecideableEnsemble P), FiniteTables_AbsR r_o r_n -> refine {r_n0 : UnConstrQueryStructure qs_schema | FiniteTables_AbsR (UpdateUnConstrRelation r_o idx (EnsembleDelete (GetUnConstrRelation r_o idx) P)) r_n0} (ret (UpdateUnConstrRelation r_n idx (EnsembleDelete (GetUnConstrRelation r_n idx) P))).
proof: Proof. intros; refine pick val _; try split; eauto. - destruct H; subst; reflexivity. - destruct H; intros idx'; destruct (fin_eq_dec idx idx'); subst; unfold GetUnConstrRelation, UpdateUnConstrRelation. + rewrite ith_replace2_Index_eq. destruct (H0 idx') as [? ?]. eexists. eauto using UnIndexedEnsembleListEquivalence_Delete. + rewrite ith_replace2_Index_neq; eauto. Qed.
imports: Coq.Arith.Arith Coq.ZArith.ZArith Coq.NArith.NArith Coq.ZArith.ZArith Coq.Strings.String Coq.Lists.List Coq.Sorting.Permutation Coq.Bool.Bool Coq.Sets.Ensembles Coq.Logic.FunctionalExtensionality Fiat.ADTNotation Fiat.Common Fiat.Common.ilist2 Fiat.Common.List.ListFacts Fiat.Common.Ensembles.IndexedEnsembles Fiat.Common.DecideableEnsembles Fiat.Computation Fiat.ADTRefinement.BuildADTRefinements Fiat.QueryStructure.Specification.Representation.QueryStructureSchema Fiat.QueryStructure.Specification.Operations.FlattenCompList Fiat.QueryStructure.Specification.Operations.Query Fiat.QueryStructure.Specification.Representation.QueryStructure