J. A. Carr 8 July 2025.
The untruncated form of the at-most-two elements is equivalent
to the statement that Aut Ξ© has exactly 1 or 2 elements
(and hence every element is either identity or negation)
\begin{code}
{-# OPTIONS --safe --without-K #-}
open import MLTT.Spartan
open import MLTT.Plus-Properties
open import UF.DiscreteAndSeparated
open import TypeTopology.SigmaDiscreteAndTotallySeparated
open import UF.Equiv hiding (_β
_)
open import UF.FunExt
open import UF.Logic
open import UF.PropTrunc
open import UF.Subsingletons
open import UF.SubtypeClassifier hiding (Ξ©)
open import Fin.Type
open import Fin.Topology
open import Fin.Pigeonhole
module Higgs.UntruncatedAtMostTwo
{π€ : Universe}
(fe : Fun-Ext)
(pe : propext π€)
(pt : propositional-truncations-exist)
where
open import Higgs.Rigidity fe pe
open import Higgs.InvolutionTheorem fe pe
open import Higgs.AutomorphismsOfOmega fe pe
open import Higgs.AutomorphismsOfOmegaWEM fe pe pt
open Conjunction
open Implication fe
open Universal fe
\end{code}
Assuming function extensionality, having an untruncated pigeonhole principle
reflects discreteness to the codomain.
The core method is to note that the pidgeonhole function must respect equality
of functions, so we produce a pair of functions, where equality of their results
holds if and only if the two elements of the codomain are equal.
\begin{code}
constantly : {π€ π₯ : Universe}
β {X : π€ Μ } {Y : π₯ Μ }
β Y β X β Y
constantly y _ = y
almost-constantly-inner : {π€ π₯ : Universe}
β {X : π€ Μ } {Y : π₯ Μ }
β (x' : X) β Y β Y β (x : X)
β ((x' οΌ x) + (x' β x))
β Y
almost-constantly-inner _ y' y _ (inl _) = y'
almost-constantly-inner _ y' y _ (inr _) = y
almost-constantly : {π€ π₯ : Universe}
β {X : π€ Μ } {Y : π₯ Μ }
β is-discrete X
β X β Y β Y β X
β Y
almost-constantly X-discrete x' y' y x =
almost-constantly-inner x' y' y x (X-discrete x' x)
almost-constantly-eq : {π€ π₯ : Universe}
β {X : π€ Μ } {Y : π₯ Μ }
β (X-discrete : is-discrete X)
β (x : X)
β (y' y : Y)
β almost-constantly X-discrete x y' y x οΌ y'
almost-constantly-eq X-discrete x y' y =
almost-constantly X-discrete x y' y x οΌβ¨reflβ©
almost-constantly-inner x y' y x (X-discrete x x) οΌβ¨ I β©
almost-constantly-inner x y' y x (inl refl) οΌβ¨reflβ©
y' β
where
I : almost-constantly-inner x y' y x (X-discrete x x)
οΌ almost-constantly-inner x y' y x (inl refl)
I = ap (almost-constantly-inner x y' y x)
(discrete-inl-refl X-discrete x)
almost-constantly-neq : {π€ π₯ : Universe}
β {X : π€ Μ } {Y : π₯ Μ }
β (X-discrete : is-discrete X)
β (x' x : X)
β (y' y : Y)
β (x' β x)
β almost-constantly X-discrete x' y' y x οΌ y
almost-constantly-neq X-discrete x' x y' y Ξ½ =
almost-constantly X-discrete x' y' y x οΌβ¨reflβ©
almost-constantly-inner x' y' y x (X-discrete x' x) οΌβ¨ I β©
almost-constantly-inner x' y' y x (inr Ξ½) οΌβ¨reflβ©
y β
where
I : almost-constantly-inner x' y' y x (X-discrete x' x)
οΌ almost-constantly-inner x' y' y x (inr Ξ½)
I = ap (almost-constantly-inner x' y' y x)
(discrete-inr fe X-discrete x' x Ξ½)
almost-constantly-is-constant
: {π€ π₯ : Universe}
β {X : π€ Μ } {Y : π₯ Μ }
β (X-discrete : is-discrete X)
β (x' : X)
β (y y' : Y)
β y οΌ y'
β constantly y οΌ almost-constantly X-discrete x' y' y
almost-constantly-is-constant {_} {_} {X} {Y} X-discrete x' y _ refl = dfunext fe III
where
I : constantly y x' οΌ y
I = refl
II : (x : X)
β ((x' οΌ x) + (x' β x))
β almost-constantly X-discrete x' y y x οΌ y
II _ (inl refl) = almost-constantly-eq X-discrete x' y y
II x (inr Ξ½) = almost-constantly-neq X-discrete x' x y y Ξ½
III : (x : X) β constantly y x' οΌ almost-constantly X-discrete x' y y x
III x = I β II x (X-discrete x' x) β»ΒΉ
at-most-discrete-gives-discrete
: {π€ π₯ : Universe}
β (X : π€ Μ) (Y : π₯ Μ)
β is-discrete X
β ((f : X β Y) β f has-a-repetition)
β is-discrete Y
at-most-discrete-gives-discrete X Y X-discrete f-ph y y' = V VI
where
repeat-indices : (X β Y)
β X Γ X
repeat-indices f =
(Ξ» (x , x' , _) β (x , x'))
(f-ph f)
repeat-is-repeat : (f : X β Y)
β let (x , x') = repeat-indices f
in f x οΌ f x'
repeat-is-repeat f =
let (x , x' , _ , pf) = f-ph f
in pf
repeat-distinct : (f : X β Y)
β let (x , x') = repeat-indices f
in x β x'
repeat-distinct f =
let (x , x' , pf , _) = f-ph f
in pf
fβ = constantly y
ixβ = repeat-indices fβ
fβ = almost-constantly X-discrete (prβ ixβ) y' y
ixβ = repeat-indices fβ
I : y οΌ y' β ixβ οΌ ixβ
I e = ap repeat-indices
(almost-constantly-is-constant X-discrete (prβ ixβ) y y' e)
II : (x : X)
β (prβ ixβ β x)
β y οΌ fβ x
II x ne = almost-constantly-neq X-discrete (prβ ixβ) x y' y ne β»ΒΉ
III : fβ (prβ ixβ) οΌ y'
III = almost-constantly-eq X-discrete (prβ ixβ) y' y
IV : ixβ οΌ ixβ β y οΌ y'
IV e =
y οΌβ¨ II (prβ ixβ) (repeat-distinct fβ) β©
fβ (prβ ixβ) οΌβ¨ ap (fβ β prβ) e β©
fβ (prβ ixβ) οΌβ¨reflβ©
fβ (prβ (repeat-indices fβ)) οΌβ¨ repeat-is-repeat fβ β»ΒΉ β©
fβ (prβ (repeat-indices fβ)) οΌβ¨reflβ©
fβ (prβ ixβ) οΌβ¨ ap (fβ β prβ) (e β»ΒΉ) β©
fβ (prβ ixβ) οΌβ¨ III β©
y' β
V : is-decidable (ixβ οΌ ixβ) β is-decidable (y οΌ y')
V (inl e) = inl (IV e)
V (inr ne) = inr (ne β I)
VI : is-decidable (ixβ οΌ ixβ)
VI = Γ-is-discrete X-discrete X-discrete ixβ ixβ
\end{code}
We may write the untruncated form of the at-most-2 lemma in this form
\begin{code}
at-most-two-is-pigeonhole
: {π€ : Universe}
β {X : π€ Μ}
β ((x y z : X) β (z οΌ x) + (x οΌ y) + (y οΌ z))
β (f : Fin 3 β X)
β f has-a-repetition
at-most-two-is-pigeonhole at-most-2 f = II I
where
v1 v2 v3 : Fin 3
v1 = inr β
v2 = inl (inr β)
v3 = inl (inl (inr β))
true-when-eq : Fin 3
β Fin 3
β π€ βΊ Μ
true-when-eq (inl (inl _)) (inl (inl _)) = π
true-when-eq (inl (inl _)) (inl (inr _)) = π
true-when-eq (inl (inl _)) (inr _) = π
true-when-eq (inl (inr _)) (inl (inl _)) = π
true-when-eq (inl (inr _)) (inl (inr _)) = π
true-when-eq (inl (inr _)) (inr _) = π
true-when-eq (inr _) (inl (inl _)) = π
true-when-eq (inr _) (inl (inr _)) = π
true-when-eq (inr _) (inr _) = π
v3-not-1 : v3 β v1
v3-not-1 e = π-elim (transport (true-when-eq v3) e β)
v1-not-2 : v1 β v2
v1-not-2 e = π-elim (transport (true-when-eq v1) e β)
v2-not-3 : v2 β v3
v2-not-3 e = π-elim (transport (true-when-eq v2) e β)
I : (f v3 οΌ f v1) + (f v1 οΌ f v2) + (f v2 οΌ f v3)
I = at-most-2 (f v1) (f v2) (f v3)
II : (f v3 οΌ f v1) + (f v1 οΌ f v2) + (f v2 οΌ f v3)
β f has-a-repetition
II (inl e31) = ( v3 , v1 , v3-not-1 , e31 )
II (inr (inl e12)) = ( v1 , v2 , v1-not-2 , e12 )
II (inr (inr e23)) = ( v2 , v3 , v2-not-3 , e23 )
aut-Ξ©-discrete-has-em
: is-discrete (Aut Ξ©)
β (π : Aut Ξ©)
β (π οΌ ππ) + (π β ππ)
aut-Ξ©-discrete-has-em aut-disc π = aut-disc π ππ
untruncated-at-most-two-iff-em
: ((f g h : Aut Ξ©) β (h οΌ f) + (f οΌ g) + (g οΌ h))
β ((π : Aut Ξ©) β (π οΌ ππ) + (π β ππ))
untruncated-at-most-two-iff-em = (FW , BW)
where
FW : ((f g h : Aut Ξ©) β (h οΌ f) + (f οΌ g) + (g οΌ h))
β ((π : Aut Ξ©) β (π οΌ ππ) + (π β ππ))
FW at-most-two = aut-Ξ©-discrete-has-em
(at-most-discrete-gives-discrete
(Fin 3) (Aut Ξ©)
Fin-is-discrete
(at-most-two-is-pigeonhole at-most-two))
I : {f g : Aut Ξ©}
β (f β ππ)
β (g β ππ)
β (f οΌ g)
I {f} f-not g-not = ((not-id-is-not f-not em) β (not-id-is-not g-not em) β»ΒΉ)
where
em = Ξ©-automorphism-distinct-from-ππ-gives-EM (f , f-not)
II : {f g h : Aut Ξ©}
β ((f οΌ ππ) + (f β ππ))
β ((g οΌ ππ) + (g β ππ))
β ((h οΌ ππ) + (h β ππ))
β (h οΌ f) + (f οΌ g) + (g οΌ h)
II (inl ef) (inl eg) (_ ) = inr (inl (ef β eg β»ΒΉ))
II (inl _ ) (inr neg) (inr neh) = inr (inr (I neg neh))
II (inl ef) (inr neg) (inl eh) = inl (eh β ef β»ΒΉ)
II (inr _ ) (inl eg) (inl eh) = inr (inr (eg β eh β»ΒΉ))
II (inr nef) (inr neg) (_ ) = inr (inl (I nef neg))
II (inr nef) (inl _ ) (inr neh) = inl (I neh nef)
BW : ((π : Aut Ξ©) β (π οΌ ππ) + (π β ππ))
β ((f g h : Aut Ξ©) β (h οΌ f) + (f οΌ g) + (g οΌ h))
BW em f g h = II (em f) (em g) (em h)
\end{code}