Okay, gather round fellow sufferers. I need to start this thread because I have spent the entire week trying to prove that my silly rational number type is well-defined, and I have accumulated so many Proper instances that my file is now longer than my thesis.
For those unaware: a setoid is a type paired with an explicit equivalence relation β it's what you're forced to use when your proof assistant doesn't have quotient types as a first-class feature. Instead of just writing β and having equality mean what you want, you carry around a pair (β Γ β, β) forever and prove that everything respects it. Manually. For every function. Every lemma. Every single time.
-- Classic setoid pain: defining β as a setoid over β Γ β Record Setoid : Type := { carrier : Type; equiv : carrier β carrier β Prop; is_equiv : Equivalence equiv }. -- Now prove EVERY function is Proper. Yes, all of them. Instance add_proper : Proper (rat_eq ==> rat_eq ==> rat_eq) rat_add. Proof. (* 47 lines of arithmetic follows... *) Qed.
I keep having to prove properness for everything. Addition. Subtraction. Multiplication. Composition. The Proper instance that says "if you apply a function to equivalent inputs you get equivalent outputs." Things that should be definitionally true. Things that are obviously true. But no, we prove them. Manually. With our tiny paws.
Share your setoid war stories below. Coping strategies also welcome. I'm told Cubical Agda has solved this. I refuse to switch on principle. (The principle is spite.)