CSE 191: Discrete Structures
Spring 2024 Syllabus

Matthew G. Knepley
211A Capen Hall knepley@buffalo.edu

This course provides a mathematical foundation for subsequent study in Computer Science, as well as developing the skills necessary to solve practical problems. CSE 191 is intended to give students a basic facility with logic and proof theory, counting, and graph theory, which serve as the basis for much of Computer Science.

1 Course Information

Instructor Matthew G. Knepley
Class times9:30am to 10:50am on Tuesday & Thursday
Location Knox 104

A course overview and grading policy are available in accordance with Buffalo academic policy.

2 Required and Recommended Reading

Class notes have been prepared for each class, and the lecture will follow the notes. Extensive class notes are also available from the Fall 2017 section of this course. Students may read over the class notes prior to attending lecture, but it may deviate from the notes somewhat.

An alternative text is Mathematics for Computer Science by Eric Lehman, F Thomson Leighton, and Albert R Meyer. The Software Foundations books are also very helpful for working with Coq. In addition, there are some excellent papers about the Curry-Howard Isomorphism

3 Turning in Homework

All homework will be submitted to the Autograder system. Two kinds of assignments will be given. Written assignments, which the students will turn in as PDF or scanned image files, and Proof assignments, which will be submitted as Coq files. The written assignments will be denoted with a w, such as Assignment 0w. For all proof questions, you must submit a valid constructive proof. You may not use the following tactics:

  1. auto,
  2. easy,
  3. eauto,
  4. tauto,
  5. intuition,
  6. lia,
  7. nia,
  8. now,
  9. omega,
  10. axiom,
  11. Admitted

except if otherwise indicated in the problem statement. Assignments using these prohibited tactics will be given a zero score. You are encouraged to use the ring tactic and the tactics suggested specifically in the problems.

4 Student Learning Outcomes

5 Online Learning

In the event of the closure of classrooms, CSE 191 will be carried out via distance learning. This is a summary of the course changes which would follow. If you have any questions after reading, please direct them to the Piazza page or to my email. The Syllabus schedule will remain unchanged, meaning the course will cover the same topics, with the same assigned reading and homework. Students will still turn in homework using Autograder as we have previously. Lectures will now be recorded and viewable via the Panopto system, and lecture URLs will be posted on the course webpage. Questions will still be principally answered on Piazza. Office hours will be held using Zoom. The final exam would not be given in-person, but rather be a take-home exam. Students may use any resources at their disposal (books, notes, videos) but may not collaborate with each other. Students will be given 24 hours to complete the exam, and it will be turned in via Autograder just as the homework.

6 Schedule

6.1 Week 1: Propositional Logic 1/29

6.1.1 Chapter I, Lecture 1: Course Outline and Structure

We will go over the course overview and syllabus. I will answer student questions about the course procedures and material. I will also introduce the proof assistant.

Assignment 0w, Due 2/6

This assignment prepares the student to generate PDF homework and turn it in electronically.

Online resources

6.1.2 Chapter I, Video 1: Propositional Calculus

We discuss propositions, operators, and the propositional calculus.

Online resources

6.2 Week 2: Propositional Logic 2/5

6.2.1 Chapter I, Lecture 2: Automating Propositional Logic

We discuss Coq and the automation of proofs in propositional calculus

Online resources

Assignment 0, Due 2/13

This assignment prepares the student to generate Coq homework and turn it in electronically.

6.2.2 Chapter I, Video 2: Proving Logical Equivalence

We discuss proving logical equivalence and introduce the proof assistant Coq.

6.3 Week 3: Proofs in Intuitionistic Logic 2/12

6.3.1 Chapter I, Lecture 3: Proof Tactics

We discuss introduction and elimination rules for propositional calculus.

Online resources

Assignment 1, Due 2/27

This assignment covers proofs in propositional logic and proof automation.

6.3.2 Chapter I, Video 3: Proof Tactics

We demonstrate proof tactics on a number of examples, and relate the proof to the traditional method.

Online resources

6.4 Week 4: Predicate Logic 2/19

6.4.1 Chapter II, Lecture 1: Predicates and Quantifiers

We introduce predicates and quantifiers, the basis of Predicate Logic. We prove statements in Predicate Logic using Coq, and the contraposition and contradiction proof techniques.

Assignment 2, Due 3/7

This assignment covers predicate logic and the contraposition and contradiction proof techniques.

6.4.2 Chapter II, Video 1: Finite and Infinite Inductive Types

We review finite and infinite inductive types and the associated induction theorems.

Online resources

6.5 Week 5: Sets 2/26

6.5.1 Chapter III, Lecture 1: Sets and Types

We define sets and set operations, and compare set theory to type theory. We also discuss Russell’s Paradox.

Assignment 3a, Due 3/28

This assignment covers sets, relations, and functions.

6.5.2 Chapter III, Video 1: The Power Set

We define the power set and review diagonal arguments. We prove Cantor’s Theorem that the power set is always larger than the original set.

6.6 Week 6: Relations and Functions 3/4

6.6.1 Chapter III, Lecture 2: Relations

We define relations and their graphs.

Assignment 3b, Due 4/4

This assignment covers sets, relations, and functions.

6.6.2 Chapter III, Video 2: Functions in Coq

We define functions and function predicates in Coq.

6.7 Week 7: Functions Continued 3/11

6.7.1 Chapter III, Lecture 3: Functions Redux

We define functions and function types.

6.7.2 Chapter III, Lecture 4: Using functions

We will prove many function-theoretic identities.

6.8 Week 8: Spring Recess 3/18

6.8.1 Lecture 8a: Review Proof Tactics

Review proof tactics and their use in Coq.

6.8.2 Lecture 8b: Review Proof Automation

Review putting proofs in files and automating the deduction.

6.9 Week 9: Mathematical Induction I 3/25

6.9.1 Chapter IV, Video 3/4: Induction

We go over elementary proofs, both by hand and using the proof assistant. We also look at induction proofs that go beyond the basic examples, incorporating inequalities and auxiliary variables.

Assignment 4, Due 4/18

This assignment covers proofs by induction.

6.9.2 Chapter IV, Lecture 1: Strong Induction

We cover proofs using strong induction with examples.

6.10 Week 10: Mathematical Induction II 4/1

6.10.1 Chapter IV, Lecture 2: Lists

We present an inductive type for lists, and prove several properties of the type.

6.10.2 Chapter IV, Video 2: Even and Odd Numbers

We use induction on recursive inductive types to prove statements about even and odd numbers.

6.11 Week 11: Modular Rings I 4/8

6.11.1 Chapter V, Video 1: Integers and Divisibility

We introduce the inductive construction of positive natural numbers and integers, review notation and vocabulary, and introduce modular rings.

Assignment 5, Due 4/25

This assignment covers modular arithmetic.

6.11.2 Chapter V, Video 2: Divisibility Proofs with Coq

We review several proofs about divisibility and induction on integers.

6.12 Week 12: Modular Rings II 4/15

6.12.1 Chapter V, Video 3 and 4: The GCD

We define the GCD, using several equivalent definitions, review its properties, and prove Bezout’s Theorem. In the next video, we do some short proofs using the GCD.

Assignment 5w, Due 5/2

This assignment covers modular arithmetic.

6.12.2 Chapter V, Video 5: The Extended Euclidean Algorithm

We examine the Euclidean Algorithm and the Extended Euclidean Algorithm.

6.13 Week 13: Modular Rings III 4/22

6.13.1 Chapter V, Video 6: Chinese Remainder Theorem

We prove the Fundamental Theorem of Arithmetic and the Chinese Remainder Theorem.

6.13.2 Chapter V, Video 7: Correctness of Euclid’s Algorithm

We prove correctness and a complexity bound for Euclid’s Algorithm.

6.14 Week 14: No class 4/29

6.14.1 Review: Go over course homework

Students review proof tactics and using the proof assistant to verify proofs.

6.14.2 Review: Work on Chapter V homework

Students work on Euclid’s algorithm assignment.

6.15 Week 15: Review Week 5/6

6.15.1 Review entire course

We review the course.