CAS CS 400
Type Theory and Mechanized Reasoning
Boston University
Spring 2024

This course is an introduction to basic concepts in type theory and mechanized proof as they relate to programming languages, formal verification, mathematics, and philosophy. We will only be able to cover a (biased) selection of rudiments, but the goal is to provide students (you) with the tools to:

Prerequisites: CS131, CS330, CS320 (CS332 is recommended but not required)

Links

Schedule

Date Topic Notes
01-22 What is this course?  
01-24 Induction and Recursion HW00 out
01-29 Agda I: An Introduction  
02-01 Agda II: Dependent Types HW01 out
02-05 Propositional Logic I: An Introduction  
02-07 Propositional Logic II: Meta-Theory HW01 due, HW02 out
02-12 SAT-Solvers I: An Introduction  
02-14 SAT-Solvers II: In Practice HW02 due, HW03 out
02-19 NO CLASS Presidents’ Day
02-21 Propositional Proofs HW03 due, HW04 out
02-26 The Lambda Calculus I: An Introduction  
02-28 The Lambda Calculus II: Meta-Theory HW04 due, HW05 out
03-04 Simple Types I: An Introduction  
03-06 Simple Types II: The Curry-Howard Isomorphism HW05 due, proposal out
  SPRING RECESS  
03-18 Agda III: The Proof Assistant  
03-20 Agda IV: Equational Reasoning proposal due, HW07 out
03-25 Case Study I: STLC in Agda  
03-27 Case Study II: Verified Sorting HW07 due, HW08 out
04-01 Intuitionistic Logic I: An introduction  
04-03 Intuitionistic Logic II: Kripke Semantics HW08 due, HW09 out
04-08 Polymorphism I: In Introduction  
04-10 Polymorphism II: Logic in System F HW09 due, HW10 out
04-15 NO CLASS Patriots’ Day
04-17 Dependent type theory I: An introduction HW10 due
04-22 Mathematics with a Human Face (NO CLASS) Attend for Ex. Credit
04-24 Dependent type theory II: Meta-Theory  
04-29 Advanced: Type-theoretic paradoxes  
05-01 Final Project Presentations  

Topics

What is this course?

Induction and Recursion

Agda I: An Introduction

  • Summary:
    • examine at Agda as a function programming language, especially as compared to OCaml (the language of CAS CS 320)
    • start looking at dependent types and what we can do with them
  • Reading:

Agda II: Dependent Types

  • Summary:
    • play with dependent types, with the goal of seeing some of their strangeness, not necessarily understanding how they work
    • start to think about how dependent types can be used to represent "properties" and how that might be useful for mechanized reasoning
  • Reading:

Propositional Logic I: An Introduction

Propositional Logic II: Meta-Theory

  • Summary:
    • dive deeper into pattern matching in Agda, introducing with-abstraction for pattern matching on intermediate computations
    • introduce semantic notions in logic, particularly up to the notion of logical equivalence
  • Reading:

SAT-Solvers I: An Introduction

SAT-Solvers II: In Practice

  • Summary:
    • look at a couple encodings of propositions as CNF formulas
    • look at an example application of SAT-solvers
  • Reading:

Propositional Proofs

  • Summary:
    • define the notion of a proof system and a Gentzen-style sequent proof
    • introduce resolution as an example of a proof system
    • demonstrate the connection between resolution and DPLL.
  • Reading:

The Lambda Calculus I: An Introduction

The Lambda Calculus II: Meta-Theory

  • Summary:
    • introduce semantic notions of the lambda calculus, including normalization and evaluation strategies.
    • look at how to encode data.
    • talk breifly about De Bruijn indices and alpha equivalence.
  • Reading:

Simple Types I: An Introduction

Simple Types II: The Curry-Howard Isomorphism

Agda III: The Proof Assistant

Agda IV: Equational Reasoning

  • Summary:
    • discuss how to prove complex equalities in Agda
    • see many examples in code
  • Reading:

Case Study I: STLC in Agda

  • Summary:
    • see how to formalize the simply typed lambda calculus in Agda
    • prove several meta-theoretic lemmas, leading to type preservation
  • Reading:
    • look through the code from lecture

Case Study II: Verified Sorting

  • Summary:
    • verify that (functional) insertion sort returns an ordered list
    • see the connections between how the algorithm is written and how properties are proved about it
  • Reading:
    • look through the code from lecture

Intuitionistic Logic I: An introduction

  • Summary:
    • introduce a proof system for intuitionistic propositional logic with propositional variables (IPL) as the simply typed lambda calculus with type variables with type variables (STLC) minus the computational content
    • introduce a proof system for classical propositional logic (CPL) as IPL plus a variant of proof by contradiction
    • look at classical principles which are not intuitionistically provable
    • see what is gained by thinking intuitionistically (e.g., the disjunction property)
  • Reading:
    • please look through the lecture slides

Intuitionistic Logic II: Kripke Semantics

  • Summary:
    • recall the notions of soundness and completeness
    • note that IPL is not complete with respect to valuations
    • present Kripke models as an alternative semantics for which IPL is sound and complete
    • use Kripke countermodels to prove that some classical principles cannot be proved in IPL
  • Reading:
    • please look through the lecture slides

Polymorphism I: In Introduction

  • Summary:
    • look generally the notion of polymorphism
    • introduce System F as a typed lambda calculi with polymorphism
    • discuss briefly the role of type annotations in type checking and type inference
  • Reading:
    • please look through the lecture slides

Polymorphism II: Logic in System F

  • Summary:
    • recap System F
    • look at how to represent logical connectives in System F
    • briefly discuss unification, implicit variables, and the type inference problem

Dependent type theory I: An introduction

Dependent type theory II: Meta-Theory

Advanced: Type-theoretic paradoxes