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}ย