In a formula of the form ~ for all x, for all y (l(x,y) -> r(x,y)) how do we apply negation to the formula "(l(x,y) -> r(x,y))" ? And similarly if we have a formula with different quantifiers, such as, ~ for all x, there is a y (l(x,y) and r(x,y)).
I think you are asking about this sentence: ~(∀x)(∀y)(Ixy → Rxy)
I think you are asking which sentence, logically equivalent to that one, includes ~(Ixy → Rxy). The answer is (∃x)(∃y)~(Ixy → Rxy).
As we move the quantifier in past the (∀x), it becomes (∃x). That is because, to take a simpler example, “~(∀x)Px” means “not everything is P,” while “(∃x)~Px” means that “something is not P,” which amounts to the same thing.
So, equally logically equivalent is the intermediate sentence (∃x)~(∀y)(Ixy → Rxy). Move the negation inward once more and you get (∃x)(∃y)~(Ixy → Rxy).
For your second example, ~(∀x)(∃y)(Ixy & Rxy) is logically equivalent to (∃x)(∀y)~(Ixy & Rxy).
Switching both quantifiers, applying the definition of implication (the conjunctive form), and removing all resulting double negations, you can obtain:
(1) There exists x such that there exists y such that L(x,y) and ~R(x,y).
(2) There exists x such that for all y, L(x,y) => ~R(x,y).
For the first case, read this and this. The first link treats general quantification (or variation as Russell calls) and existential, and how you can apply rules of symbolism with it. The second link explains the philosophy, or the interpretation, behind the symbolism, which helps you understand what you can and can't do, regarding rules of inference. I.e, the texts contain everything to solve the guy's question, and still give him a general understanding of what he is doing.
For the second case, just consider as being . I.e, consider .