Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.org

Mapping between the course and the book

Short version: study week N = book chapter N.

More details below.

Week 1 lecture videos:

  • video short-hands: Lw.l.p is week w, lecture l, part p The l=0 case are the “extra lectures on Haskell”.
L1.0.100:00TDD: id, const, (.)§1.2
L1.0.200:00(,), swap, fst§1.2
L1.0.210:58tupling transform§1.2
L1.0.300:00Either, Left, Right§1.2
L1.0.304:12either, patterns§1.2
L1.1.100:00L1.1 Course admin
L1.1.118:00DSL definition§1.1.1
L1.1.120:00Jamboard examples§1.7
L1.1.125:00“the function f(x)”§1.7
L1.1.127:00Types§1.1
L1.1.131:00enum Bool->Bool§1.1.2
L1.1.200:00Haskell intro§1.2
L1.1.205:20enum Bool->Bool§1.1.2
L1.1.209:50floating point§1.1.3
L1.1.215:00Associative law§1.6
L1.1.218:47DSL for expressions§1.2
L1.1.226:30Expr. of one var.§1.7
L1.1.243:00TA intr. themselves
L1.2.100:00L1.2 Course admin
L1.2.200:00N->Z->Q->R->C
L1.2.301:00Live code complex§1.4
L1.2.400:00Complex cont.§1.4
L1.2.402:57Eq check + deriving§1.4
L1.2.414:18DSL complex§1.5
L1.2.438:20Types§1.2

Week 2 lecture videos:

L2.1.100:00L2.1 admin§2
L2.1.200:00Propositional Calculus§2.1
L2.1.203:20Truth table for (=>)§2.1.2
L2.1.206:24Truth tab. swap§2.1.2
L2.1.210:30Tautology§2.1.2
L2.1.213:37data Prop, eval start§2.1.1
L2.1.226:08AndIntro, OrIntroL§2.1.3
L2.1.230:06fst, snd, orElim§2.1.6
L2.1.300:00Pure set theory§2.3
L2.1.308:49union, card examples§2.3
L2.1.317:05union computation table§2.3
L2.1.400:00live coding Prop, eval§2.1
L2.1.403:40impl. eval without Name§2.1
L2.1.407:21eval: adding Name case§2.1
L2.1.412:35lift2 and friends§1.3
L2.2.100:00First Order Logic§2.2
L2.2.104:29FOL predicate examples§2.2
L2.2.108:39Quantifiers§2.2.2
L2.2.115:38data FOL, data Dom§2.2
L2.2.121:38GADTs extension mention§2.2
L2.2.123:00Interpret FOL-syntax§2.2
L2.2.127:48Typed quantifiers§2.2.4
L2.2.132:58de Morgan, not quant.§2.2.4
L2.2.200:00Proof by contradiction§2.4.1
L2.2.214:34Proof by cases§2.4.2
L2.2.300:00Live code: proof terms§2.1.5
L2.2.308:38inhabited types are Tru§2.1.6
L2.2.313:02Or p q => Or q p§2.1.6
L2.2.315:18Not(Not(Or p (Not p)))§2.1.7
L2.3.100:00Prop and its eval§2.1.1
L2.3.103:16data Proof + checkProof§2.1.3
L2.3.109:06checkProof examples§2.1.4

Week 3 lecture videos:

L3.1.100:00Limit of function§2.5.3
L3.1.106:01Scope check lim logic§2.5.3
L3.1.200:00Lim properties and types§3.1
L3.1.210:30Deriv. of function§3.1
L3.1.300:00Deriv. examples§3.1
L3.1.305:00D (^2) = (2*)§3.1
L3.1.312:12D (f + g) = D f + D g§3.1
L3.1.400:00Live coding deriv in Haskell§3.6
L3.1.407:41deriv :: FunExp -> FunExp§3.6
L3.2.100:00Lecture 3.2 admin
L3.2.200:00Partial derivatives quote§3.2
L3.2.213:01Partial derivatives types§3.4,§3.2
L3.2.225:26Expressions, functions, notation§3.2
L3.2.230:48Partial derivatives examples§3.2
L3.2.300:00Lagrangian case study§3.3
L3.2.321:51Lagrangian example§3.3
L3.2.400:00Haskell type classes in general§3.5
L3.2.404:41class Additive, Double, FunExp§3.5
L3.3.100:00data FunExp, eval, R->R§3
L3.3.104:45deriv :: FunExp -> FunExp§3.6
L3.3.117:20class Additive, Multiplicative§3.5
L3.3.125:51numeric instances for functions§3.5.3

Week 4 lecture videos:

L4.1.100:00Homomorphisms, H2, H1, H0§4.2
L4.1.200:00Example: H2(odd,+,xor)§4.3.1
L4.1.217:50not Exists op. H2(isPrime,+,op)§4.3.2
L4.1.300:00Live coding H2(h,(+),(*))§4.3
L4.1.400:00Compositional semantics & Folds§4.3
L4.1.407:24fold for integer expressions§4.4
L4.1.416:06Define your own equality§4.4
L4.1.418:59evenIE as a fold instance§4.4
L4.1.500:00Make your own type class§4.4
L4.2.100:00Prove deriv is not a homomorphism§4.6
L4.2.113:40Core of the proof by contradiction§4.6
L4.2.200:00tupling: der2 : F -> (F, F)§4.6
L4.2.300:00live coding der2, tupling transform§4.6
L4.2.308:30der2 :: F -> Bi F; homomorphism§4.6
L4.2.319:27type class for FunExp + instances§4.5
L4.3.100:00Structural homomorphism§4.2
L4.3.200:00Live coding Monoid, Ring, Field§4.1

Week 5 lecture videos:

L5.1.100:00Live coding applyFD§4.6.1
L5.1.121:43Bi a = (pos, speed)§4.6.1
L5.1.127:31equational reasoning: mulBi from mulFD§4.6.1
L5.1.200:00Polynomials: types + eval + examples§5.1
L5.1.200:00Chebyshev polynomials§5.1
L5.1.300:00Polynomials and homomorphisms§5.1
L5.1.300:00Equational reasoning (eval for Poly (+))§5.1
L5.2.100:00Is degree maybe a homomorphism?§5.2, §5.3
L5.2.200:00Polynomial division§5.4, §5.5
L5.2.300:00Live coding polynomials: types, eval§5.1
L5.2.400:00Coding the polynomial Ring in Haskell§5.1
L5.2.500:00Power Series, deriv, integ, exp example§5.6

Week 6 lecture videos:

L6.1.100:00Power Series and Ordinary Differential Equations§6.4
L6.1.200:00Power Series transform for solving ODEs§6.4
L6.1.300:00Taylor & Maclaurin series§6.1&§6.3
L6.1.400:00Live coding: Power Series reminder§6.3
L6.1.412:25Specification + type of “derivative series”§6.1
L6.1.419:11Implement derDS, integDS, xDS, etc.§6.2
L6.1.432:51Implement mulDS (for “derivative series”)§6
L6.2.100:00FunExp special: fromRational . toRational§6.6
L6.2.103:30FunExp recap: the Transcendental part§6.6
L6.2.113:20Generic evaluator example: exp (-x²)§6.6
L6.2.117:30derivative series Transcendental instances§6.5
L6.2.200:00Power series transform in Haskell§6.4

Week 7 lecture videos: [guest lectures by Nicola Botta]

Week 8 lecture videos:

L8.1.100:00Towards the Laplace transform§8.2
L8.1.200:00Laplace of exp, sin, cos§8.2.1
L8.1.300:00Laplace transform solving an ODE§8.2
L8.2.100:00Live coding Complex, e^ix = cos x + i*sin x§8.1
L8.2.200:00Laplace cos from exp, math. notation, FunExp§8.4
L8.2.300:00DSLsofMath course / book overviewDSLM

1. Types, Functions, and DSLs for Expressions (7-42)

  • The whole chapter is included in the course.
  • (Some of the material is also parts of the prerequisites.)

1.1 Types of data and functions {p8}

L1.1.127:00Types§1.1
L1.1.118:00DSL definition§1.1.1
L1.1.131:00enum Bool->Bool§1.1.2
L1.1.205:20enum Bool->Bool§1.1.2
L1.1.209:50floating point§1.1.3

1.2 Types in Haskell: type, newtype, and data {p14}

L1.0.100:00TDD: id, const, (.)§1.2
L1.0.200:00(,), swap, fst§1.2
L1.0.210:58tupling transform§1.2,1.8
L1.0.300:00Either, Left, Right§1.2
L1.0.304:12either, patterns§1.2
L1.1.200:00Haskell intro§1.2
L1.1.218:47DSL for expressions§1.2
L1.2.438:20Types§1.2

1.3 Notation and abstract syntax for sequences {p16}

  • Included in the course but not presented in a week 1 lecture.
L2.1.412:35lift2 and friends§1.3

1.4 A DSL of complex numbers {p18}

L1.2.301:00Live code complex§1.4
L1.2.400:00Complex cont.§1.4
L1.2.402:57Eq check + deriving§1.4

1.5 A syntax for (complex) arithmetical expressions {p24}

L1.2.414:18DSL complex§1.5

1.6 Laws, properties and testing {p26}

  • The section is included in the course but only partly presented in the lectures.
L1.1.215:00Associative law§1.6

1.7 Types of functions, expressions and operators {p29}

L1.1.120:00Jamboard examples§1.7
L1.1.125:00“the function f(x)”§1.7
L1.1.226:30Expr. of one var.§1.7

2. DSLs for logic and proofs (43-80)

L2.1.100:00L2.1 admin§2

2.1 Propositional Calculus {p43}

L2.1.200:00Propositional Calculus§2.1
L2.1.400:00live coding Prop, eval§2.1
L2.1.403:40impl. eval without Name§2.1
L2.1.407:21eval: adding Name case§2.1
L2.1.213:37data Prop, eval start§2.1.1
L2.3.100:00Prop and its eval§2.1.1
L2.1.203:20Truth table for (=>)§2.1.2
L2.1.206:24Truth tab. swap§2.1.2
L2.1.210:30Tautology§2.1.2
L2.1.226:08AndIntro, OrIntroL§2.1.3
L2.3.103:16data Proof + checkProof§2.1.3
L2.3.109:06checkProof examples§2.1.4
L2.2.300:00Live code: proof terms§2.1.5
L2.1.230:06fst, snd, orElim§2.1.6
L2.2.308:38inhabited types are Tru§2.1.6
L2.2.313:02Or p q => Or q p§2.1.6
L2.2.315:18Not(Not(Or p (Not p)))§2.1.7

2.2 First Order Logic {p57}

L2.2.100:00First Order Logic§2.2
L2.2.104:29FOL predicate examples§2.2
L2.2.115:38data FOL, data Dom§2.2
L2.2.121:38GADTs extension mention§2.2
L2.2.123:00Interpret FOL-syntax§2.2
L2.2.108:39Quantifiers§2.2.2
L2.2.127:48Typed quantifiers§2.2.4
L2.2.132:58de Morgan, not quant.§2.2.4

2.3 An aside: Pure set theory {p64}

L2.1.300:00Pure set theory§2.3
L2.1.308:49union, card examples§2.3
L2.1.317:05union computation table§2.3

2.4 Example proofs: contradiction, cases, primes {p66}

L2.2.200:00Proof by contradiction§2.4.1
L2.2.214:34Proof by cases§2.4.2

2.5 Basic concepts of calculus {p69}

L3.1.100:00Limit of function§2.5.3
L3.1.106:01Scope check lim logic§2.5.3

2.6 Exercises {p75}

3. Types in Mathematics (81-100)

L3.3.100:00data FunExp, eval, R->R§3

3.1 Typing Mathematics: derivative of a function {p81}

L3.1.200:00Lim properties and types§3.1
L3.1.210:30Deriv. of function§3.1
L3.1.300:00Deriv. examples§3.1
L3.1.305:00D (^2) = (2*)§3.1
L3.1.312:12D (f + g) = D f + D g§3.1

3.2 Typing Mathematics: partial derivative {p82}

L3.2.200:00Partial derivatives quote§3.2
L3.2.213:01Partial derivatives types§3.2
L3.2.225:26Expressions, functions, notation§3.2
L3.2.230:48Partial derivatives examples§3.2

3.3 Typing Mathematics: Lagrangian case study {p85}

L3.2.300:00Lagrangian case study§3.3
L3.2.321:51Lagrangian example§3.3

3.4 Incremental analysis with types {p88}

L3.2.213:01Partial derivatives types§3.4,§3.2

3.5 Type classes {p90}

L3.2.400:00Haskell type classes§3.5
L3.2.404:41class Additive, Double, FunExp§3.5
L3.3.117:20class Additive, Multiplicative§3.5
L3.3.125:51numeric instances for functions§3.5.3

3.6 Computing derivatives {p95}

L3.1.400:00Live coding deriv in Haskell§3.6
L3.1.407:41deriv :: FunExp -> FunExp§3.6
L3.3.104:45cont. deriv :: FunExp -> FunExp§3.6

3.7 Exercises {p98}

4. Compositionality and Algebras (101-140)

4.1 Algebraic Structures {p102}

L4.3.200:00Live coding Monoid, Ring, Field§4.1

4.2 Homomorphisms {p105}

L4.1.100:00Homomorphisms, H2, H1, H0§4.2
L4.3.100:00Structural homomorphism§4.2

4.3 Compositional semantics {p109}

L4.1.200:00Example: H2(odd,+,xor)§4.3.1
L4.1.217:50not Exists op. H2(isPrime,+,op)§4.3.2
L4.1.300:00Live coding H2(h,(+),(*))§4.3
L4.1.400:00Compositional semantics & Folds§4.3

4.4 Folds {p111}

L4.1.407:24fold for integer expressions§4.4
L4.1.416:06Define your own equality§4.4
L4.1.418:59evenIE as a fold instance§4.4
L4.1.500:00Make your own type class§4.4

4.5 Initial and Free Structures {p116}

L4.2.319:27type class for FunExp + instances§4.5

4.6 Computing derivatives, reprise {p122}

L4.2.100:00Prove deriv is not a homomorphism§4.6
L4.2.113:40Core of the proof by contradiction§4.6
L4.2.200:00tupling: der2 : F -> (F, F)§4.6
L4.2.300:00live coding der2, tupling transform§4.6
L4.2.308:30der2 :: F -> Bi F; homomorphism§4.6
L5.1.100:00Live coding applyFD§4.6.1
L5.1.121:43Bi a = (pos, speed)§4.6.1
L5.1.127:31equational reasoning: mulBi from mulFD§4.6.1

4.7 Summary {p126}

4.8 Beyond Algebras: Co-algebra and the Stream calculus {p128}

4.9 A solved exercise {p129}

4.10 Exercises {p134}

5. Polynomials and Power Series (141-157)

5.1 Polynomials {p141}

L5.1.200:00Polynomials: types + eval + examples§5.1
L5.1.200:00Chebyshev polynomials§5.1
L5.1.300:00Polynomials and homomorphisms§5.1
L5.1.300:00Equational reasoning (eval for Poly (+))§5.1
L5.2.300:00Live coding polynomials: types, eval§5.1
L5.2.400:00Coding the polynomial Ring in Haskell§5.1

5.2 Division and the degree of the zero polynomial {p147}

L5.2.100:00Is degree maybe a homomorphism?§5.2, §5.3

5.3 Polynomial degree as a homomorphism {p148}

L5.2.100:00Is degree maybe a homomorphism?§5.2, §5.3

5.4 Power Series {p149}

L5.2.200:00Polynomial division§5.4, §5.5

5.5 Operations on power series {p152}

L5.2.200:00Polynomial division§5.4, §5.5

5.6 Formal derivative {p153}

L5.2.500:00Power Series, deriv, integ, exp example§5.6

5.7 Exercises {p155}

6. Taylor and Maclaurin series (158-174)

L6.1.432:51Implement mulDS (for “derivative series”)§6

6.1 Taylor series {p161}

L6.1.300:00Taylor & Maclaurin series§6.1&§6.3
L6.1.412:25Specification + type of “derivative series”§6.1

6.2 Derivatives and Integrals for Maclaurin series {p164}

L6.1.419:11Implement derDS, integDS, xDS, etc.§6.2

6.3 Integral for Formal Power series {p164}

L6.1.300:00Taylor & Maclaurin series§6.1&§6.3
L6.1.400:00Live coding: Power Series reminder§6.3

6.4 Simple differential equations {p165}

L6.1.100:00Power Series and Ordinary Differential Equations§6.4
L6.1.200:00Power Series transform for solving ODEs§6.4
L6.2.200:00Power series transform in Haskell§6.4

6.5 Exponentials and trigonometric functions {p168}

L6.2.117:30derivative series Transcendental instances§6.5

6.6 Associated code {p170}

L6.2.100:00FunExp special: fromRational . toRational§6.6
L6.2.103:30FunExp recap: the Transcendental part§6.6
L6.2.113:20Generic evaluator example: exp (-x²)§6.6

6.7 Exercises {p172}

7. Elements of Linear Algebra (175-203)

7.1 Representing vectors as functions {p178}

7.2 Linear transformations {p181}

7.3 Inner products {p184}

7.4 Examples of matrix algebra {p186}

7.5 *Monadic dynamical systems {p197}

7.6 Associated code {p200}

7.7 Exercises {p202}

8. Exponentials and Laplace (204-218)

8.1 The Exponential Function {p204}

L8.2.100:00Live coding Complex, e^ix = cos x + i*sin x§8.1

8.2 The Laplace transform {p209}

L8.1.100:00Towards the Laplace transform§8.2
L8.1.200:00Laplace of exp, sin, cos§8.2.1
L8.1.300:00Laplace transform solving an ODE§8.2

8.3 Laplace and other transforms {p216}

8.4 Exercises {p217}

L8.2.200:00Laplace cos from exp, math. notation, FunExp§8.4

9. Probability Theory (219-241)

  • This Chapter is not covered by the DSLsofMath course 2022

9.1 Sample spaces {p220}

9.2 *Monad Interface {p223}

9.3 Distributions {p223}

9.4 Semantics of spaces {p225}

9.5 Random Variables {p228}

9.6 Events and probability {p230}

9.7 Examples: Dice, Drugs, Monty Hall {p234}

9.8 *Solving a problem with equational reasoning {p237}

A The course “DSLs of Mathematics”

B Parameterised Complex Numbers