proposition: Theorem prime_factor n : 2 <= n -> { p | prime p /\ p <d n }.
proof: Proof. induction on n as IHn with measure n; intro Hn. destruct (prime_or_div Hn) as [ (q & H1 & H2) | H1 ]. 2: exists n; auto. destruct (IHn q) as (p & H3 & H4); try lia. exists p; split; auto. now apply divides_trans with (1 := H4). Qed.
imports: List Arith Lia Bool Permutation Undecidability.Shared.Libs.DLW.Utils(utils_tac utils_list utils_nat gcd sums)