Over the last few decades, software has become essential for the proper functioning of systems in the modern world. Formal verification techniques are slowly being adopted in various industrial application areas, and there is a big demand for research in the theory and practice of formal techniques to achieve a wider acceptance of tools for verification.We present three projects concerned with applications of certified programming techniques and 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 the Coq proof assistant. Moreover, we develop techniques for capturing the dynamic behaviour of contracts with the passage of time. These techniques potentially allow for efficient integration of contract specifications with high-performance pricing engines running on GPGPU hardware.The second project presents a number of techniques that allow for formal reasoning with nested and mutually inductive structures built up from finite maps and sets (also called semantic objects), and at the same time allow for working with binding structures over sets of variables. The techniques, which build on the theory of nominal sets combined with the ability to work with multiple 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 entirely, 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, such as GPGPUs.The third project is related to homotopy type theory (HoTT), a new branch of mathematics based on a fascinating idea connecting type theory and homotopy theory. HoTT provides us with a new foundation for mathematics allowing for developing machine-checkable proofs in various areas of computer science and mathematics. Along with Vladimir Voevodsky's univalence axiom, HoTT offers a formal treatment of the informal mathematical principle: equivalent structures can be identified. However, in some cases, the notion of weak equality available in HoTT leads to the "infinite coherence" problem when defining internally certain structures (such as a type of n-restricted semi-simplicial types, inverse diagrams and so on). We explain the basic idea of two-level type theory, a version of Martin-Löf 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 ...