proposition: Lemma legnth_flat_map {X Y: Type} {f: X -> list Y} {l: list X} {n: nat}: (forall x, length (f x) <= n) -> length (flat_map f l) <= n * length l.
proof: Proof. move=> Hf. elim: l. - move=> * /=. by lia. - move=> x l IH /=. rewrite app_length. have := Hf x. by lia. Qed.
imports: PeanoNat List Lia Undecidability.StackMachines.Util.Nat_facts ssreflect ssrbool ssrfun