Zulip Chat Archive

Stream: lean4

Topic: pictures & diagrams


Dean Young (May 09 2023 at 23:25):

Can lean 4 create .png and .jpg files, perhaps with various simple commands to make circles, lines, and geometric figures?

Eric Wieser (May 09 2023 at 23:28):

It can run arbitrary subprocesses and other programs exist which can do these things...

Eric Wieser (May 09 2023 at 23:29):

But probably this is an #xy and you probably want #lean4 > Announcing ProofWidgets4.

Adam Topaz (May 10 2023 at 00:12):

@Kyle Miller wrote a raytracer in lean4. I think it had some pictures involved…

Kyle Miller (May 10 2023 at 00:16):

ppm files are a very simple format. I think all you might learn from the code is how to write to a file using a version of Lean from last June.

Tomas Skrivan (May 10 2023 at 01:03):

I'm using widgets to create and display SVGs. There is a demo that draws couple of lines and circles. However there is no function to export it to a file.

Dean Young (May 10 2023 at 01:54):

I made this python document recently for string diagrams. It generates a .png. Check it out, it just works.

StringDiagramGenerator.py

What do you folk know about previous efforts like this one but for Lean?

Dean Young (May 10 2023 at 01:56):

rbraid.png
secondtriangle.png
test13.png

Dean Young (May 10 2023 at 01:57):

cover.png

Dean Young (May 10 2023 at 01:58):

The operations * and + are overridden and perform the horizontal and vertical composition operations. The examples contain all of the fundamental bricks.

Dean Young (May 10 2023 at 02:00):

Meanwhile, it would be nice to connect it to my categories in Lean. But partially I am interested in the facility with images on its own.


Last updated: Dec 20 2023 at 11:08 UTC