Documentation

Marginis.manyOne

Many-one reducibility and its automorphisms #

Main statements:

structure mon :

An arbitrary monoid.

  • func : ()Prop

    The functions under consideration (computable, primitive recursive, hyperarithmetic, etc.)

  • id : self.func id
  • comp : ∀ {f g : }, self.func fself.func gself.func (f g)
Instances For
    theorem mon.id (self : mon) :
    self.func id
    theorem mon.comp (self : mon) {f : } {g : } :
    self.func fself.func gself.func (f g)
    def m_reducible {m : mon} (A : Bool) (B : Bool) :

    Mapping (many-one) reducibility.

    Equations
    Instances For
      def m_equivalent {m : mon} (A : Bool) (B : Bool) :

      A ≡ₘ B ↔ A ≤ₘ B and B ≤ₘ A.

      Equations
      Instances For

        A ≤ₘ B iff A is many-one reducible to B.

        Equations
        Instances For

          A ≡ₘ B iff A is many-one equivalent to B.

          Equations
          Instances For
            theorem m_refl {m : mon} :
            Reflexive m_reducible

            m-reducibility is reflexive.

            instance instTransForallNatBoolM_reducible {m : mon} :
            Trans m_reducible m_reducible m_reducible

            To do calc proofs with m-reducibility we create a Trans instance.

            Equations
            • instTransForallNatBoolM_reducible = { trans := }
            theorem m_trans {m : mon} :
            Transitive m_reducible

            m-reducibility is transitive.

            @[reducible, inline]
            abbrev 𝓓setoid {m : mon} :

            The degree structure 𝓓ₘ, using quotients #

            Quot is like Quotient when the relation is not necessarily an equivalence. We could do: def 𝓓ₘ' := Quot m_equivalent

            Equations
            • 𝓓setoid = { r := m_equivalent, iseqv := }
            Instances For
              @[reducible, inline]
              abbrev 𝓓 {m : mon} :

              The many-one degrees.

              Equations
              Instances For
                theorem upper_cones_eq {m : mon} (A : Bool) (B : Bool) (h : A ≡ₘ B) :

                Equivalent reals have equal upper cones.

                theorem degrees_eq {m : mon} (A : Bool) (B : Bool) (h : A ≡ₘ B) :

                Equivalent reals have equal degrees.

                theorem m_reducible_congr_equiv {m : mon} (A : Bool) (C : Bool) (D : Bool) (hCD : C ≡ₘ D) :
                (A ≤ₘ C) = (A ≤ₘ D)
                def le_m' {m : mon} (A : Bool) (b : 𝓓) :

                As an auxiliary notion, we define [A]ₘ ≤ b.

                Equations
                Instances For
                  theorem m_reducible_congr_equiv' {m : mon} (b : 𝓓) (C : Bool) (D : Bool) (hCD : C ≡ₘ D) :
                  le_m' C b = le_m' D b
                  def le_m {m : mon} (a : 𝓓) (b : 𝓓) :

                  The ordering of the m-degrees.

                  Equations
                  Instances For
                    theorem le_m_refl {m : mon} :

                    The ordering of m-degrees is reflexive.

                    theorem le_m_trans {m : mon} :

                    The ordering of m-degrees is transitive.

                    m-reducibility is a preorder.

                    Equations
                    Instances For

                      For example 𝓓₁ is a partial order (if not a semilattice).

                      Equations
                      instance instZero𝓓 {m : mon} :
                      Zero 𝓓

                      The nontrivial computable sets form the m-degree 0.

                      Equations
                      • instZero𝓓 = { zero := fun (k : ) => if k = 0 then true else false }
                      instance instBot𝓓 {m : mon} :
                      Bot 𝓓

                      The degree ⟦∅⟧ₘ = ⊤.

                      Equations
                      • instBot𝓓 = { bot := fun (x : ) => false }
                      instance instTop𝓓 {m : mon} :
                      Top 𝓓

                      The degree ⟦ℕ⟧ₘ = ⊤.

                      Equations
                      • instTop𝓓 = { top := fun (x : ) => true }
                      def join (A : Bool) (B : Bool) (k : ) :

                      The recursive join A ⊕ B. #

                      (However, the symbol ⊕ has a different meaning in Lean.) It is really a shuffle or ♯ (backslash sha).

                      Equations
                      • (A B) k = if Even k then A (k / 2) else B (k / 2)
                      Instances For

                        Make sure ♯ binds stronger than ≤ₘ.

                        Equations
                        Instances For
                          def inlFun :

                          Embedding on the left over ℕ.

                          Equations
                          Instances For
                            def inrFun :

                            Embedding on the right over ℕ.

                            Equations
                            Instances For
                              theorem join_inl' (A : Bool) (B : Bool) :
                              (A B) inlFun = A
                              theorem join_inl (A : Bool) (B : Bool) (k : ) :
                              (A B) (inlFun k) = A k

                              Join works as desired on the left.

                              theorem join_inr (A : Bool) (B : Bool) (k : ) :
                              (A B) (inrFun k) = B k

                              Join works as desired on the right.

                              theorem join_inr' (A : Bool) (B : Bool) :
                              (A B) inrFun = B

                              The unit monoid consists of id only. The corresponding degree structure has equality as its equivalence.

                              Equations
                              Instances For
                                structure mon₁extends mon :

                                A monoid in which we can prove ⊕ is an upper bound, even if not the least one.

                                • func : ()Prop
                                • id : self.func id
                                • comp : ∀ {f g : }, self.func fself.func gself.func (f g)
                                • inl : self.func inlFun
                                • inr : self.func inrFun
                                Instances For
                                  theorem mon₁.inl (self : mon₁) :
                                  self.func inlFun
                                  theorem mon₁.inr (self : mon₁) :
                                  self.func inrFun
                                  theorem join_left {m : mon₁} (A : Bool) (B : Bool) :
                                  A ≤ₘ A B

                                  A ≤ₘ A ⊕ B.

                                  theorem join_right {m : mon₁} (A : Bool) (B : Bool) :
                                  B ≤ₘ A B

                                  B ≤ₘ A ⊕ B.

                                  noncomputable def botSwap {m : mon} :
                                  𝓓𝓓

                                  A map on 𝓓ₘ that swaps ∅ and ℕ.

                                  Equations
                                  Instances For
                                    theorem botSwap_inj {m : mon} :

                                    Swapping ∅ and ℕ is injective on 𝓓ₘ.

                                    theorem botSwap_surj {m : mon} :

                                    Swapping ∅ and ℕ is surjective on 𝓓ₘ.

                                    theorem emp_not_below {m : mon} :

                                    In 𝓓ₘ, ⊥ is not below ⊤.

                                    theorem univ_not_below {m : mon} :

                                    In 𝓓ₘ, ⊤ is not below ⊥.

                                    theorem emp_min {m : mon} (a : 𝓓) (h : a ) :
                                    a =

                                    In 𝓓ₘ, ⊥ is a minimal element.

                                    theorem univ_min {m : mon} (a : 𝓓) (h : a ) :
                                    a =

                                    In 𝓓ₘ, ⊤ is a minimal element.

                                    def automorphism {α : Type} [PartialOrder α] (π : αα) :

                                    An automorphism of a partial order is a bijection that preserves and reflects the order.

                                    Equations
                                    Instances For
                                      def cpl :
                                      (Bool)Bool

                                      The complement map on ℕ → Bool.

                                      Equations
                                      Instances For
                                        def complementMap {m : mon} :
                                        𝓓𝓓

                                        The complement map on 𝓓ₘ.

                                        Equations
                                        Instances For
                                          def induces {m : mon} (f : 𝓓𝓓) (F : (Bool)Bool) :
                                          Equations
                                          Instances For
                                            def induced {m : mon} (f : 𝓓𝓓) :
                                            Equations
                                            Instances For
                                              def induced₀ {m : mon} (π : 𝓓𝓓) :

                                              Induced by a function on ℕ.

                                              Equations
                                              Instances For
                                                theorem id_induced₀ {m : mon} :

                                                The identity automorphism is induced by a function on ℕ.

                                                theorem complementMap_is_not_induced₀ {m : mon} :
                                                ¬induced₀ complementMap

                                                The complement automorphism is not induced by a function on ℕ.

                                                theorem complementMap_is_induced {m : mon} :
                                                induced complementMap

                                                In 𝓓ₘ, ⊥ ≠ ⊤.

                                                theorem botSwapNontrivial {m : mon} :
                                                botSwap id

                                                The (⊥,⊤) swap map is not the identity.

                                                def rigid (α : Type) [PartialOrder α] :

                                                A partial order is rigid if there are no nontrivial automorphisms.

                                                Equations
                                                Instances For
                                                  theorem half_primrec :
                                                  Primrec fun (k : ) => k / 2

                                                  Dividing-by-two is primitive recursive.

                                                  theorem primrec_even_equiv :
                                                  PrimrecPred fun (k : ) => k / 2 * 2 = k

                                                  An arithmetical characterization of "Even" is primitive recursive.

                                                  theorem even_div_two (a : ) :
                                                  a / 2 * 2 = a Even a

                                                  Characterizing "Even" arithmetically.

                                                  "Even" is a primitive recursive predicate.

                                                  theorem primrec_join {f₁ : } {f₂ : } (hf₁ : Primrec f₁) (hf₂ : Primrec f₂) :
                                                  Primrec fun (k : ) => if Even k then f₁ (k / 2) else f₂ (k / 2)

                                                  The usual join of functions on ℕ is primitive recursive.

                                                  theorem computable_join {f₁ : } {f₂ : } (hf₁ : Computable f₁) (hf₂ : Computable f₂) :
                                                  Computable fun (k : ) => if Even k then f₁ (k / 2) else f₂ (k / 2)

                                                  The usual join of functions on ℕ is computable.

                                                  theorem getHasIte {m : mon₁} (hasIte₂ : ∀ {f₁ f₂ : }, m.func f₁m.func f₂m.func fun (k : ) => if Even k then f₁ (k / 2) else f₂ (k / 2)) (f : ) :
                                                  m.func fm.func fun (k : ) => if Even k then f (k / 2) * 2 else k

                                                  An auxiliary lemma for proving that the join A₀ ⊕ A₁ is monotone in A₀ within the context of the monoid class mon₁.

                                                  def joinFun (f₁ : ) (f₂ : ) (k : ) :

                                                  Coding two functions into one.

                                                  Equations
                                                  Instances For
                                                    structure monₘextends mon₁ :

                                                    Requirement for a semilattice like 𝓓ₘ.

                                                    • func : ()Prop
                                                    • id : self.func id
                                                    • comp : ∀ {f g : }, self.func fself.func gself.func (f g)
                                                    • inl : self.func inlFun
                                                    • inr : self.func inrFun
                                                    • join : ∀ {f₁ f₂ : }, self.func f₁self.func f₂self.func (joinFun f₁ f₂)
                                                    • const : ∀ (c : ), self.func fun (x : ) => c
                                                    Instances For
                                                      theorem monₘ.join (self : monₘ) {f₁ : } {f₂ : } :
                                                      self.func f₁self.func f₂self.func (joinFun f₁ f₂)
                                                      theorem monₘ.const (self : monₘ) (c : ) :
                                                      self.func fun (x : ) => c
                                                      theorem botSwap_is_induced_helper {m : monₘ} {A : Bool} {B : Bool} (hAB : A ≡ₘ B) :
                                                      (if A = fun (x : ) => false then fun (x : ) => true else if A = fun (x : ) => true then fun (x : ) => false else A) ≤ₘ if B = fun (x : ) => false then fun (x : ) => true else if B = fun (x : ) => true then fun (x : ) => false else B
                                                      theorem botSwap_is_induced {m : monₘ} :
                                                      induced botSwap

                                                      The botSwap automorphism is induced by a function on reals.

                                                      The computable functions satisfy the requirement for a semilattice like 𝓓ₘ.

                                                      Equations
                                                      Instances For

                                                        The primitive recursive functions satisfy the requirement for a semilattice like 𝓓ₘ.

                                                        Equations
                                                        Instances For

                                                          The all-monoid, which will give us only three degrees, ⊥, ⊤ and 0.

                                                          Equations
                                                          Instances For
                                                            theorem join_le_join {m : monₘ} {A₀ : Bool} {A₁ : Bool} (h : A₀ ≤ₘ A₁) (B : Bool) :
                                                            A₀ B ≤ₘ A₁ B

                                                            The join A₀ ⊕ A₁ is monotone in A₀.

                                                            theorem join_le {m : monₘ} {A : Bool} {B : Bool} {C : Bool} (h₁ : A ≤ₘ C) (h₂ : B ≤ₘ C) :
                                                            A B ≤ₘ C

                                                            The join is bounded by each upper bound.

                                                            def join' {m : monₘ} (A : Bool) (b : Quot m_equivalent) :
                                                            Quot m_equivalent

                                                            The m-degree [A]ₘ ⊔ b.

                                                            Equations
                                                            Instances For

                                                              𝓓ₘ is a join-semilattice.

                                                              Equations
                                                              theorem emp_univ {m : monₘ} (B : Bool) (h_2 : ¬B = ) :
                                                              B

                                                              If b ≠ ⊥ then ⊤ ≤ b. This is false for 1-degrees. However, the complementing automorphism works there.

                                                              theorem univ_emp {m : monₘ} (B : Bool) (h_2 : B ) :
                                                              B

                                                              In the m-degrees, if ⟦B⟧ ≠ ⊤ then ⊥ ≤ ⟦B⟧.

                                                              theorem complementMapIsNontrivial {m : mon} :
                                                              complementMap id

                                                              The complement map is not the identity map of 𝓓ₘ.

                                                              theorem complementMap_surjective {m : mon} :
                                                              Function.Surjective complementMap

                                                              The complement map is a surjective map of 𝓓ₘ.

                                                              theorem complementMap_injective {m : mon} :
                                                              Function.Injective complementMap

                                                              The complement map is an injective map of 𝓓ₘ.

                                                              theorem cplAuto {m : mon} (A : Bool) (B : Bool) :

                                                              Complementation is an automorphism not only of the partial order 𝓓ₘ, but of the preorder m_reducible! (That is true for Turing degrees too. To rule out that there is an automorphism of the preorder for Turing degrees that maps something to an element of a different Turing degree we would have to rule out e.g. a homeomorphism inducing an automorphism. )

                                                              theorem complementMapIsAuto {m : mon} :
                                                              automorphism complementMap

                                                              The complement map is an automorphism of 𝓓ₘ.

                                                              theorem notrigid {m : mon} :
                                                              ¬rigid 𝓓

                                                              𝓓ₘ is not rigid.

                                                              theorem botSwapIsAuto {m : monₘ} :
                                                              automorphism botSwap

                                                              Over a rich enough monoid, botSwap is an automorphism.

                                                              theorem emp_lt_zero {m : monₘ} :
                                                              < 0

                                                              In 𝓓ₘ, the degree of ∅ is less than 0.

                                                              theorem zero_one_m {E : monₘ} {b : Bool} (A : Bool) :
                                                              (A fun (x : ) => b) (fun (x : ) => !b) ≤ₘ A

                                                              ∅ and ℕ are the minimal elements of 𝓓ₘ, since A ≠ ⊥ ↔ ⊤ ≤ A and A ≠ ⊤ ↔ ⊥ ≤ A.

                                                              theorem bot_property {E : monₘ} (a : 𝓓) :
                                                              theorem top_property {E : monₘ} (a : 𝓓) :
                                                              def is_minimal {α : Type u_1} [PartialOrder α] (a : α) :
                                                              Equations
                                                              Instances For

                                                                April 17, 2025

                                                                theorem only_two_minimals {E : monₘ} (a : 𝓓) :
                                                                def is_least {α : Type u_1} [PartialOrder α] (a : α) :
                                                                Equations
                                                                Instances For
                                                                  theorem no_least_if_two_minimal {α : Type u_1} [PartialOrder α] (u : α) (v : α) (huv : u v) (hu : is_minimal u) (hv : is_minimal v) (a : α) :
                                                                  theorem no_least_m_degree {E : monₘ} (a : 𝓓) :
                                                                  noncomputable def φ {e : Nat.Partrec.Code} :
                                                                  Bool

                                                                  The eth r.e. set

                                                                  Equations
                                                                  Instances For
                                                                    noncomputable def K :
                                                                    Bool

                                                                    Defining the halting set K as {e | φₑ(0)↓}. (There are other possible, essentially equivalent, definitions.)

                                                                    Equations
                                                                    Instances For
                                                                      theorem K_re :
                                                                      RePred fun (k : ) => K k = true

                                                                      The halting set K is r.e.

                                                                      theorem Kbar_not_re :
                                                                      ¬RePred fun (k : ) => (!K k) = true

                                                                      The complement of the halting set K is not r.e.

                                                                      theorem Kbar_not_computable :
                                                                      ¬Computable fun (k : ) => !K k

                                                                      The complement of the halting set K is not computable.

                                                                      The halting set K is not computable.

                                                                      Equations
                                                                      Instances For
                                                                        theorem compute_closed_m_downward (A : Bool) (B : Bool) (h : Computable B) (h₀ : A ≤ₘ B) :

                                                                        If B is computable and A ≤ₘ B then A is computable.

                                                                        theorem re_closed_m_downward {A : Bool} {B : Bool} (h : RePred fun (k : ) => B k = true) (h₀ : A ≤ₘ B) :
                                                                        RePred fun (k : ) => A k = true

                                                                        If B is r.e. and A ≤ₘ B then A is r.e.

                                                                        theorem Kbar_not_below_K :
                                                                        ¬(fun (k : ) => decide ((!K k) = true)) ≤ₘ K

                                                                        The complement of K is not m-reducible to K.

                                                                        noncomputable def Km :
                                                                        𝓓
                                                                        Equations
                                                                        Instances For
                                                                          noncomputable def Kbarm :
                                                                          𝓓
                                                                          Equations
                                                                          Instances For
                                                                            def automorphic {m : mon} (a : 𝓓) (b : 𝓓) :

                                                                            Two m-degrees are automorphic if some automorphism maps one to the other.

                                                                            Equations
                                                                            Instances For
                                                                              theorem bijinvfun {α : Type u_1} [Nonempty α] (f : αα) (h : Function.Bijective f) :

                                                                              Surely this should already exist in Mathlib?

                                                                              theorem automorphism_comp {m : mon} (π : 𝓓𝓓) (hπ : automorphism π) (ρ : 𝓓𝓓) (hρ : automorphism ρ) :
                                                                              def automorphic_le {m : mon} (a : 𝓓) (b : 𝓓) :
                                                                              Equations
                                                                              Instances For
                                                                                theorem automorphic_le_refl {m : mon} :
                                                                                Reflexive automorphic_le
                                                                                theorem automorphic_le_trans {m : mon} :
                                                                                Transitive automorphic_le
                                                                                instance instPreorder𝓓 {m : mon} :
                                                                                Equations
                                                                                def automorphic_equiv {m : mon} (a : 𝓓) (b : 𝓓) :

                                                                                is this the same as just automorphic?

                                                                                Equations
                                                                                Instances For