Σ⊣*⊣Π

Jan. 4th, 2021 07:42 pm
juan_gandhi: (Default)
Given a topos ℰ and an internal functor f: C → D in ℰ between two internal categories, we have three adjoint functors, Σf⊣f*⊣Πf.

These two functors, Σf and Πf, can be viewed as giving left and right Kan extensions for diagrams (copresheaves) of C along f.

Meaning, for a copresheaf X: C → ℰ,

Σf(X) = Lanf(X)

Πf(X) = Ranf(X)

(I mean, I'm still stuffing Kan extensions into my brain, and this picture is what makes the picture clearer)

P.S. Ха! Оказалось, что это теорема, и доказывается через Йонеду.

Theorem 2.6. If the Kan extensions exist for all F, then LanK− and RanK− are
respectively the left and right adjoints to the functor − ○ K which is precomposition with K.

til

Jul. 4th, 2019 05:09 pm
juan_gandhi: (Default)
Copresheaf. Just a diagram, or a presheaf over op-category. Also, a notation I could not recognize at first: Set. Just Set𝟚.
juan_gandhi: (Default)
Закончил свою логику. (Ну там тесты еще всю ночь побегут, но это фигня, мираж.)
juan_gandhi: (Default)
 def checkDistributivity(cat: Category): MatchResult[Any] = {
  val topos = new CategoryOfDiagrams(cat)
import topos._
val points = Ω.points

val desc = s"Testing ${cat.name} distributivity laws"
println(desc)

for { pt1 ← points } {
println(s" at ${pt1.tag}")
val p = predicateFor(pt1)

for { pt2 ← points } {
val q = predicateFor(pt2)
val pAndQ = p ∧ q
val pOrQ = p ∨ q

for { pt3 ← points } {
val r = predicateFor(pt3)
// distributivity of conjunction over disjunction
(p ∧ (q ∨ r)) === (pAndQ ∨ (p ∧ r))
// distributivity of disjunction over conjunction
(p ∨ (q ∧ r)) === (pOrQ ∧ (p ∨ r))
}
}
}

ok
}
juan_gandhi: (Default)

for { p <- Ω.points } {
val pp = predicateFor(p)
(True ∧ pp) === pp
(False ∧ pp) === False

// idempotence
(pp ∧ pp) === pp

for { q <- Ω.points } {
val pq = predicateFor(q)
val ppq = pp ∧ pq

// commutativity
(pp ∧ pq) === (pq ∧ pp)

for { r <- Ω.points } {
val pr = predicateFor(r)
// associativity
(ppq ∧ pr) === (pp ∧ (pq ∧ pr))
}
}
}

juan_gandhi: (Default)
Woke up at 4:20, went to fix my topos logic code. Done by 5:59. Happiness! 
juan_gandhi: (Default)
Reminds me what we did in Forth, with Leo, present here:

      applyTo | "a" | "b"  | "c" | "d"  | "e" |
      at("a") | "a" | "ab" | ""  | ""   | ""  |
      at("b") | ""  | "b"  | ""  | ""   | ""  |
      at("c") | ""  | "cb" | "c" | "cd" | ""  |
      at("d") | ""  | ""   | ""  | "d"  | ""  |
      at("e") | ""  | ""   | ""  | "ed" | "e" 


This is a test case. Rather, 25 test cases.
We scan through at("a") to at("e"), where at(x) is a representable diagram (presheaf, functor, whatever) for object x:
      val at = (obj: topos.site.Obj) => topos.representable(obj)


and then, in each row, apply this representable to objects "a",..., "e", and check that the result is a set (hom(x, y)) consisting of the values in the cells of the table. The values in the table are split by comma and converted to sets - because we deal with Grothendieck toposes.

But toposes are not essential here. I just decided to be lazy, and write code as tables, as Leo suggested eons ago, probably in 1989. It's not even my idea.

Implementation:
      val at = (obj: topos.site.Obj) => topos.representable(obj)
      
      case class table(data: List[String] = Nil) {
        def |(x: String): table = table(x::data)
        def |(d: Diagrams.Diagram) = check(d, data, data)
      }

      case class check(d: Diagram, data: List[String], fullList: List[String]) {
        def |(x: String): check = {
            d(data.head) === x.split(",").toSet
            check(d, data.tail, fullList)
        }
        def |(d: Diagram): check = check(d, fullList, fullList)
      }

      val applyTo = new table
juan_gandhi: (Default)
  private def diagonalize[T](f: Int => T): PartialFunction[(Int, Int), T] =
      { case (i, j) if i == j => f(i) }

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

June 2025

S M T W T F S
1 234567
891011121314
15161718192021
22232425262728
2930     

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 6th, 2025 02:54 am
Powered by Dreamwidth Studios