On Mon, 17 Jul 2017 02:51:37 +0800, Thierry Arnoux <thierry...@gmx.net> wrote:
> ... In order to be even nearer to representations mathematicians are
> familiar with, I've been experimenting with MathML. Here are some results:
> http://arnoux.ch/thierry/metamath/mathml/cubic.html
I find the expressions themselves to be rather pretty. On Firefox there are a number
of problems (overly tall/wide cells), but I presume those are just problems from an
incomplete experiment & can be fixed.
It'd take a bit of work to do a good job
with this, but it is an interesting experiment.
> This is still a work in progress and even in these few examples there
> are still some mistakes I need to fix. If you're curious, I can share
> the code (still buggy); ...
We'll want to find a way to have high confidence in the display.
Ways to make the rules simple & "obviously correct" would help.
> I originally had the fear that this representation might hide too many
> of the internal proof steps (like e.g. for associativity), but right
> now, and for the examples I've taken, it does not seem it's the case.
I worry about that too. As long as you're just reformatting that shouldn't happen.
Replacing (...) is also okay *if* it's replaced with another visual cue (e.g., horizontal
fraction lines that also provide grouping), but if it usually just represents
information in a 1-to-1 way it shouldn't be a problem.
Thierry
--
You received this message because you are subscribed to the Google Groups "Metamath" group.
To unsubscribe from this group and stop receiving emails from it, send an email to metamath+unsubscribe@googlegroups.com.
To post to this group, send email to meta...@googlegroups.com.
Visit this group at https://groups.google.com/group/metamath.
For more options, visit https://groups.google.com/d/optout.
On Sun, 16 Jul 2017 22:02:50 +0100, Mario Carneiro <di....@gmail.com> wrote:
> I think a proper precedence printer is needed to get the parentheses right...
I don't agree.
I earlier cited the paper “Developer beliefs about binary operator precedence (part 1)”
by Derek M. Jones: http://www.knosof.co.uk/cbook/accu06.html
This paper showed that professional programmers often don't use and
don't understand precedence. A display mechanism shouldn't assume humans
correctly and reliably follow precedence rules, because many do not.
Humans are annoying creatures; they aren't very good at being precise :-).
--- David A. Wheeler
Thanks for your encouraging comments!
I've reworked the solution, and I now have something to submit
for integration into the metamath program, if we are willing to go
in that direction (probably still to be mentioned as experimental,
though!).
Attached is the new source code, as a patch to be applied on top
of the "0.146 26-Jun-2017" version, including also new source and
header files and the current typesetting file.
(is that the right format / the right way to submit a patch for
the metamath program?)
Proofs can be exported in MathML format by using e.g. command
"SHOW STATEMENT iunid / STS mathml" after having loaded "set.mm".
A concern could be the size of the generated files, as MathML is
probably much more verbose than current HTML. Is that an issue?
One solution could be to switch to TeX, which would probably be
more compact but result in the same output.
I think a proper precedence printer is needed to get the parentheses right, though, for example in cases like (sin x)^n which is printed ambiguously without parentheses, or all the various combinations of + - x. / . The printer needs to parse the math expression (as mmj2 does) to get a syntax tree, then render each node using a table like the .mmts file you've given, and insert parentheses (which are formatted with a special parenthesis entry in the table) whenever the precedence requires it.
About notation conventions like order of precedence: I think ideally, we should identify an authoritative academic source and refer to it. I found online some editing style guide from the AMS, but those are targeted at editors and only one actually addressed precedence, from the APS. Can anyone recommend such a reference specifically for mathematics?
Here are the references I found on formatting mathematics:
http://forms.aps.org/author/styleguide.pdf (Chapter D. about bracketing, E.)
http://www.ams.org/publications/authors/AMS-StyleGuide-print.pdf
https://www.siam.org/journals/pdf/stylemanual.pdf
http://dlmf.nist.gov/front/introduction
http://dlmf.nist.gov/not/
Your example about (sin x)^n is interesting, though. I think the commonly accepted notation in this case is sin^n x (with n as a superscript of "sin"). It would be easy to add a special rule for this case, and to render e.g. ~ sincossq that way.
Overall, I'm very pleased with this test, and I think the general approach is sound. The time taken to render MathJax is a major limitation, though - Metamath web pages often contain 800+ formulas, and it takes almost 30 seconds to render the test pages on my browser.
About display time: we could e.g. hide proof steps beyond a given depth or length. This would both solve the issue of display time and page size (MathML is quite verbose). This restriction could then be removed in the future when speed and space are cheaper. There are also ways to let MathJax render smaller chunks of MathML code. Yet another option could be to initially hide some proof steps behind a [+] and render them only when the user clicks on it.
I originally had the fear that this representation might hide too many of the internal proof steps (like e.g. for associativity), but right now, and for the examples I've taken, it does not seem it's the case.
I worry about that too. As long as you're just reformatting that shouldn't happen. Replacing (...) is also okay *if* it's replaced with another visual cue (e.g., horizontal fraction lines that also provide grouping), but if it usually just represents information in a 1-to-1 way it shouldn't be a problem.
I'm willing to compromise on this (1-to-1 mapping) in edge cases. For presentation, nice display trumps unambiguity - we always have the other display methods available if users want a more precise readout. That said, I don't see any cases in the examples where ambiguity could potentially be a problem. For associativity, the usual way to solve the problem is to have a defined precedence and associativity for each operator, so (a+b)+c is printed as a+b+c and a+(b+c) is printed as is.
I find the expressions themselves to be rather pretty. On Firefox there are a number of problems (overly tall/wide cells), but I presume those are just problems from an incomplete experiment & can be fixed.
Things like cell margins can indeed be tuned. I actually like the
comfort of the cells as displayed currently, with more spacing,
but that could be reduced. Or did you see a specific formula
incorrectly displayed ?
Also, the formulas are currently represented centered (like it is
the convention for formulas not displayed inline). Shall I adapt
back to left-aligned, so that the formulas as intended according
to the proof depth?
Thank you Norm!
All, concerning the typesettings:
Norm, for the code itself:
Thank you Norm!
All, concerning the typesettings:
- Symbols like indexed union U_, indexed intersections I^I , and disjointedness of an indexed collection Disj_ are written with an underline in the "linear" HTML version. Can I remove it in the MathML version, since the x e. A that immediately follows is written as a subscript, and there is no confusion? If so, I could actually even write the x e. A under the symbol and not as a subscript.
http://arnoux.ch/thierry/metamath/mathml/iundisj.html
- I chose to write the complex conjugate ( * ` X ) as a bar over the expression, as this is the standard in mathematics. Any disagreement?
http://arnoux.ch/thierry/metamath/mathml/cjth.html
- For normal function value ( F ` X ), I display F(X). What shall I display for ( F " A ), the image of a set? I see one convention used in Wikipedia is F[A]. Ok to use it? Otherwise, I could use bold brackets to make the difference - but that difference is actually hard to see:
http://arnoux.ch/thierry/metamath/mathml/dfco2a.html
I've updated the preview with what it looks like with these changes:
http://arnoux.ch/thierry/metamath/mathml/iundisj.html
http://arnoux.ch/thierry/metamath/mathml/dfco2a.html
--
You received this message because you are subscribed to the Google Groups "Metamath" group.
To unsubscribe from this group and stop receiving emails from it, send an email to metamath+u...@googlegroups.com.
Hi David,
Yes, the spacing can be removed by tweaking CSS, here's my go at it:
http://arnoux.ch/thierry/metamath/mathml/uniioombllem4.html
I actually still prefer the version with more space (and regular line height), but I guess that's really a matter of personal preference!
As a matter of typesetting rules, there are two official ways to
display math in a document: either inline/within text, or
displayed as a separated line, e.g. a numbered equation. The first
way (inline), is more compact and e.g. the under/over notation in
summations become subscript/superscript, and fractions are written
as a solidus (with a slash) / . (see for example the APS guideline,
chapter E.2.). The second way (displayed) takes up more space
above and below the equations. MathML/MathJax support both of
those, and I initially chose to display the proof steps in the
second way, as a block. The space and centering was added
automatically by the tool as by standard.
I think it's clear that any math fragment added in the comment
part (in between ` `) shall be displayed inline.
Then the question is whether we shall consider our proofs as
"inline" too, or as "displayed", or if we define something in
between. Indeed in the guidelines, it is stated that only the most
important equations shall be displayed (cf. APS guideline
chapter C.1.). In our proofs we actually may list hundred of them
- but we number each of them.
As for your second remark, I definitively want to make the final
display unambiguous. I shall e.g. keep the brackets in (-A)^B,
since there is a discussion about it (e.g. in http://arnoux.ch/thierry/metamath/mathml/logtayl2.html).
I currently remove brackets when there are already visual hints
(below a square root sign, under/over a fraction bar, under/over a
summation, within a F(X) function value, in singletons { X },
pairs, triplets, etc.), and where well-known order of precedence
rules apply (that's actually only necessary in the case of
multiplication over addition).
There are at least two points I need to work on:
On Mon, 24 Jul 2017 12:07:37 +0800, Thierry Arnoux wrote:
> Yes, the spacing can be removed by tweaking CSS, here's my go at it:
> http://arnoux.ch/thierry/metamath/mathml/uniioombllem4.html
I'm having trouble downloading that - is it still running?
> I actually still prefer the version with more space (and regular line
> height), but I guess that's really a matter of personal preference!
It's not just "preference". With all the excess vertical space
I can see less than half of the number of steps at a time.
That's awful when trying to follow a proof.
Hi David and Norm,
Alright, here is the page on another server:
I suppose this shall already improve readability, what's your
opinion?
Next I'll indent the formulas left within proofs..
_
Thierry
Hi David,
KaTeX display is still work in progress, here is where I am:
http://metamath.tirix.org/Metamath.exe-170729.zip
You'll find the mathml pages in the previous directory (if you
don't run mmmathml.js, you'll get the original mathml code):
_
Thierry
Hi all,
I moved on with the MathJax offline rendering, using mathjax-node as described in the link provided by David.
Here is the result:
I think the gain is clear, the drawback being that the width of
the pages is static, it does not adapt to the screen you are using
to browsing with and obviously, that the time cost for rendering
the pages is now server side, which multiplies the time required
to generate the full set of a few tens of thousands of web pages.
This was manually generated - the next step would be to
automatize the process, and recover the "no margin, left
alignment" presentation.
If there is no objection, I will move on this path!
_
Thierry
Hi Benoît,
Coloring is there for both dependents and antecedents - maybe you
shall just actively reload the page (or simply reload http://metamath.tirix.org/hant.js)
to get it?
For wceq and wcel, in the mmdefinitions.html page, I need more
time to understand what's going on. I may have to add rules
especially for the mmdefinitions.html page, since actually
equality and elementhood are correctly displayed everywhere else!
I'll try to understand what is wrong with line breaks. I guess
this may have to do with the "N-ary times operator", ⨉, present in df-prds, which does not break
correctly.
I've been trying to stick to the same symbols as in the GIF/Unicode version, however because I used MathML there is no immediate one-to-one correspondence.
For example, ` limCC ` is disaplayed:
Whereas ℂ and ℂ are actually entities for the same glyph. For example, recently I've stumbled upon ` .0. ` (a variable usually representing the zero element of a group), which is represented as a zero with dotted underline in Unicode - I don't know how to create a dotted underline in MathML; in LaTeX, ` .0. ` is simply represented as a zero.
BR,
_
Thierry
Hi all,
Recently I've been catching up with this "structured typesetting" project, here is what I did :
Of course there is still much to do, but it time to start tracking changes - I shall actually have started it before.
_
Thierry
MarioIn the logical arena, I don't think I can compromise on at least /\ left assoc, higher precedence than -> right assoc. These are essential for making prop calc sane and are universal conventions (among books that formalize logic to begin with). Remember, I'm not talking about programming conventions at all. (However, it's worth noting that if you have ever done type theory or Haskell / functional programming, you will be very familiar with -> as a right assoc operator.) Furthermore, there is no reason we can't make precedence information easily accessible, similar to the "syntax hints" in the current HTML.I am fine with introducing mandatory parens whenever there is any significant disagreement about some precedence relation (as in the -u vs ^ case), but there needs to be an *actual* disagreement with some kind of reference, not some vague worry of confused users that haven't been taught any symbolic math. Let's face it: Metamath is really heavy on symbolic notation for math, and the reader *needs to learn it* to read it. We can make it easy for them to learn, but we should be aiming for something that an experienced mathematician with no Metamath training should be able to understand.
On Mon, Jul 17, 2017 at 1:24 AM, David A. Wheeler <dwhe...@dwheeler.com> wrote:
On Mon, 17 Jul 2017 00:30:31 +0100, Mario Carneiro <di....@gmail.com> wrote:
> I don't buy this argument. Within mathematics, there is a well-established
> precedence relation for all the common arithmetic operators.
It's absolutely true that there's a well-established precedence relation.
But many people don't *correctly* understand them, so I think the use of
precedence should be greatly limited. Particularly if you want a larger readership.
David Hilbert remarked on August 8, 1900:
An old French mathematician said: ‘A mathematical theory is not to
be considered complete until you have made it so clear that you can
explain it to the first man whom you meet on the street.’
http://www.sciencedirect.com/science/article/pii/S0315086016300465
Hidden rules such as precedence rules can *inhibit* clear reading of an
expression's meaning.
> I don't think we are really disagreeing; I am referring to the algorithm
> structure, not the result, which may very well have a good deal of parens.
Fair enough, I'm focusing on the final result.
> x. / are left assoc (always paren / against itself)
> + - are left assoc
I think x. having higher precedence than + and - is the "most safe".
However, a nontrivial number of programmers do *not* know this rule,
and it gets *worse* the further you stray from this.
> -> is right assoc
Would this be automatically widely *understood*? I have my doubts.
It's safer to parenthesize.
> There are probably a few more I'm missing, but this should eliminate almost
> all parens in usual metamath deductions.
The goal shouldn't be to minimize parens, the goal should be to maximize clarity.
I suggest starting with parens in most cases, then *slowly* removing ones
when it's obvious removing them isn't interfering with understanding.
If there's doubt, parenthesize.
--- David A. Wheeler
--
You received this message because you are subscribed to the Google Groups "Metamath" group.
To unsubscribe from this group and stop receiving emails from it, send an email to metamath+unsubscribe@googlegroups.com.
To post to this group, send email to meta...@googlegroups.com.
Visit this group at https://groups.google.com/group/metamath.
For more options, visit https://groups.google.com/d/optout.
Thank you!
To be fair, I think yes, Mario's algorithm could be hard to implement.Thank you!
To be fair, I think yes, Mario's algorithm could be hard to implement.
I think the part about "fixing the proof" so that it still appears complete seems complex to me.
In algorithm B, for example, if the proof has been reduced, the same sylanc step may be used by several steps down the road, how would you replace it?
You would also need to maintain a list of what is a "less important" theorem.
To be simpler, I would maybe keep the full proof, just hiding/collapsing the steps deemed less important.
Your idea about keeping only the n statements with highest labels could be interesting.
To start with, I had a simple highlighting of antecedents/dependent steps in previous versions. I've actually lost it due to a mistake when manually merging the sources files.
I've reinstated it here in one file:
http://metamath.tirix.org/inttsk.html
That may already help a bit to read long proofs.
BR,
_
Thierry
On 28/05/2018 02:14, Glauco wrote:
Nice job!--
Would it be hard to also implement an "hide less important steps" feature, like what Mario's described in this post?
https://groups.google.com/forum/#!topic/metamath/Wm3VIfun_qk
To keep it simple, having the option to show only the n (let's say 5) statements with highest label numbers (in set.mm).
Glauco
You received this message because you are subscribed to the Google Groups "Metamath" group.
To unsubscribe from this group and stop receiving emails from it, send an email to metamath+unsubscribe@googlegroups.com.
To post to this group, send email to meta...@googlegroups.com.
Visit this group at https://groups.google.com/group/metamath.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Metamath" group.
To unsubscribe from this group and stop receiving emails from it, send an email to metamath+unsubscribe@googlegroups.com.
So I've tried to prototype this proof collapsing on those pages, e.g.
http://metamath.tirix.org/geoihalfsum.html
(it shall actually be on all pages of the site)
The page is first displayed with 12 steps shown (those with the highest label rank, as proposed by Glauco), plus the hypothesis and the theorem's formula. For relatively short proofs, almost everything shall be displayed.
When hovering the mouse over a step row, its antecedents and
dependents steps are highlighted, as was already the case in
earlier versions of the script.
I've added a '^' (expanded) or '>' (collapsed) marker at the
beginning of the column (or a dot '·' if there is actually no antecedent step
to expand/collapse).
The idea is that it works like a revered tree, with the leaves at
the top and the root as the last line: when antecedents of a step
are collapsed, this goes all the way up. If shown again, they are
restored in their previous status.
I'm not completely satisfied with the result: as mentioned by
Norm, one has to "click his way" through the proof to see its
entirety. Tree implementations sometimes offer the possibility to
"expand all", I think this shall be available here too.
BR,
_
Thierry
--
That line shall now display correctly, but it seems that collapsing back a big number of steps take ages (ie. several seconds)
Maybe there is a need for some optimization._Thierry
On the other hand, I think there is still a need for the current direct translation of tokens into linear symbol strings, with no omission of parentheses, for people with little or no math background. One of the features that makes Metamath stand out from all other proof languages is that a proof can be followed in perfect detail by almost anyone, knowing only the mechanical substitution rule.
So for the long term future, I could see two displays, the mpeuni display and an mpethierry display, selectable just as mpeuni and mpegif are now. I'm not sure if anyone still needs the mpegif display - does anyone think so?
Hi,
Il 01/06/18 05:01, David A. Wheeler ha scritto:
> I think mpegif has served its purpose and can be declared obsolete.
> Font faces look nicer, perform better, and have practically universal
> support.
The only feature of mpegif I miss in mpeuni is the possibility to easily
see and copy the underlying Metamath code. Does anybody knows how to
recover that with mpeuni? Specifically, it seems that we (or, at least,
I) would like the possibility to select which text to copy when some
HTML span block is selected, in much the same way the alternative text
is copied when an image is selected. I am not an expert in HTML, but if
you think this would be useful I can ask on the relevant Q&A sites to
see if a reasonable solution can be cooked up. At that point I would
feel no need for mpegif anymore.
Hi Thierry,
I like the default collapsing you chose, which seems very good for getting an overview of the proof.
...
Hi all,
Copy to clipboard is relatively easy to implement, using the library mentioned by David. I've added that functionality, only to this page:
http://metamath.tirix.org/ftalem2.html
When hovering the mouse over one proof step, after a short while,
a tooltip shall be displayed with the Metamath source code for
that step.
There shall also be an icon at the right of the line; clicking on
that icon copies that Metamath source to the clipboard.
Other features are unchanged.
BR,
_
Thierry
--
Hi all,
Copy to clipboard is relatively easy to implement, using the library mentioned by David. I've added that functionality, only to this page:
http://metamath.tirix.org/ftalem2.html
When hovering the mouse over one proof step, after a short while, a tooltip shall be displayed with the Metamath source code for that step.
There shall also be an icon at the right of the line; clicking on that icon copies that Metamath source to the clipboard.Other features are unchanged.
BR,
_
Thierry
On 04/06/2018 09:32, Norman Megill wrote:
As an experiment, I put a link to Thierry's "Structured version" next to the "GIF version" or "Unicode version" link on each web page e.g.--
http://us2.metamath.org:88/mpeuni/ftalem2.html
so people can immediately compare Thierry's version during normal browsing.
Norm
On Thursday, May 31, 2018 at 12:22:40 PM UTC-4, Norman Megill wrote:Hi Thierry,
I like the default collapsing you chose, which seems very good for getting an overview of the proof.
...
You received this message because you are subscribed to the Google Groups "Metamath" group.
To unsubscribe from this group and stop receiving emails from it, send an email to metamath+unsubscribe@googlegroups.com.
To post to this group, send email to meta...@googlegroups.com.
Visit this group at https://groups.google.com/group/metamath.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Metamath" group.
To unsubscribe from this group and stop receiving emails from it, send an email to metamath+unsubscribe@googlegroups.com.
To post to this group, send email to meta...@googlegroups.com.
Visit this group at https://groups.google.com/group/metamath.
For more options, visit https://groups.google.com/d/optout.
First, thank you very much for all the encouraging comments!
I'll try to catch up with questions/requests as much as possible:
On 05/06/2018 06:30, David A. Wheeler wrote:
I think the remove parentheses action is too aggressive. Can't it be changed so that it removes parentheses only in certain cases? A few extra parentheses are not a problem.
--- David A.Wheeler --That's a very good point, and I think the previous discussion on parenthesis was not completely closed, but was rather pending some progress on my side with the page generation!
My original goal is to display expressions just like they would
be displayed on a textbook, so that e.g. a quadratic form ax2+bx+c
is rendered without parentheses, just as in a textbook. This of
course leads to ambiguity. To solve this, we could either put back
those parenthesis everywhere, or explicitly keep them only
for steps where associativity theorems are applied, or for
statements of associativity theorems, like ~addass*, which is what
one would see in textbooks.
A small bug with the http://metamath.tirix.org/ftalem2.html display: the N and S seem to be using the wrong font in the dIstinct variable list (and there is no S in the theorem). Also, in the syntax hints, some symbols like -> and sum_ are red instead of black.
Well, I guess I do have one more wish: a link to the whole proof in plain text; i.e. the response from the metamath program for "show me 2p2e4".
17 oveq1i.1=df-2 $a |- 2 = ( 1 + 1 )
18 eqtr4i.1=oveq2i $p |- ( 2 + 2 ) = ( 2 + ( 1 + 1 ) )
32 3eqtri.1=df-4 $a |- 4 = ( 3 + 1 )
37 oveq1i.1=df-3 $a |- 3 = ( 2 + 1 )
38 3eqtri.2=oveq1i $p |- ( 3 + 1 ) = ( ( 2 + 1 ) + 1 )
42 axi.1=2cn $p |- 2 e. CC
43 axi.2=ax-1cn $a |- 1 e. CC
44 axi.3=ax-1cn $a |- 1 e. CC
45 3eqtri.3=addassi $p |- ( ( 2 + 1 ) + 1 ) = ( 2 + ( 1 + 1 ) )
46 eqtr4i.2=3eqtri $p |- 4 = ( 2 + ( 1 + 1 ) )
47 2p2e4=eqtr4i $p |- ( 2 + 2 ) = 4
Your algorithm seems to have done a good job of choosing reasonable steps to provide these hints.
Would it be hard to also implement an "hide less important steps" feature, like what Mario's described in this post?
Actually the rules are implemented just like that:
$( By default, put brackets on infix operator classes $) $s class ( A F B ) $: <mfenced><mrow>#A# #F# #B#</mrow></mfenced> $. $( By default, don't put brackets on O-classes $) $s class-o ( A F B ) $: <mrow>#A# #F# #B#</mrow> $.
Would we choose to add a restriction, only these rules would not apply to ~addass* theorems.$( Associativity for addition $) $s class ( ( A + B ) + C ) $: <mfenced><mrow>#A# <mo>+</mo> #B# <mo>+</mo> #C# </mrow></mfenced> $. $s class ( A + ( B + C ) ) $: <mfenced><mrow>#A# <mo>+</mo> #B# <mo>+</mo> #C# </mrow></mfenced> $. $( Associativity for addition, non-fenced expressions $) $s class-o ( ( A + B ) + C ) $: <mrow>#A# <mo>+</mo> #B# <mo>+</mo> #C# </mrow> $. $s class-o ( A + ( B + C ) ) $: <mrow>#A# <mo>+</mo> #B# <mo>+</mo> #C# </mrow> $.
An older expand/collapse proof-of-concept experiment can be found here:
http://us.metamath.org/other.html#displib
Your comment provides no information and is not helpful.
What do you expect the arrow keys to do that they don't do now?