have insert_comm_proj : ∀ X f, projection (insert f X) = projection {f} ∪ projection X :=
  by
  intro X f
  unfold projection
  simp
f : Formula
S : Finset Formula
f_not_in_S : f ∉ S
IH : lengthOfSet (projection S) ≤ lengthOfSet S
⊢ (let X := projection (insert f S);
    X.sum lengthOfFormula) ≤
    lengthOfFormula f + ∑ x ∈ S, lengthOfFormula x
f : Formula
S : Finset Formula
f_not_in_S : f ∉ S
IH : lengthOfSet (projection S) ≤ lengthOfSet S
insert_comm_proj : ∀ (X : Finset Formula) (f : Formula), projection (insert f X) = projection {f} ∪ projection X
⊢ (let X := projection (insert f S);
    X.sum lengthOfFormula) ≤
    lengthOfFormula f + ∑ x ∈ S, lengthOfFormula x