Rule to Cancel Membership After Certain Number of Events Attended
I think the trigger should be 'participant changed' as you want to test this everyone time someone attends an event. 

The first condition would be something like 'participant status changed to registered'.

I am not sure if you can combine membership conditions with a participant trigger, so checking the membership type would be weird (the data is not there when dealing with a participant of an event). But you could put all members in a group and then check if the participant is a member of that group.

The third condition would be to count if it is the fifth, I do not think there is a ready made condition for that, so it would have to be developed (probably about 4 hrs work).

The first action would be to send an email (you will need to install the Email API extension to do this: https://civicrm.org/extensions/e-mail-api).

The second action would be to cancel the membership. At the moment there is no action to do this, so that would need to be developed (approx. 4 hrs work).

I would recommend extensive testing too :-) CiviRules is powerful but also allows you to automatically send lots of emails. 

Good luck!