163 research outputs found
Relative monads formalised
Relative monads are a generalisation of ordinary monads where the underlying functor need not be an endofunctor. In this paper, we describe a formalisation of the basic theory of relative monads in the interactive theorem prover and dependently typed programming language Agda. The formalisation comprises the requisite basic category theory, the central concepts of the theory of relative monads and adjunctions, which are compared to their ordinary counterparts, and two running examples from programming theory
Two-Level Type Theory and Applications
We define and develop two-level type theory (2LTT), a version of Martin-L\"of
type theory which combines two different type theories. We refer to them as the
inner and the outer type theory. In our case of interest, the inner theory is
homotopy type theory (HoTT) which may include univalent universes and higher
inductive types. The outer theory is a traditional form of type theory
validating uniqueness of identity proofs (UIP). One point of view on it is as
internalised meta-theory of the inner type theory.
There are two motivations for 2LTT. Firstly, there are certain results about
HoTT which are of meta-theoretic nature, such as the statement that
semisimplicial types up to level can be constructed in HoTT for any
externally fixed natural number . Such results cannot be expressed in HoTT
itself, but they can be formalised and proved in 2LTT, where will be a
variable in the outer theory. This point of view is inspired by observations
about conservativity of presheaf models.
Secondly, 2LTT is a framework which is suitable for formulating additional
axioms that one might want to add to HoTT. This idea is heavily inspired by
Voevodsky's Homotopy Type System (HTS), which constitutes one specific instance
of a 2LTT. HTS has an axiom ensuring that the type of natural numbers behaves
like the external natural numbers, which allows the construction of a universe
of semisimplicial types. In 2LTT, this axiom can be stated simply be asking the
inner and outer natural numbers to be isomorphic.
After defining 2LTT, we set up a collection of tools with the goal of making
2LTT a convenient language for future developments. As a first such
application, we develop the theory of Reedy fibrant diagrams in the style of
Shulman. Continuing this line of thought, we suggest a definition of
(infinity,1)-category and give some examples.Comment: 53 page
Adventures in Formalisation: Financial Contracts, Modules, and Two-Level Type Theory
We present three projects concerned with applications of proof assistants in
the area of programming language theory and mathematics. The first project is
about a certified compilation technique for a domain-specific programming
language for financial contracts (the CL language). The code in CL is
translated into a simple expression language well-suited for integration with
software components implementing Monte Carlo simulation techniques (pricing
engines). The compilation procedure is accompanied with formal proofs of
correctness carried out in Coq. The second project presents techniques that
allow for formal reasoning with nested and mutually inductive structures built
up from finite maps and sets. The techniques, which build on the theory of
nominal sets combined with the ability to work with isomorphic representations
of finite maps, make it possible to give a formal treatment, in Coq, of a
higher-order module system, including the ability to eliminate at compile time
abstraction barriers introduced by the module system. The development is based
on earlier work on static interpretation of modules and provides the foundation
for a higher-order module language for Futhark, an optimising compiler
targeting data-parallel architectures. The third project presents an
implementation of two-level type theory, a version of Martin-Lof type theory
with two equality types: the first acts as the usual equality of homotopy type
theory, while the second allows us to reason about strict equality. In this
system, we can formalise results of partially meta-theoretic nature. We develop
and explore in details how two-level type theory can be implemented in a proof
assistant, providing a prototype implementation in the proof assistant Lean. We
demonstrate an application of two-level type theory by developing some results
on the theory of inverse diagrams using our Lean implementation.Comment: PhD thesis defended in January 2018 at University of Copenhagen,
Department of Computer Scienc
W-types in setoids
W-types and their categorical analogue, initial algebras for polynomial
endofunctors, are an important tool in predicative systems to replace
transfinite recursion on well-orderings. Current arguments to obtain W-types in
quotient completions rely on assumptions, like Uniqueness of Identity Proofs,
or on constructions that involve recursion into a universe, that limit their
applicability to a specific setting. We present an argument, verified in Coq,
that instead uses dependent W-types in the underlying type theory to construct
W-types in the setoid model. The immediate advantage is to have a proof more
type-theoretic in flavour, which directly uses recursion on the underlying
W-type to prove initiality. Furthermore, taking place in intensional type
theory and not requiring any recursion into a universe, it may be generalised
to various categorical quotient completions, with the aim of finding a uniform
construction of extensional W-types.Comment: 17 pages, formalised in Coq; v2: added reference to formalisatio
Handling Fibred Algebraic Effects
International audienceWe study algebraic computational effects and their handlers in the dependently typed setting. We describecomputational effects using a generalisation of Plotkin and Pretnar’s effect theories, whose dependentlytyped operations allow us to capture precise notions of computation, e.g., state with location-dependent storetypes and dependently typed update monads. Our treatment of handlers is based on an observation that theirconventional term-level definition leads to unsound program equivalences being derivable in languages thatinclude a notion of homomorphism. We solve this problem by giving handlers a novel type-based treatmentvia a new computation type, the user-defined algebra type, which pairs a value type (the carrier) with a set ofvalue terms (the operations), capturing Plotkin and Pretnar’s insight that effect handlers denote algebras. Wethen show that the conventional presentation of handlers can be routinely derived, and demonstrate that thistype-based treatment of handlers provides a useful mechanism for reasoning about effectful computations.We also equip the resulting language with a sound denotational semantics based on families fibrations
Boundary Algebra: A Simpler Approach to Boolean Algebra and the Sentential Connectives
Boundary algebra [BA] is a algebra of type , and a simplified notation for Spencer-Brown’s (1969) primary algebra. The syntax of the primary arithmetic [PA] consists of two atoms, () and the blank page, concatenation, and enclosure between ‘(‘ and ‘)’, denoting the primitive notion of distinction. Inserting letters denoting, indifferently, the presence or absence of () into a PA formula yields a BA formula. The BA axioms are A1: ()()= (), and A2: “(()) [abbreviated ‘⊥’] may be written or erased at will,” implying (⊥)=(). The repeated application of A1 and A2 simplifies any PA formula to either () or ⊥. The basis for BA is B1: abc=bca (concatenation commutes & associates); B2, ⊥a=a (BA has a lower bound, ⊥); B3, (a)a=() (BA is a complemented lattice); and B4, (ba)a=(b)a (implies that BA is a distributive lattice). BA has two intended models: (1) the Boolean algebra 2 with base set B={(),⊥}, such that () ⇔ 1 [dually 0], (a) ⇔ a′, and ab ⇔ a∪b [a∩b]; and (2) sentential logic, such that () ⇔ true [false], (a) ⇔ ~a, and ab ⇔ a∨b [a∧b]. BA is a self-dual notation, facilitates a calculational style of proof, and simplifies clausal reasoning and Quine’s truth value analysis. BA resembles C.S. Peirce’s graphical logic, the symbolic logics of Leibniz and W.E. Johnson, the 2 notation of Byrne (1946), and the Boolean term schemata of Quine (1982).Boundary algebra; boundary logic; primary algebra; primary arithmetic; Boolean algebra; calculation proof; G. Spencer-Brown; C.S. Peirce; existential graphs
- …