/-- Independent sets are exactly the complements of vertex covers.
Hint: unfold the definitions. `G.IsIndepSet s` says any two distinct vertices of `s` are
non-adjacent; `G.IsVertexCover c` says every edge has an endpoint in `c`. For `→`, argue by
contradiction; `hadj.ne` gives `v ≠ w` from `hadj : G.Adj v w`. -/
theorem indepSet_iff_vertexCover_compl {V : Type*} (G : SimpleGraph V) (s : Set V) :
G.IsIndepSet s ↔ G.IsVertexCover sᶜ := by
sorryShow the compiled solution
/-- **Independent sets and vertex covers are complements.** `s` contains no edge if and only if
every edge has an endpoint outside `s`. -/
theorem indepSet_iff_vertexCover_compl {V : Type*} (G : SimpleGraph V) (s : Set V) :
G.IsIndepSet s ↔ G.IsVertexCover sᶜ := by
constructor
· intro hs v w hadj
by_contra h
simp only [Set.mem_compl_iff, not_or, not_not] at h
exact hs h.1 h.2 hadj.ne hadj
· intro hc v hv w hw _ hadj
rcases hc hadj with h | h
· exact h hv
· exact h hwAxioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ComplexityTheory.leanTry it in the Lean web editor