fact: Fixpoint insert' {A: Type} (c: A -> A -> A) (i: key) (x: A) (m: ptrie A): ptrie A := match m with | Empty => Leaf i x | Leaf j v => if eqb i j then Leaf i (c x v) else join i (Leaf i x) j (Leaf j v) | Branch prefix brbit l r => if match_prefix i prefix brbit then if zerobit i brbit then Branch prefix brbit (insert' c i x l) r else Branch prefix brbit l (insert' c i x r) else join i (Leaf i x) prefix (Branch prefix brbit l r) end.
imports: List Bool ZArith Lia