There are two infractions here: DEC and LEC.
From IPG, 1.3 Applying Penalties:
Separate infractions committed or discovered at the same time are treated as separate penalties, though if the root cause is the same, only the more severe one is applied.So you apply the penalty for DEC (since it's been downgraded the penalty is actually the same here), but you still have two infractions at hand and you apply the relevant fix to both of them.
DEC -> dredge card back in the graveyard
LEC -> shuffle the illegally revealed cards into the library (taking into account globally known parts of the library itself - due to some
Terminus or whatever)