Examples.Demos.ContraX¶
Inconsistency in first formalization attempt¶
This is the Examples.Demos.ContraX module of the Agda Universal Algebra Library.
A cautionary counterexample kept from an early formalization attempt. It is tempting to posit a surjection from an arbitrary context type onto every algebra's domain; this module shows the global form of that assumption is inconsistent, so any such surjection must be a hypothesis about a suitably chosen context, never a theorem about all of them.
_β _ packages a setoid function from setoid X into the algebra's domain together
with a proof that it is surjective. myA is the one-point setoid with the trivial
equality, and myAlg an algebra on it whose interpretation Agda infers, the
codomain being a one-point setoid. contradiction refutes β X π¨ β X β π¨:
instantiating at the empty type and myAlg, the assumed surjection must witness
the point in its image, and that witness is an element of β₯.
_β _ : Set β Algebra {π = π} 0β 0β β _ X β π¨ = Ξ£[ h β (setoid X βΆ π»[ π¨ ])] IsSurjective h myA : Setoid 0β 0β myA = record { Carrier = β€ ; _β_ = Ξ» x xβ β β€ ; isEquivalence = record { refl = tt ; sym = Ξ» _ β tt ; trans = Ξ» _ _ β tt } } myAlg : Algebra {π = π} _ _ myAlg = record { Domain = myA ; Interp = _ } contradiction : (β X π¨ β X β π¨) β β₯ contradiction h1 = ex falso where h : Ξ£[ h β (setoid β₯ βΆ π»[ myAlg ])] IsSurjective h h = h1 β₯ myAlg falso : Image (projβ h) β tt falso = (projβ h) ex : Image (projβ h) β tt β β₯ ex (Image_β_.eq a x) = a