Documentation

LeanPool.DomainTheory.Neighborhood.Exercise617Gen

Exercise 6.17 part 2 (Scott 1981, PRG-19) โ€” the generalization Cโ‚ โ‰… ๐Ÿ™ + ฮฃโ‚ Cโ‚ #

Example 6.2 / Exercise 6.17 ask for the generalization of C corresponding to Scott's A โ‰… Aโฟ + Aโฟ: replace the two-letter alphabet {0,1} of C (C โ‰… ๐Ÿ™ + C + C) by an arbitrary alphabet A. The domain Cโ‚ of finite or infinite A-sequences then satisfies the domain equation Cโ‚ โ‰… ๐Ÿ™ + ฮฃ_{a:A} Cโ‚ (the A-indexed separated sum of copies of Cโ‚). Instantiating A := Fin n gives Cโ‚™ โ‰… ๐Ÿ™ + nยทCโ‚™; A := Bool recovers Example 6.2's C.

This module mirrors, generically over an alphabet A with decidable equality, the binary development of Example44 (the domain), Example62/Example62C (the sum and the isomorphism) and Exercise617 (initiality).

Stage 1 (this section): the generic domain Cโ‚ #

Strn A = List A; cones coneN ฯƒ = ฯƒA*; the neighbourhood system Cn = {ฯƒA*} โˆช {{ฯƒ}}; the total elements strElemN ฯƒ and partial elements strBotN ฯƒ; and the successors consMapN a : Cโ‚ โ†’ Cโ‚ prepending the letter a. Everything is the alphabet-generic copy of Example44, and the data (Cn, consMapN) stays choice-free.

@[reducible, inline]

The token type A* of finite A-strings.

Equations
Instances For

    The cone ฯƒA*: all extensions of ฯƒ.

    Equations
    Instances For
      @[simp]
      theorem Domain.Neighborhood.Exercise617Gen.mem_coneN {A : Type} {ฯƒ w : Strn A} :
      w โˆˆ coneN ฯƒ โ†” ฯƒ <+: w
      theorem Domain.Neighborhood.Exercise617Gen.coneN_subset_coneN {A : Type} {ฯƒ ฯ„ : Strn A} :
      coneN ฯƒ โІ coneN ฯ„ โ†” ฯ„ <+: ฯƒ
      theorem Domain.Neighborhood.Exercise617Gen.coneN_injective {A : Type} {ฯƒ ฯ„ : Strn A} (h : coneN ฯƒ = coneN ฯ„) :
      ฯƒ = ฯ„

      Membership in Cโ‚: a cone ฯƒA* or a singleton {ฯƒ}.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        theorem Domain.Neighborhood.Exercise617Gen.Cn_nonempty {A : Type} (X : Set (Strn A)) :
        (Cn A).mem X โ†’ X.Nonempty

        Cโ‚ is โˆ…-free: every neighbourhood is non-empty (cones and singletons are inhabited).

        The partial element ฯƒโŠฅ = โ†‘ฯƒA*.

        Equations
        Instances For

          The total element ฯƒ = โ†‘{ฯƒ}.

          Equations
          Instances For

            Prepending a letter: the successors x โ†ฆ aยทx. #

            ฯƒX = {ฯƒฯ„ โˆฃ ฯ„ โˆˆ X}.

            Equations
            Instances For
              @[simp]
              theorem Domain.Neighborhood.Exercise617Gen.mem_prependN {A : Type} {ฯƒ : Strn A} {X : Set (Strn A)} {w : Strn A} :
              w โˆˆ prependN ฯƒ X โ†” โˆƒ ฯ„ โˆˆ X, w = ฯƒ ++ ฯ„
              theorem Domain.Neighborhood.Exercise617Gen.prependN_coneN {A : Type} (ฯƒ ฯ : Strn A) :
              prependN ฯƒ (coneN ฯ) = coneN (ฯƒ ++ ฯ)
              theorem Domain.Neighborhood.Exercise617Gen.prependN_singleton {A : Type} (ฯƒ ฯ„ : Strn A) :
              prependN ฯƒ {ฯ„} = {ฯƒ ++ ฯ„}
              theorem Domain.Neighborhood.Exercise617Gen.prependN_mono {A : Type} (ฯƒ : Strn A) {X X' : Set (Strn A)} (h : X' โІ X) :
              prependN ฯƒ X' โІ prependN ฯƒ X
              theorem Domain.Neighborhood.Exercise617Gen.memCn_prependN {A : Type} (ฯƒ : Strn A) {X : Set (Strn A)} (hX : memCn X) :
              memCn (prependN ฯƒ X)

              The successor x โ†ฆ aยทx prepending the letter a: X (aยทx) Y โ†” aX โІ Y.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                Stage 2: the A-indexed separated sum Tsig(X) = ๐Ÿ™ + ฮฃ_{a:A} X #

                The right-hand side of the generalized domain equation. Tokens are Option (Unit โŠ• (A ร— ฮฒ)): a fresh basepoint ฮ› = none, the lone ๐Ÿ™-token tu = some (inl ()), and the A-indexed family of tagged copies tc a t = some (inr (a, t)). This is the alphabet-generic analogue of Example62C's three-way sum3 unitSys C C (= ๐Ÿ™ + C + C), the index Bool being replaced by A.

                @[reducible, inline]

                Tokens of the indexed sum ๐Ÿ™ + ฮฃ_a ฮฒ.

                Equations
                Instances For
                  def Domain.Neighborhood.Exercise617Gen.tu {A : Type} {ฮฒ : Type v} :
                  SigTok A ฮฒ

                  The lone ๐Ÿ™-token.

                  Equations
                  Instances For
                    def Domain.Neighborhood.Exercise617Gen.tc {A : Type} {ฮฒ : Type v} (a : A) (t : ฮฒ) :
                    SigTok A ฮฒ

                    The token t in the a-indexed copy.

                    Equations
                    Instances For
                      def Domain.Neighborhood.Exercise617Gen.jU {A : Type} {ฮฒ : Type v} :
                      Set (SigTok A ฮฒ)

                      The ๐Ÿ™-copy neighbourhood (the image of univ : Set Unit).

                      Equations
                      Instances For
                        def Domain.Neighborhood.Exercise617Gen.jc {A : Type} {ฮฒ : Type v} (a : A) (X : Set ฮฒ) :
                        Set (SigTok A ฮฒ)

                        The a-indexed tagged copy aX.

                        Equations
                        Instances For
                          theorem Domain.Neighborhood.Exercise617Gen.tc_injective {A : Type} {ฮฒ : Type v} {a a' : A} {t t' : ฮฒ} (h : tc a t = tc a' t') :
                          a = a' โˆง t = t'
                          @[simp]
                          theorem Domain.Neighborhood.Exercise617Gen.tc_mem_jc {A : Type} {ฮฒ : Type v} {a : A} {X : Set ฮฒ} {t : ฮฒ} :
                          @[simp]
                          theorem Domain.Neighborhood.Exercise617Gen.mem_jU {A : Type} {ฮฒ : Type v} {w : SigTok A ฮฒ} :
                          @[simp]
                          theorem Domain.Neighborhood.Exercise617Gen.none_not_mem_jc {A : Type} {ฮฒ : Type v} {a : A} {X : Set ฮฒ} :
                          none โˆ‰ jc a X
                          @[simp]
                          theorem Domain.Neighborhood.Exercise617Gen.tu_not_mem_jc {A : Type} {ฮฒ : Type v} {a : A} {X : Set ฮฒ} :
                          tu โˆ‰ jc a X
                          theorem Domain.Neighborhood.Exercise617Gen.tc_not_mem_jU {A : Type} {ฮฒ : Type v} {a : A} {t : ฮฒ} :
                          tc a t โˆ‰ jU
                          theorem Domain.Neighborhood.Exercise617Gen.tc_mem_jc_ne {A : Type} {ฮฒ : Type v} {a a' : A} (h : a โ‰  a') {X : Set ฮฒ} {t : ฮฒ} :
                          tc a t โˆ‰ jc a' X
                          theorem Domain.Neighborhood.Exercise617Gen.jc_inter_jc_same {A : Type} {ฮฒ : Type v} (a : A) (X X' : Set ฮฒ) :
                          jc a X โˆฉ jc a X' = jc a (X โˆฉ X')
                          theorem Domain.Neighborhood.Exercise617Gen.jc_inter_jc_ne {A : Type} {ฮฒ : Type v} {a a' : A} (h : a โ‰  a') (X X' : Set ฮฒ) :
                          jc a X โˆฉ jc a' X' = โˆ…
                          theorem Domain.Neighborhood.Exercise617Gen.jU_inter_jc {A : Type} {ฮฒ : Type v} (a : A) (X : Set ฮฒ) :
                          theorem Domain.Neighborhood.Exercise617Gen.jc_nonempty {A : Type} {ฮฒ : Type v} {a : A} {X : Set ฮฒ} (hX : X.Nonempty) :
                          (jc a X).Nonempty
                          theorem Domain.Neighborhood.Exercise617Gen.jc_subset_jc {A : Type} {ฮฒ : Type v} {a : A} {X X' : Set ฮฒ} :
                          jc a X โІ jc a X' โ†” X โІ X'
                          theorem Domain.Neighborhood.Exercise617Gen.jc_injective {A : Type} {ฮฒ : Type v} {a : A} {X X' : Set ฮฒ} (h : jc a X = jc a X') :
                          X = X'
                          theorem Domain.Neighborhood.Exercise617Gen.jc_eq_jc {A : Type} {ฮฒ : Type v} {a a' : A} {X X' : Set ฮฒ} (hXne : X.Nonempty) (heq : jc a X = jc a' X') :
                          a = a' โˆง X = X'

                          Tagged copies determine both index and set: aX = a'X' (with X non-empty) forces a=a', X=X'.

                          def Domain.Neighborhood.Exercise617Gen.masterSig {A : Type} {ฮฒ : Type v} (V : NeighborhoodSystem ฮฒ) :
                          Set (SigTok A ฮฒ)

                          The master neighbourhood {ฮ›} โˆช {tu} โˆช โ‹ƒ_a aฮ”.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            theorem Domain.Neighborhood.Exercise617Gen.jc_subset_masterSig {A : Type} {ฮฒ : Type v} {V : NeighborhoodSystem ฮฒ} {a : A} {X : Set ฮฒ} (hX : V.mem X) :
                            theorem Domain.Neighborhood.Exercise617Gen.masterSig_inter_jc {A : Type} {ฮฒ : Type v} {V : NeighborhoodSystem ฮฒ} {a : A} {X : Set ฮฒ} (hX : V.mem X) :
                            theorem Domain.Neighborhood.Exercise617Gen.eq_masterSig_of_subset {A : Type} {ฮฒ : Type v} {V : NeighborhoodSystem ฮฒ} {W : Set (SigTok A ฮฒ)} (hsub : masterSig V โІ W) (hsub' : W โІ masterSig V) :
                            def Domain.Neighborhood.Exercise617Gen.sumSig {ฮฒ : Type v} (A : Type) [DecidableEq A] (V : NeighborhoodSystem ฮฒ) (h : โˆ€ (X : Set ฮฒ), V.mem X โ†’ X.Nonempty) :

                            The A-indexed separated sum ๐Ÿ™ + ฮฃ_a V over {ฮ›} โˆช {tu} โˆช โ‹ƒ_a aฮ”, under the standing assumption that no neighbourhood of V is empty. The alphabet-generic analogue of sum3 unitSys V V (Example 6.2).

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              @[simp]
                              theorem Domain.Neighborhood.Exercise617Gen.sumSig_master {A : Type} [DecidableEq A] {ฮฒ : Type v} {V : NeighborhoodSystem ฮฒ} {h : โˆ€ (X : Set ฮฒ), V.mem X โ†’ X.Nonempty} :
                              theorem Domain.Neighborhood.Exercise617Gen.sumSig_nonempty {A : Type} [DecidableEq A] {ฮฒ : Type v} {V : NeighborhoodSystem ฮฒ} {h : โˆ€ (X : Set ฮฒ), V.mem X โ†’ X.Nonempty} (W : Set (SigTok A ฮฒ)) :
                              (sumSig A V h).mem W โ†’ W.Nonempty

                              Shape lemmas: no nesting through the wrong tag. #

                              theorem Domain.Neighborhood.Exercise617Gen.mem_subset_jc_inv {A : Type} [DecidableEq A] {ฮฒ : Type v} {V : NeighborhoodSystem ฮฒ} {h : โˆ€ (X : Set ฮฒ), V.mem X โ†’ X.Nonempty} {W : Set (SigTok A ฮฒ)} {a : A} {X : Set ฮฒ} (hW : (sumSig A V h).mem W) (hsub : W โІ jc a X) :
                              โˆƒ (Xโ‚‚ : Set ฮฒ), V.mem Xโ‚‚ โˆง W = jc a Xโ‚‚

                              A sumSig-neighbourhood contained in an a-copy aX is itself an a-copy.

                              theorem Domain.Neighborhood.Exercise617Gen.mem_subset_jU_inv {A : Type} [DecidableEq A] {ฮฒ : Type v} {V : NeighborhoodSystem ฮฒ} {h : โˆ€ (X : Set ฮฒ), V.mem X โ†’ X.Nonempty} {W : Set (SigTok A ฮฒ)} (hW : (sumSig A V h).mem W) (hsub : W โІ jU) :
                              W = jU

                              A sumSig-neighbourhood contained in the ๐Ÿ™-copy jU is jU.

                              The canonical injections ๐Ÿ™ โ†ช ๐Ÿ™+ฮฃ_a V and V โ†ช ๐Ÿ™+ฮฃ_a V (the a-th #

                              copy).

                              def Domain.Neighborhood.Exercise617Gen.sinjU {A : Type} [DecidableEq A] {ฮฒ : Type v} {V : NeighborhoodSystem ฮฒ} {h : โˆ€ (X : Set ฮฒ), V.mem X โ†’ X.Nonempty} :
                              (sumSig A V h).Element

                              The basepoint/๐Ÿ™-injection: the image of the unique point of ๐Ÿ™. Its proper neighbourhood is the ๐Ÿ™-copy jU.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                def Domain.Neighborhood.Exercise617Gen.sinjC {A : Type} [DecidableEq A] {ฮฒ : Type v} {V : NeighborhoodSystem ฮฒ} {h : โˆ€ (X : Set ฮฒ), V.mem X โ†’ X.Nonempty} (a : A) (x : V.Element) :
                                (sumSig A V h).Element

                                The a-th copy injection V โ†ช ๐Ÿ™+ฮฃ_a V: send xโˆˆ|V| to the sum element whose proper neighbourhoods are the a-copies aX with Xโˆˆx.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  @[simp]
                                  theorem Domain.Neighborhood.Exercise617Gen.sinjU_mem_jU {A : Type} [DecidableEq A] {ฮฒ : Type v} {V : NeighborhoodSystem ฮฒ} {h : โˆ€ (X : Set ฮฒ), V.mem X โ†’ X.Nonempty} :
                                  @[simp]
                                  theorem Domain.Neighborhood.Exercise617Gen.sinjC_mem_jc {A : Type} [DecidableEq A] {ฮฒ : Type v} {V : NeighborhoodSystem ฮฒ} {h : โˆ€ (X : Set ฮฒ), V.mem X โ†’ X.Nonempty} {a : A} {x : V.Element} {X : Set ฮฒ} (hX : V.mem X) :
                                  (sinjC a x).mem (jc a X) โ†” x.mem X
                                  theorem Domain.Neighborhood.Exercise617Gen.sinjC_mono {A : Type} [DecidableEq A] {ฮฒ : Type v} {V : NeighborhoodSystem ฮฒ} {h : โˆ€ (X : Set ฮฒ), V.mem X โ†’ X.Nonempty} {a : A} {x x' : V.Element} (hxle : x โ‰ค x') :

                                  The sum map ฮฃ f = I_๐Ÿ™ + ฮฃ_a f and its functoriality. #

                                  def Domain.Neighborhood.Exercise617Gen.sumMapSig {A : Type} [DecidableEq A] {ฮฒโ‚€ ฮฒโ‚ : Type v} {Vโ‚€ : NeighborhoodSystem ฮฒโ‚€} {Vโ‚ : NeighborhoodSystem ฮฒโ‚} {hโ‚€ : โˆ€ (X : Set ฮฒโ‚€), Vโ‚€.mem X โ†’ X.Nonempty} {hโ‚ : โˆ€ (Y : Set ฮฒโ‚), Vโ‚.mem Y โ†’ Y.Nonempty} (f : ApproximableMap Vโ‚€ Vโ‚) :
                                  ApproximableMap (sumSig A Vโ‚€ hโ‚€) (sumSig A Vโ‚ hโ‚)

                                  The indexed sum map ฮฃf = I_๐Ÿ™ + ฮฃ_a f acting as the identity on the ๐Ÿ™-summand and as f on each a-copy. The generic analogue of sumMap3 (idMap unitSys) f f.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    theorem Domain.Neighborhood.Exercise617Gen.isStrict_sumMapSig {A : Type} [DecidableEq A] {ฮฒโ‚€ ฮฒโ‚ : Type v} {Vโ‚€ : NeighborhoodSystem ฮฒโ‚€} {Vโ‚ : NeighborhoodSystem ฮฒโ‚} {hโ‚€ : โˆ€ (X : Set ฮฒโ‚€), Vโ‚€.mem X โ†’ X.Nonempty} {hโ‚ : โˆ€ (Y : Set ฮฒโ‚), Vโ‚.mem Y โ†’ Y.Nonempty} (f : ApproximableMap Vโ‚€ Vโ‚) :

                                    The sum map is strict: it sends โŠฅ = master only to master.

                                    @[simp]
                                    theorem Domain.Neighborhood.Exercise617Gen.sumMapSig_rel {A : Type} [DecidableEq A] {ฮฒโ‚€ ฮฒโ‚ : Type v} {Vโ‚€ : NeighborhoodSystem ฮฒโ‚€} {Vโ‚ : NeighborhoodSystem ฮฒโ‚} {hโ‚€ : โˆ€ (X : Set ฮฒโ‚€), Vโ‚€.mem X โ†’ X.Nonempty} {hโ‚ : โˆ€ (Y : Set ฮฒโ‚), Vโ‚.mem Y โ†’ Y.Nonempty} {f : ApproximableMap Vโ‚€ Vโ‚} {W : Set (SigTok A ฮฒโ‚€)} {W' : Set (SigTok A ฮฒโ‚)} :
                                    (sumMapSig f).rel W W' โ†” (sumSig A Vโ‚€ hโ‚€).mem W โˆง (sumSig A Vโ‚ hโ‚).mem W' โˆง (W' = masterSig Vโ‚ โˆจ W = jU โˆง W' = jU โˆจ โˆƒ (a : A) (X : Set ฮฒโ‚€) (Y' : Set ฮฒโ‚), W = jc a X โˆง W' = jc a Y' โˆง f.rel X Y')
                                    theorem Domain.Neighborhood.Exercise617Gen.sumMapSig_sinjU {A : Type} [DecidableEq A] {ฮฒโ‚€ ฮฒโ‚ : Type v} {Vโ‚€ : NeighborhoodSystem ฮฒโ‚€} {Vโ‚ : NeighborhoodSystem ฮฒโ‚} {hโ‚€ : โˆ€ (X : Set ฮฒโ‚€), Vโ‚€.mem X โ†’ X.Nonempty} {hโ‚ : โˆ€ (Y : Set ฮฒโ‚), Vโ‚.mem Y โ†’ Y.Nonempty} (f : ApproximableMap Vโ‚€ Vโ‚) :

                                    ฮฃf fixes the basepoint injection.

                                    theorem Domain.Neighborhood.Exercise617Gen.sumMapSig_sinjC {A : Type} [DecidableEq A] {ฮฒโ‚€ ฮฒโ‚ : Type v} {Vโ‚€ : NeighborhoodSystem ฮฒโ‚€} {Vโ‚ : NeighborhoodSystem ฮฒโ‚} {hโ‚€ : โˆ€ (X : Set ฮฒโ‚€), Vโ‚€.mem X โ†’ X.Nonempty} {hโ‚ : โˆ€ (Y : Set ฮฒโ‚), Vโ‚.mem Y โ†’ Y.Nonempty} (f : ApproximableMap Vโ‚€ Vโ‚) (a : A) (x : Vโ‚€.Element) :

                                    ฮฃf on the a-copy injection: (ฮฃf)(inj_a x) = inj_a (f x).

                                    theorem Domain.Neighborhood.Exercise617Gen.sumMapSig_id {A : Type} [DecidableEq A] {ฮฒโ‚€ : Type v} {Vโ‚€ : NeighborhoodSystem ฮฒโ‚€} {hโ‚€ : โˆ€ (X : Set ฮฒโ‚€), Vโ‚€.mem X โ†’ X.Nonempty} :

                                    Functoriality (identities): ฮฃ(I) = I.

                                    theorem Domain.Neighborhood.Exercise617Gen.sumMapSig_comp {A : Type} [DecidableEq A] {ฮฒโ‚€ ฮฒโ‚ ฮฒโ‚‚ : Type v} {Vโ‚€ : NeighborhoodSystem ฮฒโ‚€} {Vโ‚ : NeighborhoodSystem ฮฒโ‚} {Vโ‚‚ : NeighborhoodSystem ฮฒโ‚‚} {hโ‚€ : โˆ€ (X : Set ฮฒโ‚€), Vโ‚€.mem X โ†’ X.Nonempty} {hโ‚ : โˆ€ (Y : Set ฮฒโ‚), Vโ‚.mem Y โ†’ Y.Nonempty} {hโ‚‚ : โˆ€ (Z : Set ฮฒโ‚‚), Vโ‚‚.mem Z โ†’ Z.Nonempty} (g : ApproximableMap Vโ‚ Vโ‚‚) (f : ApproximableMap Vโ‚€ Vโ‚) :

                                    Functoriality (composition): ฮฃ(gโˆ˜f) = ฮฃg โˆ˜ ฮฃf.

                                    The endofunctor Tsig(X) = ๐Ÿ™ + ฮฃ_a X on the โˆ…-free category. #

                                    Tsig on objects: Tsig(D) = ๐Ÿ™ + ฮฃ_a D, again โˆ…-free (sumSig_nonempty).

                                    Equations
                                    Instances For

                                      The functor Tsig(X) = ๐Ÿ™ + ฮฃ_{a:A} X on the category of โˆ…-free domains and strict maps.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        @[simp]

                                        Stage 3: the domain equation Cโ‚ โ‰… ๐Ÿ™ + ฮฃ_a Cโ‚. #

                                        The alphabet-generic analogue of Example62C (C โ‰… ๐Ÿ™ + C + C). Prepending the letter a to a neighbourhood gives embA a X; a Cโ‚-neighbourhood is the master, the terminator {ฮ›}, or some a-copy aX, exactly the shapes of the A-indexed sum ๐Ÿ™ + ฮฃ_a Cโ‚.

                                        def Domain.Neighborhood.Exercise617Gen.embA {A : Type} (a : A) (X : Set (Strn A)) :
                                        Set (Strn A)

                                        aX = {a :: w' โˆฃ w' โˆˆ X}: the a-prefixed copy of a neighbourhood.

                                        Equations
                                        Instances For
                                          @[simp]
                                          theorem Domain.Neighborhood.Exercise617Gen.mem_embA {A : Type} {a : A} {X : Set (Strn A)} {w : Strn A} :
                                          w โˆˆ embA a X โ†” โˆƒ (w' : List A), w = a :: w' โˆง w' โˆˆ X
                                          theorem Domain.Neighborhood.Exercise617Gen.embA_coneN {A : Type} (a : A) (ฯƒ : Strn A) :
                                          embA a (coneN ฯƒ) = coneN (a :: ฯƒ)
                                          theorem Domain.Neighborhood.Exercise617Gen.embA_singleton {A : Type} (a : A) (ฯƒ : Strn A) :
                                          embA a {ฯƒ} = {a :: ฯƒ}
                                          theorem Domain.Neighborhood.Exercise617Gen.memCn_embA {A : Type} (a : A) {X : Set (Strn A)} (hX : memCn X) :
                                          memCn (embA a X)
                                          theorem Domain.Neighborhood.Exercise617Gen.nil_not_mem_embA {A : Type} {a : A} {X : Set (Strn A)} :
                                          [] โˆ‰ embA a X
                                          theorem Domain.Neighborhood.Exercise617Gen.embA_inter {A : Type} (a : A) (X X' : Set (Strn A)) :
                                          embA a X โˆฉ embA a X' = embA a (X โˆฉ X')
                                          theorem Domain.Neighborhood.Exercise617Gen.embA_inter_ne {A : Type} {a a' : A} (h : a โ‰  a') (X Y : Set (Strn A)) :
                                          theorem Domain.Neighborhood.Exercise617Gen.embA_injective {A : Type} {a : A} {X X' : Set (Strn A)} (h : embA a X = embA a X') :
                                          X = X'
                                          theorem Domain.Neighborhood.Exercise617Gen.embA_ne {A : Type} {a a' : A} (h : a โ‰  a') {X Y : Set (Strn A)} (hX : X.Nonempty) :
                                          embA a X โ‰  embA a' Y
                                          theorem Domain.Neighborhood.Exercise617Gen.memCn_cases {A : Type} {W : Set (Strn A)} (hW : memCn W) :
                                          W = Set.univ โˆจ W = {[]} โˆจ โˆƒ (a : A) (X : Set (Strn A)), memCn X โˆง W = embA a X

                                          The shape of a Cโ‚-neighbourhood. Every neighbourhood is the master ฮฃ*, the terminator {ฮ›}, or an a-copy aX with X โˆˆ Cโ‚.

                                          The sum target ๐Ÿ™ + ฮฃ_a Cโ‚ and its inversion lemmas. #

                                          @[reducible, inline]

                                          The right-hand side of the domain equation: the A-indexed sum ๐Ÿ™ + ฮฃ_a Cโ‚.

                                          Equations
                                          Instances For
                                            theorem Domain.Neighborhood.Exercise617Gen.sumSig_mem_jc_inv {A : Type} [DecidableEq A] {a : A} {X : Set (Strn A)} (h : (CCn A).mem (jc a X)) :
                                            (Cn A).mem X

                                            The forward half toCC : |Cโ‚| โ†’ |๐Ÿ™ + ฮฃ_a Cโ‚|. #

                                            Forward half of Cโ‚ โ‰… ๐Ÿ™ + ฮฃ_a Cโ‚. Records, for each branch, whether x finishes at ฮ› (the ๐Ÿ™-summand) or reaches the a-copy aX (the a-th summand).

                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For
                                              theorem Domain.Neighborhood.Exercise617Gen.toCC_mem_jc {A : Type} [DecidableEq A] {x : (Cn A).Element} {a : A} {X : Set (Strn A)} (hX : (Cn A).mem X) :
                                              (toCC x).mem (jc a X) โ†” x.mem (embA a X)
                                              theorem Domain.Neighborhood.Exercise617Gen.embA_eq_embA {A : Type} {a a' : A} {X X' : Set (Strn A)} (hXne : X.Nonempty) (h : embA a X = embA a' X') :
                                              a = a' โˆง X = X'

                                              Prefixed copies determine index and set: aX = a'X' (with X non-empty) forces a=a', X=X'.

                                              The inverse half fromCC : |๐Ÿ™ + ฮฃ_a Cโ‚| โ†’ |Cโ‚|. #

                                              Inverse half of Cโ‚ โ‰… ๐Ÿ™ + ฮฃ_a Cโ‚.

                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                theorem Domain.Neighborhood.Exercise617Gen.fromCC_mem_embA {A : Type} [DecidableEq A] {s : (CCn A).Element} {a : A} {X : Set (Strn A)} (hX : (Cn A).mem X) :
                                                (fromCC s).mem (embA a X) โ†” s.mem (jc a X)

                                                The two halves are mutually inverse. #

                                                The isomorphism |Cโ‚| โ‰ƒo |๐Ÿ™ + ฮฃ_a Cโ‚|.

                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For

                                                  Bridging the isomorphism to the successors consMapN. #

                                                  theorem Domain.Neighborhood.Exercise617Gen.consMapN_mem_embA {A : Type} {a : A} {z : (Cn A).Element} {X : Set (Strn A)} (hX : (Cn A).mem X) :

                                                  toCC โˆ˜ (aยท) = inj_a. Prepending the letter a to z is, across Cโ‚ โ‰… ๐Ÿ™+ฮฃ_a Cโ‚, the injection of z into the a-th summand.

                                                  toCC ฮ›ฬ‚ = inj_๐Ÿ™. The finished empty sequence is the terminator (the ๐Ÿ™-summand).

                                                  Cโ‚ as a Tsig-algebra. #

                                                  Cโ‚ as an object of the โˆ…-free category.

                                                  Equations
                                                  Instances For

                                                    The Tsig-algebra structure on Cโ‚. The structure map i : ๐Ÿ™+ฮฃ_a Cโ‚ โ†’ Cโ‚ is the inverse of the domain-equation isomorphism ccEquiv, strict by isStrict_ofIso.

                                                    Equations
                                                    Instances For

                                                      The liftCn combinator: an approximable map out of Cโ‚ (generic #

                                                      Exercise419.liftC).

                                                      A cone is never contained in a singleton: it has the two distinct elements ฯ„ and ฯ„ยทdefault.

                                                      def Domain.Neighborhood.Exercise617Gen.liftCn {A : Type} [Inhabited A] {ฮฒ : Type} (V : NeighborhoodSystem ฮฒ) (coneVal singVal : Strn A โ†’ V.Element) (hcone : โˆ€ {ฯƒ ฯ„ : Strn A}, ฯƒ <+: ฯ„ โ†’ coneVal ฯƒ โ‰ค coneVal ฯ„) (hsing : โˆ€ {ฯƒ ฯ„ : Strn A}, ฯƒ <+: ฯ„ โ†’ coneVal ฯƒ โ‰ค singVal ฯ„) :

                                                      A map Cโ‚ โ†’ V determined by its value coneVal ฯƒ on each partial element ฯƒโŠฅ and singVal ฯƒ on each total element ฯƒ. (The alphabet-generic copy of Exercise419.liftC.)

                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For
                                                        theorem Domain.Neighborhood.Exercise617Gen.liftCn_strBot {A : Type} [Inhabited A] {ฮฒ : Type} (V : NeighborhoodSystem ฮฒ) (coneVal singVal : Strn A โ†’ V.Element) (hcone : โˆ€ {ฯƒ ฯ„ : Strn A}, ฯƒ <+: ฯ„ โ†’ coneVal ฯƒ โ‰ค coneVal ฯ„) (hsing : โˆ€ {ฯƒ ฯ„ : Strn A}, ฯƒ <+: ฯ„ โ†’ coneVal ฯƒ โ‰ค singVal ฯ„) (ฯƒ : Strn A) :
                                                        (liftCn V coneVal singVal โ‹ฏ โ‹ฏ).toElementMap (strBotN ฯƒ) = coneVal ฯƒ
                                                        theorem Domain.Neighborhood.Exercise617Gen.liftCn_strElem {A : Type} [Inhabited A] {ฮฒ : Type} (V : NeighborhoodSystem ฮฒ) (coneVal singVal : Strn A โ†’ V.Element) (hcone : โˆ€ {ฯƒ ฯ„ : Strn A}, ฯƒ <+: ฯ„ โ†’ coneVal ฯƒ โ‰ค coneVal ฯ„) (hsing : โˆ€ {ฯƒ ฯ„ : Strn A}, ฯƒ <+: ฯ„ โ†’ coneVal ฯƒ โ‰ค singVal ฯ„) (ฯƒ : Strn A) :
                                                        (liftCn V coneVal singVal โ‹ฏ โ‹ฏ).toElementMap (strElemN ฯƒ) = singVal ฯƒ
                                                        theorem Domain.Neighborhood.Exercise617Gen.map_ext_Cn {A ฮฒ : Type} {V : NeighborhoodSystem ฮฒ} {f g : ApproximableMap (Cn A) V} (hbot : โˆ€ (ฯƒ : Strn A), f.toElementMap (strBotN ฯƒ) = g.toElementMap (strBotN ฯƒ)) (helem : โˆ€ (ฯƒ : Strn A), f.toElementMap (strElemN ฯƒ) = g.toElementMap (strElemN ฯƒ)) :
                                                        f = g

                                                        Two maps out of Cโ‚ agree once they agree on every ฯƒโŠฅ and ฯƒ (generic Exercise516.map_ext_C).

                                                        Initiality of (Cโ‚, i): the unique homomorphism into any Tsig-algebra. #

                                                        The distinguished point e = k(inj_๐Ÿ™): the image under k of the terminator.

                                                        Equations
                                                        Instances For

                                                          The a-th successor operation f_a = k โˆ˜ inj_a.

                                                          Equations
                                                          Instances For

                                                            The recursion ฯ†(ฮ›)=z, ฯ†(aยทฯƒ)=f_a(ฯ†(ฯƒ)) on a finite string, with base value z.

                                                            Equations
                                                            Instances For
                                                              theorem Domain.Neighborhood.Exercise617Gen.descF_mono {A : Type} [DecidableEq A] (B : TAlgebra (Tsig A)) (a : A) {y y' : B.carrier.sys.Element} (h : y โ‰ค y') :
                                                              descF B a y โ‰ค descF B a y'
                                                              theorem Domain.Neighborhood.Exercise617Gen.descVal_mono_z {A : Type} [DecidableEq A] (B : TAlgebra (Tsig A)) {z z' : B.carrier.sys.Element} (h : z โ‰ค z') (ฯƒ : Strn A) :
                                                              descVal B z ฯƒ โ‰ค descVal B z' ฯƒ
                                                              theorem Domain.Neighborhood.Exercise617Gen.descVal_append {A : Type} [DecidableEq A] (B : TAlgebra (Tsig A)) (z : B.carrier.sys.Element) (ฯƒ ฯ : Strn A) :
                                                              descVal B z (ฯƒ ++ ฯ) = descVal B (descVal B z ฯ) ฯƒ
                                                              theorem Domain.Neighborhood.Exercise617Gen.descMap_hcone {A : Type} [DecidableEq A] (B : TAlgebra (Tsig A)) {ฯƒ ฯ„ : Strn A} (h : ฯƒ <+: ฯ„) :
                                                              theorem Domain.Neighborhood.Exercise617Gen.descMap_hsing {A : Type} [DecidableEq A] (B : TAlgebra (Tsig A)) {ฯƒ ฯ„ : Strn A} (h : ฯƒ <+: ฯ„) :
                                                              descVal B B.carrier.sys.bot ฯƒ โ‰ค descVal B (descE B) ฯ„

                                                              The homomorphism Cโ‚ โ†’ E, built by liftCn from the head-recursion.

                                                              Equations
                                                              • One or more equations did not get rendered due to their size.
                                                              Instances For

                                                                The homomorphism square and uniqueness. #

                                                                Any map satisfying the homomorphism recursion equals descMap.

                                                                Cโ‚'s algebra map satisfies the recursion.

                                                                The homomorphism square desc โˆ˜ i = k โˆ˜ T(desc).

                                                                The descent homomorphism (Cโ‚, i) โ†’ (E, k) as a Tsig-algebra homomorphism.

                                                                Equations
                                                                Instances For

                                                                  Uniqueness. Any Tsig-algebra homomorphism out of (Cโ‚, i) equals descAlgHom.

                                                                  Exercise 6.17 part 2 โ€” (Cโ‚, i) is an initial Tsig-algebra for Tsig(X) = ๐Ÿ™ + ฮฃ_a X. The descent map ฯ† : Cโ‚ โ†’ E is the closed-form head-recursion ฯ†(ฮ›) = e, ฯ†(aยทx) = f_a(ฯ† x) (f_a = k โˆ˜ inj_a), built choice-free via liftCn; it is the unique Tsig-algebra homomorphism, so Cโ‚ is the initial algebra of X โ†ฆ ๐Ÿ™ + ฮฃ_a X.

                                                                  Equations
                                                                  Instances For

                                                                    Exercise 6.17 part 2 โ€” the domain equation Cโ‚ โ‰… ๐Ÿ™ + ฮฃ_a Cโ‚.

                                                                    Instantiation: Cโ‚™ โ‰… ๐Ÿ™ + nยทCโ‚™ over the n-letter alphabet Fin (n+1). #

                                                                    Taking A := Fin (n+1) recovers Scott's Cโ‚™: the domain of finite-or-infinite sequences over an (n+1)-letter alphabet, satisfying Cโ‚™ โ‰… ๐Ÿ™ + (n+1)ยทCโ‚™. (For n = 1, Fin 2 โ‰ƒ Bool recovers Example 6.2's C โ‰… ๐Ÿ™ + C + C.)

                                                                    Cโ‚™ โ‰… ๐Ÿ™ + (n+1)ยทCโ‚™ over the alphabet Fin (n+1).

                                                                    Cโ‚™ is the initial algebra of X โ†ฆ ๐Ÿ™ + ฮฃ_{Fin (n+1)} X.

                                                                    Equations
                                                                    Instances For