transport refl x
bc
transport p := transp (λ i → p i) i0 ,
and transp (λ i → A) i xis actually transp refl i x, which at i := i0 is transp refl i0 x which is transport refl x
transport refl x
bc
transport p := transp (λ i → p i) i0 ,
and transp (λ i → A) i xis actually transp refl i x, which at i := i0 is transp refl i0 x which is transport refl x
Let’s look at how to visualise these squares. First, we should note the direction our axes go in: i varies from the left to the right, and j varies top-to-bottom. The drop-i square is constant in the i direction, but in the j direction, it’s p. This manifests in the diagram as having refl for both of its vertical faces: on the left, we’re looking at p(i0)=a not varying along the vertical axis, and respectively for p(i1)=b on the right. For the drop-j square, the situation is flipped, since we’re now ignoring the horizontal direction.
the squares seem to be flipped wrt to their description, i.e. horizontal vs vertical
the terminology from before
link to fibrations?
union pattern
"|" used as syntax, read as either a disjunction or fallthrough… interesting
pattern
so this is a difference to haskell, bc + is a defined function occurring in a pattern, not a constructor. Also, the pattern is non-linear.
Aha, so this point is addressed later on.
Parametrize the sorted list by a lower bound on the values it contains. For a cons cell the head should be smaller than the lower bound, and the tail should be larger than the head. This requires the type to have a smallest element, but you can adjoin -∞ with a new datatype.
this is the way it's done in "How to keep your neighbors in order"
either recur on a smaller input
combine the results of recursive invocations on smaller input
not only is this boring to write, but any future changes (such as added constructors or fields) to Expr will force us to rewrite it
making refactoring more difficult
core behavior
business logic
though it is always an opfibration.
via the covariant induced Σ_f postcomposition functor
Widerspruchsbeweis
this is only a Widerspruchsbeweis bc Kontraposition has been applied to the proof obligation 🤨
Any property-like structure can be “algebraicized” by requiring a specific choice of the objects that are required to exist; a cleavage is this “algebraicization” for the property of being a Grothendieck fibration
like a functor for products
An interesting case is that of map :: (a -> b) -> [a] -> [b]. We note that both the input and output of this function are lists, and thus might suspect the function can be written as either a catamorphism or an anamorphism. And indeed, it can be:
unless you defined ana/cata using map…
This means that the version of Agda you’re pinning needs to align with the version of Agda installed globally.
Not necessarily. If you install the emacs package agda2-mode globally (which e.g. allows you to use the agda-input-method globally), but not agda, it will pick up the local agda executable from the path, which you can set as described below. You might still get a mismatch between your globally installed agda-mode and the agda version on your path, but you can execute C-c + C-x + C-s and pass it an empty string. This calls agda2-set-program-version and tells it to use the agda and agda-mode executables from PATH, which have the correct local versions.
So, follow along to set up this combination of incredibly niche tools that you almost certainly have zero interest in. 😜
the fact that many readers of this blogposts probably encounter it searching for "agda" and "nix" prbly preselects an audience that almost certainly has quite a big interest in this precise combination of tools
alternatively, we could have updated the bounds in the return type to ensure they include the inserted element
that one would seem to make more sense but it causes green slime. Feel like the tradeoffs should be addressed.
lookup
this isn't proven correct. We have lkp x t = x \in t, but not x \nin t <=> lkp x t = nothing. Basically it is only a partial decision procedure for ∈
The proofs insert-sound₂ and insert-complete
extrinsic verification
{{l≤u : lower ≤ upper}}
Conor also doesn't have this
y
does this somehow become an implicit argument? It seems so from later uses, but how do generalized variables decide when to generalize implicitly?
More importantly, its type was earlier declared to be A, but it should be [ A ]∞ ??
Ok so it appears that the generalized vars can be instantiated to different things – I don't know if at a term- or module level.
Ok so if you look at the next line, already they're instantiated to something else. So apparently you can do this even at the clause level.
Btw the source code for this blog can be found at https://github.com/jespercockx/agda2scheme/blob/12ff5dcaebfe38dfbfdb48d4fb97bbbe2aa792d9/test/formalize-all-the-things.agda, there doesn't seem to be a lagda file though.
data _≤∞_ : [ A ]∞ → [ A ]∞ → Set
in the original, [_]∞ is a function to Set
{{Ord-Nat}}
why is it in instance brackets in its own definition by copattern matching?
So (m < suc n)
this means we don't have to pattern-match on the case {m = m}, {n = zero}
To do this, we define an ‘instance’ that automatically constructs a proof of m ≤ n when m and n are natural number literals.
Ok so yet another redundancy where you can express your decision procedure in a different format…
Note how A and B are implicitly quantified in the type of mapMaybe!
Could one also write:
agda
data Maybe : Set where
just : A → Maybe A
nothing : Maybe A
? For maximum confusion, as it were
programs that produce proofs
this means metaprogramming, unless one says "programs that are proofs", which is just programming.
4. To comply with the terms of (a debt or promise, for example).
this is the sense in which the word is used in "to discharge a proof obligation"
This is a a bit of a hack, but we don’t really expect getRouteFor to ever return Nothing, as that would mean we have been asked to add a menu entry for a file that will not exist on the site.
silent failure is never good. Often 'the impossible' happens. Do sanity checks, assertions
First time I've seen someone explicitly point out Hypothes.is! I'm currently trying to find a static site generator that will best suit me (I'm planning to make posts about Haskell and Nix in the beginning). I previously looked into https://utteranc.es/ as a comments system, but I do like the hypothes.is feature of comments being tied to particular text.
meaning
semantics
no value
again, undefined? though I suppose one would have to pass it @a as type parameter then, to inform ghc
completely uninhabited
except for undefined - and couldn't one use it if typeOf matches its argument with an _?
Teilaussage
Was ist damit gemeint??