Dragging Proofs out of Pictures Ralf Hinze 1 Dan Marsden 2 1 - - PowerPoint PPT Presentation

dragging proofs out of pictures
SMART_READER_LITE
LIVE PREVIEW

Dragging Proofs out of Pictures Ralf Hinze 1 Dan Marsden 2 1 - - PowerPoint PPT Presentation

Dragging Proofs out of PicturesPrologue In celebration of Philip Wadlers 60th birthday Dragging Proofs out of Pictures Ralf Hinze 1 Dan Marsden 2 1 Institute for Computing and Information Sciences Radboud University, Nijmegen, The


slide-1
SLIDE 1

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

1Institute for Computing and Information Sciences

Radboud University, Nijmegen, The Netherlands ralf@cs.ru.nl

2Department 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

slide-2
SLIDE 2

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

slide-3
SLIDE 3

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

slide-4
SLIDE 4

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

slide-5
SLIDE 5

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

slide-6
SLIDE 6

Dragging Proofs out of Pictures—Monads In celebration of Philip Wadler’s 60th birthday

2 Monads: Commuting Diagrams

M◦M M id ≻ η

  • M

≻ M µ ≻ M◦M µ ≻ M

  • η

≻ M◦M◦M M◦µ ≻ M◦M M◦M µ◦M ⋎ µ ≻ M µ ⋎

Radboud University—Ralf Hinze 5-40

slide-7
SLIDE 7

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

slide-8
SLIDE 8

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

slide-9
SLIDE 9

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

slide-10
SLIDE 10

Dragging Proofs out of Pictures—Composition of Monads In celebration of Philip Wadler’s 60th birthday

3 Composition of Monads

η M = η T η S µ M M M = µ S µ T S T T S δ

Radboud University—Ralf Hinze 9-40

slide-11
SLIDE 11

Dragging Proofs out of Pictures—Composition of Monads In celebration of Philip Wadler’s 60th birthday

3 Composition of Monads: Unit Law

η µ M M = { definitions } = µ S η µ T η S T δ

Radboud University—Ralf Hinze 10-40

slide-12
SLIDE 12

Dragging Proofs out of Pictures—Composition of Monads In celebration of Philip Wadler’s 60th birthday

3 Composition of Monads: Unit Law

µ S η µ T η S T δ = { redraw } = µ S η S η µ T T δ

Radboud University—Ralf Hinze 11-40

slide-13
SLIDE 13

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 δ = { drag η across S } = µ µ S η S T η T

Radboud University—Ralf Hinze 12-40

slide-14
SLIDE 14

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 η S T η T

Radboud University—Ralf Hinze 13-40

slide-15
SLIDE 15

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 = { η unit } = S T S T = { definition } = M M

Radboud University—Ralf Hinze 14-40

slide-16
SLIDE 16

Dragging Proofs out of Pictures—Composition of Monads In celebration of Philip Wadler’s 60th birthday

3 Composition of Monads: Associativity

µ M M µ M M = { definitions } = δ T S µ µ δ µ S µ T S T S T

Radboud University—Ralf Hinze 15-40

slide-17
SLIDE 17

Dragging Proofs out of Pictures—Composition of Monads In celebration of Philip Wadler’s 60th birthday

3 Composition of Monads: Associativity

δ T S µ µ δ µ S µ T S T S T = { redraw } = δ T S µ µ µ µ T S T S T S δ

Radboud University—Ralf Hinze 16-40

slide-18
SLIDE 18

Dragging Proofs out of Pictures—Composition of Monads In celebration of Philip Wadler’s 60th birthday

3 Composition of Monads: Associativity

δ T S µ µ µ µ T S T S T S δ = { drag µ across S } = δ T S µ µ µ µ T S T S T S δ δ

Radboud University—Ralf Hinze 17-40

slide-19
SLIDE 19

Dragging Proofs out of Pictures—Composition of Monads In celebration of Philip Wadler’s 60th birthday

3 Composition of Monads: Associativity

δ T S µ µ µ µ T S T S T S δ δ = { µ associative } = δ T S µ µ T µ µ S T S T S δ δ

Radboud University—Ralf Hinze 18-40

slide-20
SLIDE 20

Dragging Proofs out of Pictures—Composition of Monads In celebration of Philip Wadler’s 60th birthday

3 Composition of Monads: Associativity

δ T S µ µ T µ µ S T S T S δ δ = { redraw } = µ S µ S T S µ T µ T S T δ δ δ

Radboud University—Ralf Hinze 19-40

slide-21
SLIDE 21

Dragging Proofs out of Pictures—Composition of Monads In celebration of Philip Wadler’s 60th birthday

3 Distributive Laws: Dragging Properties

δ η T T S = η T T S µ S S S T T δ = µ S S S T T δ δ δ η S S T = η S S T µ T T T S S δ = µ T T T S S δ δ

Radboud University—Ralf Hinze 20-40

slide-22
SLIDE 22

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

slide-23
SLIDE 23

Dragging Proofs out of Pictures—EM Laws In celebration of Philip Wadler’s 60th birthday

4 EM Laws: Naive String Diagrams

δ η H H S = H H S η δ µ H H S T T = δ T H δ µ S T H

Radboud University—Ralf Hinze 22-40

slide-24
SLIDE 24

Dragging Proofs out of Pictures—EM Laws In celebration of Philip Wadler’s 60th birthday

4 EM Laws: String Diagrams

δ η H H S = η H H S µ T T S H H δ = µ T T S H H δ δ

Radboud University—Ralf Hinze 23-40

slide-25
SLIDE 25

Dragging Proofs out of Pictures—EM Laws In celebration of Philip Wadler’s 60th birthday

4 EM Laws: Composition

S K T K α | R H S H β = K K H H R T α β

Radboud University—Ralf Hinze 24-40

slide-26
SLIDE 26

Dragging Proofs out of Pictures—EM Laws In celebration of Philip Wadler’s 60th birthday

4 EM Laws: Composition

K K H H R α β η = K K H H R β η = K K H H R η

Radboud University—Ralf Hinze 25-40

slide-27
SLIDE 27

Dragging Proofs out of Pictures—EM Laws In celebration of Philip Wadler’s 60th birthday

4 EM Laws: Composition

K K H H R T T α β µ = K K H H R T T α α β µ = K K H H R T T α α β β µ

Radboud University—Ralf Hinze 26-40

slide-28
SLIDE 28

Dragging Proofs out of Pictures—Iterated Distributive Laws In celebration of Philip Wadler’s 60th birthday

5 Composition of Two Monads

T1◦T2 δ : T2◦T1 ˙ → T1◦T2

Radboud University—Ralf Hinze 27-40

slide-29
SLIDE 29

Dragging Proofs out of Pictures—Iterated Distributive Laws In celebration of Philip Wadler’s 60th birthday

5 Composition of Three Monads

T1◦T2◦T3 δ31 : T3◦T1 ˙ →T1◦T3 δ21 : T2◦T1 ˙ →T1◦T2 δ32 : T3◦T2 ˙ →T2◦T3

Radboud University—Ralf Hinze 28-40

slide-30
SLIDE 30

Dragging Proofs out of Pictures—Iterated Distributive Laws In celebration of Philip Wadler’s 60th birthday

5 Candidates for Distributive Laws

δ = T1 (T2T3) T1 T3) (T2 δ21 δ31 δ′ = T3 T2) (T1 T3 (T1T2) δ31 δ32

Radboud University—Ralf Hinze 29-40

slide-31
SLIDE 31

Dragging Proofs out of Pictures—Iterated Distributive Laws In celebration of Philip Wadler’s 60th birthday

5 Composite Multiplication

T1 (T2T3) T1 (T2T3) T1 µ (T2 µ T3) µ δ21 δ31 δ32 = T3 T2) (T1 T3 T2) (T1 T3 µ T2) µ (T1 µ δ32 δ31 δ21

Radboud University—Ralf Hinze 30-40

slide-32
SLIDE 32

Dragging Proofs out of Pictures—Iterated Distributive Laws In celebration of Philip Wadler’s 60th birthday

5 Proof Obligation: Dragging the Unit

δ21 T2 η T1 δ31 T3 η T1 = η T1 T2 η T3 T1

Radboud University—Ralf Hinze 31-40

slide-33
SLIDE 33

Dragging Proofs out of Pictures—Iterated Distributive Laws In celebration of Philip Wadler’s 60th birthday

5 Proof Obligation: Dragging the Multiplication

δ32 T3 T2 µ T2 µ T3 T2 T3 T1 T1 δ21 δ31 = δ32 µ T2 µ T3 T2 T3 T2 T3 T1 T1 δ21 δ31 δ21 δ31

Radboud University—Ralf Hinze 32-40

slide-34
SLIDE 34

Dragging Proofs out of Pictures—Iterated Distributive Laws In celebration of Philip Wadler’s 60th birthday

5 Dragging the Multiplication

δ32 T3 T2 µ T2 µ T3 T2 T3 T1 T1 δ21 δ31 = { drag µs across T1 } = δ32 µ T2 µ T3 T3 T2 T2 T3 δ21 δ21 δ31 δ31

Radboud University—Ralf Hinze 33-40

slide-35
SLIDE 35

Dragging Proofs out of Pictures—Iterated Distributive Laws In celebration of Philip Wadler’s 60th birthday

5 Dragging the Multiplication

δ32 µ T2 µ T3 T3 T2 T2 T3 δ21 δ21 δ31 δ31 = { redraw } = δ32 µ T2 µ T3 T3 T2 T2 T3 δ21 δ21 δ31 δ31

Radboud University—Ralf Hinze 34-40

slide-36
SLIDE 36

Dragging Proofs out of Pictures—Iterated Distributive Laws In celebration of Philip Wadler’s 60th birthday

5 Dragging the Multiplication

δ32 µ T2 µ T3 T3 T2 T2 T3 δ21 δ21 δ31 δ31 = { Yang–Baxter } = δ32 µ T2 µ T3 T3 T2 T1 T1 T2 T3 δ21 δ21 δ31 δ31

Radboud University—Ralf Hinze 35-40

slide-37
SLIDE 37

Dragging Proofs out of Pictures—Iterated Distributive Laws In celebration of Philip Wadler’s 60th birthday

5 Dragging the Multiplication

δ32 µ T2 µ T3 T3 T2 T1 T1 T2 T3 δ21 δ21 δ31 δ31 = { redraw } = δ32 µ T2 µ T3 T2 T3 T2 T3 T1 T1 δ21 δ31 δ21 δ31

Radboud University—Ralf Hinze 36-40

slide-38
SLIDE 38

Dragging Proofs out of Pictures—Iterated Distributive Laws In celebration of Philip Wadler’s 60th birthday

5 Yang–Baxter Equation

T1 T1 δ32 T2 T3 T3 T2 δ31 δ21 = T1 T1 δ32 T2 T3 T3 T2 δ31 δ21

Radboud University—Ralf Hinze 37-40

slide-39
SLIDE 39

Dragging Proofs out of Pictures—Iterated Distributive Laws In celebration of Philip Wadler’s 60th birthday

5 Yang–Baxter Equation

T1 T1 T3 T3 T2 T2 δ21 δ32 δ31 = T3 T3 T1 T1 T2 T2 δ32 δ21 δ31

Radboud University—Ralf Hinze 38-40

slide-40
SLIDE 40

Dragging Proofs out of Pictures—Iterated Distributive Laws In celebration of Philip Wadler’s 60th birthday

5 Yang–Baxter Equation and Sorting Networks

2 3 1 2 1 3 = 2 1 3 2 3 1

Radboud University—Ralf Hinze 39-40

slide-41
SLIDE 41

Dragging Proofs out of Pictures—Epilogue In celebration of Philip Wadler’s 60th birthday

6 Conclusion

  • String diagrams provide category theory with a new and very

distinctive visual flavour.

  • Drawing string diagrams is an art: good diagrammatic choices

can make all the difference.

  • They turn the stereotype of “definition, theorem, and proof”

around, allowing us to discover concepts during proof attempts.

  • (String diagrams silently deal with distracting bookkeeping

steps, such as naturality and functoriality properties.)

Radboud University—Ralf Hinze 40-40