Skip to content

Lifting.AnAlgebraWhichIsNotAlwaysFree-blackboard

Martin Escardo, 7-8 November 2025, with revisions and additions to
the discussion 16, 20 and 24 November 2025.

----------------------------------------------------------------------------------
**Notice** This file is almost superseded by Lifting.AnAlgebraWhichIsNotAlwaysFree,
which has a stronger result with a simpler proof.

It is still interesting because (1) it has additional information, and
(2) it illustrates how we use TypeTopology as a blackboard to think
about mathematical ideas and develop them.
-----------------------------------------------------------------------------------

It is well known that in a boolean elementary (1-)topos, every algebra
of the lifting (aka partial-map classifier) monad is free, and the
proof is easy [1] [2].

We show that not all algebras are free in an arbitrary elementary topos.

Two examples where the failure occurs are Johnstone's Topological
Topos and Hyland's Effective Topos. More generally, we show that this
is the case in any topos in which the negation of the principle of
excluded middle holds.

The object Ξ© of truth values is an algebra in (at least) two ways,
with structure map ⨆ = βˆƒ and ⨆ = βˆ€.

In all toposes, the structure map ⨆ = βˆƒ exhibits Ξ© as freely generated
by ⊀ : Ω.

In a boolean topos, the structure map ⨆ = βˆ€ exhibits Ξ© as freely
generated by βŠ₯ : Ξ©.

Moreover, the converse is true. If the structure map ⨆ = βˆ€ exhibits Ξ©
as freely generated by βŠ₯ : Ξ©, then the topos is boolean.

We may wonder whether, in an arbitrary topos, the object Ξ© with the
structure map ⨆ = βˆ€ is freely generated by *any* object G of
generators.

We show that if this is the case, then

 1. G is a non-empty subsingleton/proposition/truth value,
 2. the insertion of generators ΞΉ : G β†’ Ξ© is constantly βŠ₯,
 3. the double negation of the principle of excluded middle holds, and, moreover,
 4. G ≃ (principle of excluded middle).

The proof uses Higgs Involution Theorem.

TODO. But in principle it may still be the case that if Ξ© equipped
with βˆ€ is freely generated by a set of generators G, then the
principle of excluded middle holds, in which case (3) above reduces to
G ≃ πŸ™. We leave this as an open problem. (Added 24th November 2025. We
answer the question positively, with a simpler proof, which in
particular doesn't rely on Higgs Involution Theorem.)

Discussion added 16 November 2025.

Jon Sterling [1] previously conjectured that the same is the case for
the lifting monad in the category of dcpos [3], namely that there are some
toposes in which there is an algebra of the lifting monad in the
category of dcpos which is not free.

We haven't (yet) formalized this here, but we offer an argument to
prove Sterling's conjecture, based on the above claims (which are
formalized below).

Anders Kock [2] proved that any algebra in the category of sets is
bounded-complete (every upper bounded set has a least upper bound).

Because the lifting algebra Ξ© with structure map βˆ€ has a largest
element, namely βŠ₯, it is a sup-lattice, and, in particular, directed
complete.

Regarding continuity, the structure map is always supremum (after
Kock), and suprema formation always preserve suprema, including
directed ones.

Hence the answer for the category of sets also gives an answer for the
category of dcpos in any elementary topos.

So the above discussion settles Sterling's conjecture positively, by
providing an example of a dcpo lifting algebra which is not always
free.

TODO. It would be good to formalize this in TypeTopology.

It is also worth citing Kock's paper [3], which in particular shows
that, in the category of posets, structure maps are adjoint to units
of the monad, and hence are unique when they exist. What happens here
is that Ξ© has at least two structure maps (namely βˆƒ and βˆ€) and hence
two different orders according to [2]. In particular, Ξ© is a dcpo in
two different ways, each one with a unique structure map making it
into an algebra, both in the category of sets and in the category of
dcpos.

[1] Jon Sterling. Tensorial structure of the lifting doctrine in
    constructive domain theory. Originally 28 Dec 2023, last revised 30
    Jan 2025. https://doi.org/10.48550/arXiv.2312.17023

[2] Anders Kock. Algebras for the partial-map classifier monad. In:
    Carboni, A., Pedicchio, M.C., Rosolini, G. (eds) Category
    Theory. LNM, vol 1488.
    https://doi.org/10.1007/BFb0084225
    https://tildeweb.au.dk/au76680/jonna5.pdf

[3] Anders Kock. The constructive lift monad.
    BRICS Report Series (Aarhus), ISSN 0909-0878 (1995)
    http://tildeweb.au.dk/au76680/CLM.pdf


{-# OPTIONS --safe --without-K #-}

open import MLTT.Spartan
open import UF.FunExt
open import UF.Subsingletons


We work with an arbitrary universe 𝓣, and assume function
extensionality and propositional extensionality, which are available
in any 1-topos.


module Lifting.AnAlgebraWhichIsNotAlwaysFree-blackboard
        (𝓣 : Universe)
        (fe : Fun-Ext)
        (pe : Prop-Ext)
       where

private
 fe' : FunExt
 fe' 𝓀 π“₯ = fe {𝓀} {π“₯}

 𝓣⁺ = 𝓣 ⁺

open import Higgs.InvolutionTheorem hiding (Ξ©)
open import Lifting.Algebras 𝓣
open import Lifting.Construction 𝓣
open import Lifting.EmbeddingDirectly 𝓣
open import Lifting.Identity 𝓣
open import Lifting.TwoAlgebrasOnOmega 𝓣 fe pe renaming (Ξ -alg-on-Ξ© to Ξ©βˆ€)
open import UF.ClassicalLogic
open import UF.DiscreteAndSeparated
open import UF.Embeddings
open import UF.Equiv
open import UF.Logic
open import UF.Sets
open import UF.Subsingletons-FunExt
open import UF.SubtypeClassifier renaming (Ξ© to Ξ©-of-universe ;
                                           βŠ₯ to βŠ₯Ξ© ;
                                           ⊀ to ⊀Ω)
open import UF.SubtypeClassifier-Properties

open Implication fe renaming (Β¬β‚š_ to ⇁_ ; Β¬Β¬β‚š_ to ⇁⇁_)
open Universal fe

private
 Ξ© : 𝓣⁺ Μ‡
 Ξ© = Ξ©-of-universe 𝓣


We work with a hypothetical set G of generators, and an inclusion of
generators ΞΉ, which will, by assumption, exhibit Ξ© with the structure
map ⨆ = βˆ€ as a free algebra.


module main-results
        (G : 𝓣 Μ‡ )
        (G-is-set : is-set G)
        (ΞΉ : G β†’ Ξ©)
       where


To achieve our objectives stated above, we will soon assume that
Ξ© equipped with the structure map βˆ€ is indeed freely generated by G
with insertion of generators ΞΉ, which implies that h is an
equivalence. But we can prove a few things before we assume that.

We have the algebra 𝓛 G freely generated by G, with insertion of
generators Ξ· : G β†’ 𝓛 G, and in particular a unique algebra
homomorphism h : 𝓛 G β†’ Ξ© extending ΞΉ along Ξ·.

       Ξ·
  G ───────→ 𝓛 G
   β•²          β”‚
    β•²         β”‚
     β•²        β”‚
    ΞΉ β•²    h  β”‚
       β•²      β”‚
        β•²     β”‚
         β•²    β”‚
          β•²   ↓
           ➘  Ω.


 open free-algebras-in-the-category-of-sets pe fe G G-is-set

 h : 𝓛 G β†’ Ξ©
 h = 𝓛-extension (Ξ©-is-set fe pe) Ξ©βˆ€ ΞΉ

 h-explicitly : h ∼ Ξ» (P , Ο† , i) β†’ β±― a κž‰ P , ΞΉ (Ο† a)
 h-explicitly _ = refl

 𝓛G : 𝓛-alg (𝓛 G)
 𝓛G = canonical-free-algebra

 h-is-hom : is-hom 𝓛G Ξ©βˆ€ h
 h-is-hom = 𝓛-extension-is-hom (Ξ©-is-set fe pe) Ξ©βˆ€ ΞΉ

 h-extends-ι : h ∘ η ∼ ι
 h-extends-ΞΉ = 𝓛-extension-extends (Ξ©-is-set fe pe) Ξ©βˆ€ ΞΉ


We already know the following, but here is a simpler proof.


 every-element-of-𝓛-is-a-join : (l@(P , Ο† , i) : 𝓛 G) β†’ l = ⨆ i (Ξ» (_ : P) β†’ l)
 every-element-of-𝓛-is-a-join l@(P , Ο† , i) =
  from-⋍ pe fe fe
   (((Ξ» (a : P) β†’ (a , a)) , pr₁) , Ξ» (_ : P) β†’ refl)


In order to reach our conclusions, we need to know a convenient
definition of h.


 useful-characterization-of-h : (l@(P , Ο† , i) : 𝓛 G)
                              β†’ h l = ((P , i) β‡’ (β±― p κž‰ P , ΞΉ (Ο† p)))
 useful-characterization-of-h l@(P , Ο† , i) =
  h l                           =⟨ ap h (every-element-of-𝓛-is-a-join l) ⟩
  h (⨆ i (Ξ» _ β†’ l))            =⟨ h-is-hom P i (Ξ» _ β†’ l) ⟩
  (P , i) β‡’ (β±― p κž‰ P , ΞΉ (Ο† p)) ∎


With this we easily conclude that h maps βŠ₯ to ⊀.


 h-at-βŠ₯-is-⊀ : h βŠ₯ = ⊀Ω
 h-at-βŠ₯-is-⊀ =
  h βŠ₯                                  =⟨ useful-characterization-of-h βŠ₯ ⟩
  βŠ₯Ξ© β‡’ (β±― q κž‰ 𝟘 , ΞΉ (unique-from-𝟘 q)) =⟨ I ⟩
  ⊀Ω                                   ∎
   where
    I = βŠ₯β‡’anything-is-⊀ pe (β±― q κž‰ 𝟘 , ΞΉ (unique-from-𝟘 q))


Notice that we didn't need to assume that Ξ© equipped with the
structure map βˆ€ is freely generated in order to conclude the above.

Now we assume, for the sake of eventually concluding that the double
negation of the principle of excluded middle holds, that Ξ© equipped
with the structure map βˆ€ is freely generated by G with insertion of
generators ΞΉ.


 module assumption
         (Ξ©βˆ€-is-free : is-free-𝓛-alg Ξ©βˆ€ G ΞΉ)
        where


All we need to reach our desired conclusions is that the map h is an
equivalence, and so our assumption is slightly stronger than needed.

To show that h is an equivalence from this assumption, consider the
diagram below, where 𝓛 G is freely generated by G with insertion of
generators Ξ·, and Ξ© is freely generated by G with insertion of
generators ΞΉ. So the conclusion is a standard categorical argument.

       Ξ·
  G ───────→ 𝓛 G
   β•²         β”‚ ↑
    β•²        β”‚ β”‚
     β•²       β”‚ β”‚
    ΞΉ β•²    h β”‚ β”‚ h⁻¹
       β•²     β”‚ β”‚
        β•²    β”‚ β”‚
         β•²   β”‚ β”‚
          β•²  ↓ β”‚
           ➘  Ω.

Both 𝓛 G and Ξ© satisfy the universal property indicated in the above
diagram, with h being the unique homomorphism extending ΞΉ along Ξ·, and
h⁻¹ being the unique homomorphism extending η along ι.


  module E = free-algebra-eliminators
              Ξ©βˆ€ G ΞΉ Ξ©βˆ€-is-free (𝓛-is-set fe fe pe G-is-set)
              𝓛G Ξ·

  h⁻¹ : Ξ© β†’ 𝓛 G
  h⁻¹ = E.unique-hom

  h-is-equiv : is-equiv h
  h-is-equiv = qinvs-are-equivs h (h⁻¹ , III , IV)
   where
    h⁻¹-is-hom : is-hom Ξ©βˆ€ 𝓛G h⁻¹
    h⁻¹-is-hom = E.unique-hom-is-hom

    h⁻¹-extends-η : h⁻¹ ∘ ι ∼ η
    h⁻¹-extends-η = E.unique-hom-is-extension

    I : is-hom 𝓛G 𝓛G (h⁻¹ ∘ h)
    I = ∘-is-hom 𝓛G Ξ©βˆ€ 𝓛G h h⁻¹ h-is-hom h⁻¹-is-hom

    II : is-hom Ξ©βˆ€ Ξ©βˆ€ (h ∘ h⁻¹)
    II = ∘-is-hom Ξ©βˆ€ 𝓛G Ξ©βˆ€ h⁻¹ h h⁻¹-is-hom h-is-hom

    III : h⁻¹ ∘ h ∼ id
    III = at-most-one-extending-hom'
           (h⁻¹ ∘ h , I)
           (id , id-is-hom 𝓛G)
           (Ξ» l β†’ h⁻¹ (h (Ξ· l)) =⟨ ap h⁻¹ (h-extends-ΞΉ l) ⟩
                  h⁻¹ (ι l)     =⟨ h⁻¹-extends-η l ⟩
                  η l           ∎)
           (Ξ» _ β†’ refl)
     where
      open free-algebra-eliminators 𝓛G G Ξ·
           𝓛-is-free (𝓛-is-set fe fe pe G-is-set) 𝓛G Ξ·

    IV : h ∘ h⁻¹ ∼ id
    IV = at-most-one-extending-hom'
          (h ∘ h⁻¹ , II)
          (id , id-is-hom Ξ©βˆ€)
          (Ξ» p β†’ h (h⁻¹ (ΞΉ p)) =⟨ ap h (h⁻¹-extends-Ξ· p) ⟩
                 h (η p)       =⟨ h-extends-ι p ⟩
                 ι p           ∎)
          (Ξ» _ β†’ refl)
     where
      open free-algebra-eliminators
            Ξ©βˆ€ G ΞΉ Ξ©βˆ€-is-free (Ξ©-is-set fe pe) Ξ©βˆ€ ΞΉ

  𝕙 : 𝓛 G ≃ Ξ©
  𝕙 = h , h-is-equiv


Using this, we in turn conclude that our assumed map ΞΉ : G β†’ Ξ© is
constantly βŠ₯.


  ΞΉ-is-constantly-βŠ₯ : (g : G) β†’ ΞΉ g = βŠ₯Ξ©
  ΞΉ-is-constantly-βŠ₯ g = III
   where
    P : 𝓣 Μ‡
    P = ΞΉ g holds

    i : is-prop P
    i = holds-is-prop (ΞΉ g)

    Ο• : P β†’ 𝓛 G
    Ο• _ = Ξ· g

    l : 𝓛 G
    l = (P , (Ξ» (_ : P) β†’ g) , i)

    I = h (⨆ i Ο•)     =⟨ h-is-hom P i Ο• ⟩
        ΞΉ g β‡’ h (Ξ· g) =⟨ ap (ΞΉ g β‡’_) (h-extends-ΞΉ g) ⟩
        ΞΉ g β‡’ ΞΉ g     =⟨ anything-implies-itself-is-⊀ pe (ΞΉ g) ⟩
        ⊀Ω            =⟨ h-at-βŠ₯-is-⊀ ⁻¹ ⟩
        h βŠ₯           ∎

    II = l      =⟨ from-⋍ pe fe fe (((Ξ» p β†’ p , ⋆) , pr₁) , (Ξ» _ β†’ refl)) ⟩
         ⨆ i Ο•  =⟨ equivs-are-lc h h-is-equiv I ⟩
         βŠ₯      ∎

    III : ΞΉ g = βŠ₯Ξ©
    III = to-Ω-= fe (ap is-defined II)


And from this we conclude that the set G has at most one element.


  G-is-prop : is-prop G
  G-is-prop gβ‚€ g₁ = II
   where
    I = h (Ξ· gβ‚€) =⟨ h-extends-ΞΉ gβ‚€ ⟩
        ΞΉ gβ‚€     =⟨ ΞΉ-is-constantly-βŠ₯ gβ‚€ ⟩
        βŠ₯Ξ©       =⟨ (ΞΉ-is-constantly-βŠ₯ g₁)⁻¹ ⟩
        ΞΉ g₁     =⟨ (h-extends-ΞΉ g₁)⁻¹ ⟩
        h (Ξ· g₁) ∎

    II : gβ‚€ = g₁
    II = embeddings-are-lc Ξ·
          (Ξ·-is-embedding pe fe fe fe)
          (equivs-are-lc h h-is-equiv I)


It would be nice if we could conclude that G is pointed. All we can
conclude so far, however, is that G is nonempty.


  G-is-nonempty : ¬¬ G
  G-is-nonempty u = III
   where
    I : is-prop (𝓛 G)
    I (P , Ο† , i) (Q , ψ , j) = from-⋍ pe fe fe
                                 (((Ξ» p β†’ 𝟘-elim (u (Ο† p))) ,
                                   (Ξ» q β†’ 𝟘-elim (u (ψ q)))) ,
                                  (Ξ» p β†’ 𝟘-elim (u (Ο† p))))

    II : h⁻¹ βŠ₯Ξ© β‰  h⁻¹ ⊀Ω
    II e = βŠ₯-is-not-⊀ (equivs-are-lc h⁻¹ ⌜ 𝕙 ⌝⁻¹-is-equiv e)

    III : 𝟘
    III = II (I (h⁻¹ βŠ₯Ξ©) (h⁻¹ ⊀Ω))


We already have an equivalence h⁻¹ : Ξ© β†’ 𝓛 G, but now we look at
another one, which is in essence the canonical equivalence Ξ© ≃ 𝓛 πŸ™. We
don't know that G ≃ πŸ™, but if we are given a point of G, we do know
this, as we already know that G is a proposition.


  Ξ³ : G β†’ Ξ© ≃ 𝓛 G
  Ξ³ g = qinveq v (u , (Ξ» (_ : Ξ©) β†’ refl) , vu)
   where
    u : 𝓛 G β†’ Ξ©
    u (P , Ο† , i) = (P , i)

    v : Ξ© β†’ 𝓛 G
    v (P , i) = P , (Ξ» _ β†’ g) , i

    vu : v ∘ u ∼ id
    vu (P , Ο† , i) = from-⋍ pe fe fe ((id , id) , (Ξ» p β†’ G-is-prop g (Ο† p)))


Composing Ξ³ with h, we get an automorphism of Ξ©, with the following
explicit description and characterization.


  Ξ΄ : G β†’ Ξ© ≃ Ξ©
  Ξ΄ g = Ξ³ g ● 𝕙

  Ξ΄-explicitly : (g : G) (p : Ξ©) β†’ ⌜ Ξ΄ g ⌝ p = (p β‡’ ΞΉ g)
  Ξ΄-explicitly g p = refl

  Ξ΄-charac : (g : G) β†’ (p : Ξ©) β†’ ⌜ Ξ΄ g ⌝ p = ⇁ p
  Ξ΄-charac g p = transport
                  (Ξ» - β†’ ⌜ Ξ΄ g ⌝ p = (p β‡’ -))
                  (ΞΉ-is-constantly-βŠ₯ g)
                  (Ξ΄-explicitly g p)


That is, the map Ξ΄ g is negation.

We now apply Higgs Involution Theorem to conclude that Ξ΄ g is an
involution, as is any automorphism of Ξ©.


  Ξ΄-involutive : (g : G) β†’ involutive ⌜ Ξ΄ g ⌝
  δ-involutive g = automorphisms-of-Ω-are-involutive fe pe  ⌜ δ g ⌝ ⌜ δ g ⌝-is-equiv


But the involutivity of Ξ΄ g says that (⇁⇁ p) = p for all p, which
amounts to the principle of excluded middle.


  G-pointed-gives-excluded-middle : G β†’ EM 𝓣
  G-pointed-gives-excluded-middle g = III
   where
    I : (p : Ξ©) β†’ (⇁⇁ p) = p
    I p =
     ⇁⇁ p                =⟨ (Ξ΄-charac g (p β‡’ βŠ₯Ξ©))⁻¹ ⟩
     ⌜ Ξ΄ g ⌝ (⇁ p)       =⟨ ap ⌜ Ξ΄ g ⌝ ((Ξ΄-charac g p)⁻¹) ⟩
     ⌜ δ g ⌝ (⌜ δ g ⌝ p) =⟨ δ-involutive g p ⟩
     p                   ∎

    II : (P : 𝓣 Μ‡ ) β†’ is-prop P β†’ ¬¬ P β†’ P
    II P i Ο• = idtofun _ _ (ap _holds (I (P , i))) Ο•'
     where
      Ο•' : (P β†’ 𝟘 {𝓣}) β†’ 𝟘 {𝓣}
      Ο•' u = 𝟘-elim (Ο• (Ξ» p β†’ 𝟘-elim (u p)))

    III : (P : Set 𝓣) β†’ is-prop P β†’  P + Β¬ P
    III = DNE-gives-EM fe II


Because G is nonempty, we conclude that ¬¬ EM holds.


  the-double-negation-of-excluded-middle-holds : ¬¬ EM 𝓣
  the-double-negation-of-excluded-middle-holds =
   ¬¬-functor G-pointed-gives-excluded-middle G-is-nonempty


We also have the following.


  excluded-middle-gives-G-pointed : EM 𝓣 β†’ G
  excluded-middle-gives-G-pointed em = EM-gives-DNE em G G-is-prop G-is-nonempty


So now we know what the hypothetical set G of generators is. It is the
principle of excluded middle!


  G-is-EM : G ≃ EM 𝓣
  G-is-EM = logically-equivalent-props-are-equivalent
             G-is-prop
             (EM-is-prop fe')
             G-pointed-gives-excluded-middle
             excluded-middle-gives-G-pointed


This concludes the proof of all claims made above.

We originally developed some of the above ideas on paper, and then
more ideas here in Agda. Before summarizing explicitly our main result
and corollary, given below, we record some leftovers , which ended up
not being used in the proof of the above above claims, but which may
be interesting in their own right, and may be useful (or not) for
answering the questions below.


  𝔾 : Ξ©
  𝔾 = (G , G-is-prop)

  Ξ·' : G β†’ 𝓛 G
  Ξ·' g = G , (Ξ» _ β†’ g) , G-is-prop

  η-agrees-with-η' : η ∼ η'
  Ξ·-agrees-with-Ξ·' g = from-⋍ pe fe fe (((Ξ» _ β†’ g) , (Ξ» _ β†’ ⋆)) , (Ξ» _ β†’ refl))


Now we can use G to produce an element of 𝓛 G.


  lβ‚€ : 𝓛 G
  lβ‚€ = G , id , G-is-prop

  h-at-lβ‚€-explicitly : h lβ‚€ = βˆ€[κž‰]-syntax (lβ‚€ .pr₁) (Ξ» a β†’ ΞΉ (lβ‚€ .prβ‚‚ .pr₁ a))
  h-at-lβ‚€-explicitly = h-explicitly lβ‚€

  lβ‚€-is-not-βŠ₯ : lβ‚€ β‰  βŠ₯
  lβ‚€-is-not-βŠ₯ e = G-is-nonempty (Ξ» g β†’ 𝟘-elim (idtofun _ _ I g))
   where
    I : G = 𝟘
    I = ap is-defined e

  h-at-lβ‚€ : h lβ‚€ = (β±― g κž‰ G , ΞΉ g)
  h-at-lβ‚€ = h-explicitly lβ‚€

  h-at-lβ‚€' : h lβ‚€ = βŠ₯Ξ©
  h-at-lβ‚€' = false-gives-equal-βŠ₯ pe fe _ (holds-is-prop _) I
   where
    I : Β¬ ((β±― g κž‰ G , ΞΉ g) holds)
    I f = G-is-nonempty G-is-empty
     where
      G-is-empty : Β¬ G
      G-is-empty g = βŠ₯-doesnt-hold (transport _holds (ΞΉ-is-constantly-βŠ₯ g) II)
       where
        II : ΞΉ g holds
        II = f g

  lβ‚€-partial-charac : (g : G) β†’ lβ‚€ = Ξ· g
  lβ‚€-partial-charac g =
   equivs-are-lc h h-is-equiv
    (h lβ‚€    =⟨ h-at-lβ‚€' ⟩
     βŠ₯Ξ©      =⟨ (ΞΉ-is-constantly-βŠ₯ g)⁻¹ ⟩
     ι g     =⟨ (h-extends-ι g)⁻¹ ⟩
     h (η g) ∎)


We summarize the main results of this file as follows.


consequences-of-Ξ©βˆ€-being-freely-generated
 : (G : 𝓣 Μ‡ )
   (G-is-set : is-set G)
   (ΞΉ : G β†’ Ξ©)
   (Ξ©βˆ€-is-free : is-free-𝓛-alg Ξ©βˆ€ G ΞΉ)
 β†’  ¬¬ EM 𝓣
 Γ—  is-prop G
 Γ—  Β¬ is-empty G
 Γ—  ((g : G) β†’ ΞΉ g = βŠ₯Ξ©)
 Γ—  (G ≃ EM 𝓣)
consequences-of-Ξ©βˆ€-being-freely-generated G G-is-set ΞΉ Ξ©βˆ€-is-free
 = the-double-negation-of-excluded-middle-holds ,
   G-is-prop ,
   G-is-nonempty ,
   ΞΉ-is-constantly-βŠ₯ ,
   G-is-EM
 where
  open main-results G G-is-set ΞΉ
  open assumption Ξ©βˆ€-is-free


Notice that there is some redundancy in the conclusions.

In the introduction to this file, we claimed that if Ξ© equipped with
the lifting structure βˆ€ is freely generated by βŠ₯ : Ξ©, then the topos
is boolean. This is a particular case of the above development.


corollary : is-free-𝓛-alg Ξ©βˆ€  πŸ™ (Ξ» ⋆ β†’ βŠ₯Ξ©) β†’ EM 𝓣
corollary Ξ©βˆ€-is-freely-generated-by-βŠ₯
 = G-pointed-gives-excluded-middle ⋆
 where
  open main-results πŸ™ πŸ™-is-set (Ξ» ⋆ β†’ βŠ₯Ξ©)
  open assumption Ξ©βˆ€-is-freely-generated-by-βŠ₯


Discussion. For interpreting the above results in a 1-topos, notice
that toposes validate propositional resizing, and so the two universes
𝓣 and 𝓣⁺ collapse to a single one, and in fact no universe is needed,
as the only reason 𝓣⁺ arises is that both Ξ© and 𝓛 G live in 𝓣⁺, rather
than 𝓣, in the absence of propositional resizing. However, Agda forces
us to work with at least one universe, as opposed to MLTT, although
this is inessential.

We conclude with some questions, under the following assumptions:


module _
        (G : 𝓣 Μ‡ )
        (G-is-set : is-set G)
        (ΞΉ : G β†’ Ξ©)
       where

 private
  Ξ©βˆ€-is-free = is-free-𝓛-alg Ξ©βˆ€ G ΞΉ


The first question is whether our result is tight.


 Questionβ‚€ = ¬¬ EM 𝓣
           β†’ is-free-𝓛-alg Ξ©βˆ€ G ΞΉ

 Questionβ‚€-variationβ‚€ = ¬¬ EM 𝓣
                      β†’ G ≃ EM 𝓣
                      β†’ is-free-𝓛-alg Ξ©βˆ€ G ΞΉ

 Questionβ‚€-variation₁ = ¬¬ EM 𝓣
                      β†’ G ≃ EM 𝓣
                      β†’ ((g : G) β†’ ΞΉ g = βŠ₯Ξ©)
                      β†’ is-free-𝓛-alg Ξ©βˆ€ G ΞΉ

The second question is whether our result can be improved as follows.


 Question₁ = is-free-𝓛-alg Ξ©βˆ€ G ΞΉ
           β†’ EM 𝓣


That is, any topos in which Ξ©βˆ€ is free would be necessarily boolean.
(Added 24th November 2025. We answer Question₁ positively below.)


 of-course : Questionβ‚€ β†’ Question₁ β†’ (¬¬ EM 𝓣 β†’ EM 𝓣)
 of-course qβ‚€ q₁ nnem = q₁ (qβ‚€ nnem)


But there are toposes in which ¬¬ EM holds but EM fails (an example,
communicated to me by Andrew Swan, is the Sierpinski topos (*)), so the
two questions can't have a positive answer simultaneously in an
arbitrary topos.

(*) Luna Strah provided the following proof: EM in the topos of
sheaves over a topological space is the interior of the intersection
of all dense opens, which is the dense open set {1} for the Sierpinski
space, where 1 is the top point in the specialization order, and so
¬¬ EM is validated in the Sierpinski topos, but EM is not.

Added 21st November 2025.

Regarding (4) above, namely

 4. G ≃ (principle of excluded middle),

Anders Kock proved in [3] above that if a lifting algebra is free,
then it is freely generated by its positive elements.

For Ξ© equipped with βˆ€ as its lifting structure, an element q : Ξ© is
positive iff ((p β†’ q) β†’ q) β†’ p for all p : Ξ©.

It follows from this that:

(i) βŠ₯ is positive iff the principle of excluded middle (EM) holds.

(ii) If q : Ξ© is positive then q = βŠ₯.

(iii) The set of positive elements is a subsingleton, which is
      inhabited iff EM holds, that is,

      (set of positive elements) ≃ (principle of excluded middle).

Added 24th November. Here is this proof written in Agda.


Ξ©βˆ€-positivity-characβ†’ : (q : Ξ©)
                      β†’ is-positive Ξ©βˆ€ q
                      β†’ ((p : Ξ©) β†’ (((p β‡’ q) β‡’ q) β‡’ p) holds)
Ξ©βˆ€-positivity-characβ†’ q@(Q , Q-is-prop) q-is-pos p@(P , P-is-prop) = III
 where
  I : ((P β†’ Q) , _) = q β†’ P
  I = q-is-pos P P-is-prop

  II : ((P β†’ Q) β†’ Q) β†’ (P β†’ Q) = Q
  II Ο† = pe (Ξ -is-prop fe (Ξ» _ β†’ Q-is-prop))
             Q-is-prop
             Ο†
             (Ξ» (b : Q) (a : P) β†’ b)

  III : ((P β†’ Q) β†’ Q) β†’ P
  III Ο† = I (to-Ξ©-= fe (II Ο†))

Ξ©βˆ€-positivity-charac← : (q : Ξ©)
                      β†’ ((p : Ξ©) β†’ (((p β‡’ q) β‡’ q) β‡’ p) holds)
                      β†’ is-positive Ξ©βˆ€ q
Ξ©βˆ€-positivity-charac← q@(Q , Q-is-prop) Ο• P P-is-prop e = II
 where
  I : (P β†’ Q) β†’ Q
  I = idtofun (P β†’ Q) Q (ap pr₁ e)

  II : P
  II = Ο• (P , P-is-prop) I


In the next two proofs there is an annoying universe conversion, to
translate between

Ο•' : (P β†’ 𝟘 {𝓣}) β†’ 𝟘 {𝓣}

and ¬¬ P, which amounts to

Ο• : (P β†’ 𝟘 {𝓀₀}) β†’ 𝟘 {𝓀₀}.


βŠ₯-βˆ€-positive-gives-EM : is-positive Ξ©βˆ€ βŠ₯Ξ© β†’ EM 𝓣
βŠ₯-βˆ€-positive-gives-EM βŠ₯-is-pos = III
 where
  I : (P : 𝓣 Μ‡ ) β†’ is-prop P β†’ ((P β†’ 𝟘 {𝓣}) β†’ 𝟘 {𝓣}) β†’ P
  I P P-is-prop = Ξ©βˆ€-positivity-characβ†’ βŠ₯Ξ© βŠ₯-is-pos (P , P-is-prop)

  II : (P : 𝓣 Μ‡ ) β†’ is-prop P β†’ ((P β†’ 𝟘 {𝓀₀}) β†’ 𝟘 {𝓀₀}) β†’ P
  II P P-is-prop Ο• = I P P-is-prop Ο•'
   where
    Ο•' : (P β†’ 𝟘 {𝓣}) β†’ 𝟘 {𝓣}
    Ο•' = Ξ» (u : P β†’ 𝟘 {𝓣}) β†’ 𝟘-elim (Ο• (Ξ» (a : P) β†’ 𝟘-elim (u a)))

  III : (P : 𝓣 Μ‡ ) β†’ is-prop P β†’ P + Β¬ P
  III = DNE-gives-EM fe II

EM-gives-βŠ₯-βˆ€-positive : EM 𝓣 β†’ is-positive Ξ©βˆ€ βŠ₯Ξ©
EM-gives-βŠ₯-βˆ€-positive em = III
 where
  I : (P : 𝓣 Μ‡ ) β†’ is-prop P β†’ ((P β†’ 𝟘 {𝓀₀}) β†’ 𝟘 {𝓀₀}) β†’ P
  I = EM-gives-DNE em

  II : (p@(P , P-is-prop) : Ξ©) β†’ ((P β†’ 𝟘 {𝓣}) β†’ 𝟘 {𝓣}) β†’ P
  II (P , P-is-prop) Ο•' = I P P-is-prop Ο•
   where
    Ο• : (P β†’ 𝟘 {𝓀₀}) β†’ 𝟘 {𝓀₀}
    Ο• = Ξ» (u : P β†’ 𝟘 {𝓀₀}) β†’ 𝟘-elim (Ο•' (Ξ» (a : P) β†’ 𝟘-elim (u a)))

  III : is-positive Ξ©βˆ€ βŠ₯Ξ©
  III = Ξ©βˆ€-positivity-charac← βŠ₯Ξ© II


For the following we take p = βŠ₯Ξ© in the characterization of the
positivity.


βˆ€-positive-gives-equal-βŠ₯ : (q : Ξ©) β†’ is-positive Ξ©βˆ€ q β†’ q = βŠ₯Ξ©
βˆ€-positive-gives-equal-βŠ₯ q@(Q , Q-is-prop) q-is-pos = II
 where
  I : Β¬ Q
  I b = 𝟘-elim I₁
   where
    I₁ : 𝟘 {𝓣}
    I₁ = Ξ©βˆ€-positivity-characβ†’ q q-is-pos βŠ₯Ξ© (Ξ» (u : 𝟘 β†’ Q) β†’ b)

  II : q = βŠ₯Ξ©
  II = fails-gives-equal-βŠ₯ pe fe q I


Hence the positive elements form a subsingleton.


the-βˆ€-positive-props-form-a-prop : is-prop (Ξ£ q κž‰ Ξ© , is-positive Ξ©βˆ€ q)
the-βˆ€-positive-props-form-a-prop (q , q-is-pos) (q' , q'-is-pos) =
 to-subtype-=
  (being-positive-is-prop fe Ξ©βˆ€)
  (q  =⟨ βˆ€-positive-gives-equal-βŠ₯ q q-is-pos ⟩
   βŠ₯Ξ© =⟨ (βˆ€-positive-gives-equal-βŠ₯ q' q'-is-pos)⁻¹ ⟩
   q' ∎)


And, moreover, any positive element gives excluded middle. Conversely,
excluded middle gives the (only) positive element βŠ₯Ξ©.


the-βˆ€-positive-props-form-a-type-equiv-to-EM
 : (Ξ£ q κž‰ Ξ© , is-positive Ξ©βˆ€ q) ≃ EM 𝓣
the-βˆ€-positive-props-form-a-type-equiv-to-EM
 = logically-equivalent-props-are-equivalent
    the-βˆ€-positive-props-form-a-prop
    (EM-is-prop fe')
    (Ξ» (q , q-is-pos) β†’ βŠ₯-βˆ€-positive-gives-EM
                         (transport
                           (is-positive Ξ©βˆ€)
                           (βˆ€-positive-gives-equal-βŠ₯ q q-is-pos)
                           q-is-pos))
    (Ξ» em β†’ (βŠ₯Ξ© , EM-gives-βŠ₯-βˆ€-positive em))


Added 24th November 2025. We answer Question₁ above positively. This
gives a stronger result than what is claimed above, with a simpler and
shorter proof, which in particular doesn't appeal to Higgs Involution
Theorem.


module stronger-result-with-simpler-proof
        (G : 𝓣 Μ‡ )
        (G-is-set : is-set G)
        (ΞΉ : G β†’ Ξ©)
        (Ξ©βˆ€-is-free : is-free-𝓛-alg Ξ©βˆ€  G ΞΉ)
       where

 open main-results G G-is-set ΞΉ
 open assumption Ξ©βˆ€-is-free

 h-more-explicitly : (l : 𝓛 G) β†’ h l = ⇁ is-def l
 h-more-explicitly l@(P , Ο† , i) = I
  where
   I = h l                 =⟨ h-explicitly l ⟩
       (β±― a κž‰ P , ΞΉ (Ο† a)) =⟨ Iβ‚€ ⟩
       (β±― a κž‰ P , βŠ₯Ξ©)      =⟨ refl ⟩
       ⇁ is-def l ∎
     where
      Iβ‚€ = Ξ©-extensionality pe fe
            (Ξ» f a β†’ idtofun (ΞΉ (Ο† a) holds) (βŠ₯Ξ© holds)
                      (ap _holds (ΞΉ-is-constantly-βŠ₯ (Ο† a)))
                      (f a))
            (Ξ» (Ξ½ : P β†’ 𝟘) (a : P) β†’ 𝟘-elim (Ξ½ a))


We say that a proposition is negative if it is logically equivalent to
a negation. A proposition is negative if and only if it is ¬¬-stable
(because three negations imply one). By the above characterization of
h, as h is an equivalence, every proposition is negative, which means
that the principle of excluded middle holds.


 EM-holds : EM 𝓣
 EM-holds = DNE-gives-EM fe DNE-holds
  where
   DNE-holds : (P : 𝓣 Μ‡) β†’ is-prop P β†’ ¬¬ P β†’ P
   DNE-holds P P-is-prop = VI
    where
     p q : Ξ©
     p = (P , P-is-prop)
     q = is-def (h⁻¹ p)

     Q : 𝓣 Μ‡
     Q = q holds

     I = p         =⟨ (inverses-are-sections' 𝕙 p)⁻¹ ⟩
         h (h⁻¹ p) =⟨ h-more-explicitly (h⁻¹ p) ⟩
         ⇁ q       ∎

     II : P = (⇁ q) holds
     II = ap _holds I

     III : P β†’ Β¬ Q
     III g q = 𝟘-elim (idtofun P (Q β†’ 𝟘) II g q)

     IV : Β¬ Q β†’ P
     IV Ξ½ = idtofun (Q β†’ 𝟘) P (II ⁻¹) (Ξ» (a : Q) β†’ 𝟘-elim (Ξ½ a))

     V : ¬¬ P β†’ Β¬ Q
     V = three-negations-imply-one ∘ ¬¬-functor III

     VI : ¬¬ P β†’ P
     VI = IV ∘ V


We summarize this as follows.


stronger-consequence-of-Ξ©βˆ€-being-freely-generated
 : (G : 𝓣 Μ‡ )
   (G-is-set : is-set G)
   (ΞΉ : G β†’ Ξ©)
   (Ξ©βˆ€-is-free : is-free-𝓛-alg Ξ©βˆ€ G ΞΉ)
 β†’ EM 𝓣
stronger-consequence-of-Ξ©βˆ€-being-freely-generated G G-is-set ΞΉ Ξ©βˆ€-is-free
 = EM-holds
 where
  open stronger-result-with-simpler-proof G G-is-set ΞΉ Ξ©βˆ€-is-free


In other words,


positive-answer-to-Question₁ : (G : 𝓣 Μ‡ )
                               (G-is-set : is-set G)
                               (ΞΉ : G β†’ Ξ©)
                             β†’ Question₁ G G-is-set ΞΉ
positive-answer-to-Question₁ G G-is-set ΞΉ Ξ©βˆ€-is-free =
 stronger-consequence-of-Ξ©βˆ€-being-freely-generated G G-is-set ΞΉ Ξ©βˆ€-is-free