proposition: Corollary refine_QueryIn_Where_True {m : nat} {qs_schema : RawQueryStructureSchema} {ResultT} (schemaIdx : Fin.t _) (body : @RawTuple _ -> Comp (list ResultT)) (attrIdx : Fin.t _) (a : Vector.t Type m) (a_proj_index : Vector.nth (AttrList (GetNRelSchemaHeading (qschemaSchemas qs_schema) schemaIdx)) attrIdx -> Fin.t m) (a_proj : forall (attr : Vector.nth _ attrIdx), a[@a_proj_index attr]) (a_inj : forall idx, Vector.nth a idx -> Vector.nth (AttrList (GetNRelSchemaHeading (qschemaSchemas qs_schema) schemaIdx)) attrIdx) (r_o : UnConstrQueryStructure qs_schema) (r_n : UnConstrQueryStructure qs_schema * UnConstrQueryStructure (DecomposeRawQueryStructureSchema qs_schema schemaIdx attrIdx a)) idx : DecomposeRawQueryStructureSchema_AbsR schemaIdx attrIdx a a_proj_index a_proj a_inj r_o r_n -> refine (UnConstrQuery_In r_o schemaIdx (fun tup => Where (a_proj_index (GetAttributeRaw tup attrIdx) = idx) (body tup))) (UnConstrQuery_In (snd r_n) idx (fun tup => body (Tuple_DecomposeRawQueryStructure_inj' _ _ _ a_inj _ tup))).
proof: Proof. etransitivity. apply refine_UnConstrQuery_In; intro. apply refine_Query_Where_Cond with (Q := (a_proj_index (GetAttributeRaw a0 attrIdx) = idx) /\ True); intuition. setoid_rewrite refine_QueryIn_Where; eauto. apply refine_UnConstrQuery_In; intro. apply refine_Query_Where_True_Cond; eauto. Qed.
imports: Fiat.Common.Coq__8_4__8_5__Compat Coq.Vectors.Vector Coq.Strings.Ascii Coq.Bool.Bool Coq.Lists.List Fiat.Common.SumType Fiat.Computation.ListComputations Fiat.QueryStructure.Automation.AutoDB Bedrock.Word Bedrock.Memory