Dragging Proofs out of Pictures—Prologue In celebration of Philip Wadler’s 60th birthday Dragging Proofs out of Pictures Ralf Hinze 1 Dan Marsden 2 1 Institute for Computing and Information Sciences Radboud University, Nijmegen, The Netherlands ralf@cs.ru.nl 2 Department of Computer Science, University of Oxford Wolfson Building, Parks Road, Oxford, OX1 3QD, England daniel.marsden@cs.ox.ac.uk April 2016 Radboud University—Ralf Hinze 1-40
Dragging Proofs out of Pictures—Motivation In celebration of Philip Wadler’s 60th birthday 1 Proofs in Elementary Category Theory • calculational reasoning ◮ squiggolling • commuting diagrams ◮ diagram chasing • best of both worlds: string diagrams ◮ lollipops, forks, . . . ◮ weaving, dragging, sliding, . . . Radboud University—Ralf Hinze 2-40
Dragging Proofs out of Pictures—Motivation In celebration of Philip Wadler’s 60th birthday 1 Proofs in Elementary Category Theory • calculational reasoning ◮ squiggolling • commuting diagrams ◮ diagram chasing • best of both worlds: string diagrams ◮ lollipops, forks, . . . ◮ weaving, dragging, sliding, . . . Radboud University—Ralf Hinze 2-40
Dragging Proofs out of Pictures—Monads In celebration of Philip Wadler’s 60th birthday 2 Monads: Algebraic Definition M : C → C η : Id ˙ → M µ : M ◦ M ˙ → M µ · (η ◦ M ) = id = µ · ( M ◦ η) µ · (µ ◦ M ) = µ · ( M ◦ µ) Radboud University—Ralf Hinze 3-40
Dragging Proofs out of Pictures—Monads In celebration of Philip Wadler’s 60th birthday 2 Monads: “Essence of FP” mapM id = id mapM (f.g) = mapM f . mapM g mapM f . unitM = unitM . f mapM f . joinM = joinM . mapM (mapM f) joinM . unitM = id joinM . mapM unitM = id joinM . mapM joinM = joinM . joinM m ‘bindM‘ k = joinM (mapM k m) Radboud University—Ralf Hinze 4-40
Dragging Proofs out of Pictures—Monads In celebration of Philip Wadler’s 60th birthday 2 Monads: Commuting Diagrams M ◦ µ M ◦ M M ◦ M ◦ M ≻ M ◦ M ≻ M µ ◦ η ≻ id µ ◦ M µ M ≻ M ≻ M µ ◦ η ⋎ ⋎ ≻ M ◦ M M ◦ M ≻ M µ Radboud University—Ralf Hinze 5-40
Dragging Proofs out of Pictures—Monads In celebration of Philip Wadler’s 60th birthday 2 Monads: String Diagrams M M µ η M M Radboud University—Ralf Hinze 6-40
Dragging Proofs out of Pictures—Monads In celebration of Philip Wadler’s 60th birthday 2 Monads: String Diagrams Id M M µ η M M Radboud University—Ralf Hinze 7-40
Dragging Proofs out of Pictures—Monads In celebration of Philip Wadler’s 60th birthday 2 Monads: String Diagrams M M M M M M M M M η η µ µ = = = µ µ µ µ M M M M M Radboud University—Ralf Hinze 8-40
Dragging Proofs out of Pictures—Composition of Monads In celebration of Philip Wadler’s 60th birthday 3 Composition of Monads M M S T S T η η η δ = = µ µ µ M S T M S T Radboud University—Ralf Hinze 9-40
Dragging Proofs out of Pictures—Composition of Monads In celebration of Philip Wadler’s 60th birthday 3 Composition of Monads: Unit Law { definitions } M S T η η η = = δ µ µ µ M S T Radboud University—Ralf Hinze 10-40
Dragging Proofs out of Pictures—Composition of Monads In celebration of Philip Wadler’s 60th birthday 3 Composition of Monads: Unit Law S S T T { redraw } η η η η δ = = δ µ µ µ µ S T S T Radboud University—Ralf Hinze 11-40
Dragging Proofs out of Pictures—Composition of Monads In celebration of Philip Wadler’s 60th birthday 3 Composition of Monads: Unit Law { drag η across S } S S T T η η η = = δ µ µ µ µ η S T S T Radboud University—Ralf Hinze 12-40
Dragging Proofs out of Pictures—Composition of Monads In celebration of Philip Wadler’s 60th birthday 3 Composition of Monads: Unit Law S S T T { redraw } η η η = = µ µ µ µ η S T S T Radboud University—Ralf Hinze 13-40
Dragging Proofs out of Pictures—Composition of Monads In celebration of Philip Wadler’s 60th birthday 3 Composition of Monads: Unit Law S S T T { definition } M { η unit } η η = = = = µ µ S T S T M Radboud University—Ralf Hinze 14-40
Dragging Proofs out of Pictures—Composition of Monads In celebration of Philip Wadler’s 60th birthday 3 Composition of Monads: Associativity M M M S T S T S T δ { definitions } µ µ µ = = δ µ µ µ M S T Radboud University—Ralf Hinze 15-40
Dragging Proofs out of Pictures—Composition of Monads In celebration of Philip Wadler’s 60th birthday 3 Composition of Monads: Associativity S T S T S T S T S T S T δ δ { redraw } µ µ µ µ = = µ δ δ µ µ µ S T S T Radboud University—Ralf Hinze 16-40
Dragging Proofs out of Pictures—Composition of Monads In celebration of Philip Wadler’s 60th birthday 3 Composition of Monads: Associativity S S S T T T S T S T S T δ δ { drag µ across S } µ µ µ µ = = δ µ δ δ µ µ µ S T S T Radboud University—Ralf Hinze 17-40
Dragging Proofs out of Pictures—Composition of Monads In celebration of Philip Wadler’s 60th birthday 3 Composition of Monads: Associativity S T S T S T S T S T S T δ δ { µ associative } µ µ δ µ µ δ = = δ µ δ µ µ µ S T S T Radboud University—Ralf Hinze 18-40
Dragging Proofs out of Pictures—Composition of Monads In celebration of Philip Wadler’s 60th birthday 3 Composition of Monads: Associativity S T S T S T S T S T S T δ µ { redraw } µ µ δ δ δ µ = = µ µ µ δ δ µ S T S T Radboud University—Ralf Hinze 19-40
Dragging Proofs out of Pictures—Composition of Monads In celebration of Philip Wadler’s 60th birthday 3 Distributive Laws: Dragging Properties S S S S T T T T η µ δ δ = = δ µ η δ S T S T S T S T S S T T S T T S η µ δ δ = = δ µ η δ S T S T S T S T Radboud University—Ralf Hinze 20-40
Dragging Proofs out of Pictures—EM Laws In celebration of Philip Wadler’s 60th birthday 4 EM Laws: Algebraic Definition ( S , η, µ) : C ( T , η, µ) : D H : C → D δ : T ◦ H ˙ → H ◦ S δ · (η ◦ H ) = ( H ◦ η) δ · (µ ◦ H ) = ( H ◦ µ) · (δ ◦ S ) · ( T ◦ δ) Radboud University—Ralf Hinze 21-40
Dragging Proofs out of Pictures—EM Laws In celebration of Philip Wadler’s 60th birthday 4 EM Laws: Naive String Diagrams T T H T T H H H η µ δ η δ δ = δ = µ H S H S H S H S Radboud University—Ralf Hinze 22-40
Dragging Proofs out of Pictures—EM Laws In celebration of Philip Wadler’s 60th birthday 4 EM Laws: String Diagrams T T H T T H H H η µ δ δ = = δ µ η δ H S H S H S H S Radboud University—Ralf Hinze 23-40
Dragging Proofs out of Pictures—EM Laws In celebration of Philip Wadler’s 60th birthday 4 EM Laws: Composition T K H T K S H α | = α β β K S H R K H R Radboud University—Ralf Hinze 24-40
Dragging Proofs out of Pictures—EM Laws In celebration of Philip Wadler’s 60th birthday 4 EM Laws: Composition K H K H K H η α η = = η β β K H R K H R K H R Radboud University—Ralf Hinze 25-40
Dragging Proofs out of Pictures—EM Laws In celebration of Philip Wadler’s 60th birthday 4 EM Laws: Composition T T K H T T K H T T K H µ α α α α µ α = = β β µ β β K H R K H R K H R Radboud University—Ralf Hinze 26-40
Dragging Proofs out of Pictures—Iterated Distributive Laws In celebration of Philip Wadler’s 60th birthday 5 Composition of Two Monads T 1 ◦ T 2 δ : T 2 ◦ T 1 ˙ → T 1 ◦ T 2 Radboud University—Ralf Hinze 27-40
Dragging Proofs out of Pictures—Iterated Distributive Laws In celebration of Philip Wadler’s 60th birthday 5 Composition of Three Monads T 1 ◦ T 2 ◦ T 3 δ 31 : T 3 ◦ T 1 ˙ → T 1 ◦ T 3 δ 21 : T 2 ◦ T 1 ˙ → T 1 ◦ T 2 δ 32 : T 3 ◦ T 2 ˙ → T 2 ◦ T 3 Radboud University—Ralf Hinze 28-40
Dragging Proofs out of Pictures—Iterated Distributive Laws In celebration of Philip Wadler’s 60th birthday 5 Candidates for Distributive Laws T 3 ) ( T 2 T 1 T 3 ( T 1 T 2 ) δ 21 δ 32 δ ′ = δ = δ 31 δ 31 T 1 ( T 2 T 3 ) T 3 ( T 1 T 2 ) Radboud University—Ralf Hinze 29-40
Dragging Proofs out of Pictures—Iterated Distributive Laws In celebration of Philip Wadler’s 60th birthday 5 Composite Multiplication T 1 ( T 2 T 3 ) T 1 ( T 2 T 3 ) ( T 1 T 2 ) T 3 ( T 1 T 2 ) T 3 δ 31 δ 31 µ µ = δ 21 δ 32 µ µ δ 21 δ 32 µ µ T 1 T 3 ( T 2 T 3 ) ( T 1 T 2 ) Radboud University—Ralf Hinze 30-40
Dragging Proofs out of Pictures—Iterated Distributive Laws In celebration of Philip Wadler’s 60th birthday 5 Proof Obligation: Dragging the Unit T 1 η η T 1 δ 21 = η η T 1 δ 31 T 1 T 2 T 3 T 2 T 3 Radboud University—Ralf Hinze 31-40
Recommend
More recommend