  We construct two distinct yet related M-theory models that provide suitable
frameworks for the study of knot invariants. We then focus on the
four-dimensional gauge theory that follows from appropriately compactifying one
of these M-theory models. We show that this theory has indeed all required
properties to host knots. Our analysis provides a unifying picture of the
various recent works that attempt an understanding of knot invariants using
techniques of four-dimensional physics.
  This is a companion paper to arXiv:1608.05128, covering all but section 3.3.
It presents a detailed mathematical derivation of the main results there, as
well as additional material. Among the new insights, those related to
supersymmetry and the topological twist are highlighted. This paper offers an
alternative, complementary formulation of the contents
in~\cite{Dasgupta:2016rhc}, but is self-contained and can be read
independently.
