  We generalize our analysis in [arXiv:1301.1977], and show that a 5d and 6d
AGT correspondence for SU(N) -- which essentially relates the relevant 5d and
6d Nekrasov instanton partition functions to the integrable representations of
a q-deformed and elliptic affine W_N-algebra -- can be derived, purely
physically, from the principle that the spacetime BPS spectra of string-dual
M-theory compactifications ought to be equivalent. Via an appropriate defect,
we also derive a "fully-ramified" version of the 5d and 6d AGT correspondence
where integrable representations of a quantum and elliptic affine SU(N)-algebra
at the critical level appear on the 2d side, and argue that the relevant
"fully-ramified" 5d and 6d Nekrasov instanton partition functions are
simultaneous eigenfunctions of commuting operators which define relativistic
and elliptized integrable systems. As an offshoot, we also obtain various
mathematically novel and interesting relations involving the double loop
algebra of SU(N), elliptic Macdonald operators, equivariant elliptic genus of
instanton moduli space, and more.
