proposition: Lemma TrieOK_subtrie_remove : forall b m l key' k subtrie, TrieOK (Node b m) l -> bst m -> InA (PX.eqke (elt:=Trie)) (k, subtrie) (elements (remove key' m)) -> TrieOK subtrie (l ++ [k]).
proof: Proof. intros. inversion H; subst; intros; eapply H8. assert (bst (remove key' (XMap.this {| XMap.this := m; XMap.is_bst := H0 |}))). apply remove_bst; eauto. rewrite <- (@elements_mapsto_iff _ (XMap.Bst H2)) in H1. simpl in H1; unfold XMap.MapsTo in H1; simpl in H1. eapply remove_3; eauto. Qed.
imports: Fiat.Common.Coq__8_4__8_5__Compat Fiat.QueryStructure.Implementation.DataStructures.Bags.BagsInterface Fiat.QueryStructure.Implementation.DataStructures.Bags.BagsProperties Coq.FSets.FMapInterface Coq.FSets.FMapFacts Coq.FSets.FMapAVL Coq.ZArith.ZArith Fiat.Common Fiat.Common.List.ListFacts Fiat.Common.List.FlattenList Fiat.Common.SetEqProperties Fiat.Common.FMapExtensions Fiat.Common.List.PermutationFacts Fiat.QueryStructure.Specification.SearchTerms.ListPrefix