Imports
Completeness of the 3-CNF-SAT to SUBSET-SUM reduction
namespace CLRS.Chapter34.SubsetSumReductionA satisfying assignment selects one variable item and enough slack items in every clause to reach the packed target.
theorem cnfToSubsetSum_complete {formula : CNF}
(hthree : IsThreeCNF formula) :
CnfSatisfiable formula → (cnfToSubsetSum formula).HasSubsetSum := by
rintro ⟨assignment, heval⟩
refine ⟨assignmentItems formula assignment,
assignmentItems_subset formula assignment, ?_⟩
exact sum_assignmentItems_eq_target hthree hevalend CLRS.Chapter34.SubsetSumReduction