relateByLUB s (idX, _) (idY, _) (_, _) =
  if idX == idY
    then throw UnifyGradedLinear{ errLoc = s, errLinearOrGraded = idX }
    else error $ "Internal bug: " <> pretty idX <> " does not match " <> pretty idY
relateByLUB s (idX, _) (idY, _) (_, _) =
  if idX == idY
    then throw UnifyGradedLinear{ errLoc = s, errLinearOrGraded = idX }
    else error $ "Internal bug: " <> pretty idX <> " does not match " <> pretty idY
relateByLUB s (idX, _) (idY, _) (_, _) =
  if idX == idY
    then throw UnifyGradedLinear{ errLoc = s, errLinearOrGraded = idX }
    else error $ "Internal bug: " <> pretty idX <> " does not match " <> pretty idY