Metamath Proof Explorer < Previous Next >Nearby theoremsMirrors > Home > MPE Home > Th. List > pm5.74 Structured version Visualization version GIF versionTheorem pm5.74 262Description: Distribution of implication over biconditional. Theorem *5.74 of [WhiteheadRussell] p. 126. (Contributed by NM, 1-Aug-1994.) (Proof shortened by Wolf Lammen, 11-Apr-2013.)AssertionRef Expressionpm5.74 ⊢ ((𝜑 → (𝜓 ↔ 𝜒)) ↔ ((𝜑 → 𝜓) ↔ (𝜑 → 𝜒)))Proof of Theorem pm5.74Step Hyp Ref Expression1 biimp 207 . . . 4 ⊢ ((𝜓 ↔ 𝜒) → (𝜓 → 𝜒))2 1 imim3i 64 . . 3 ⊢ ((𝜑 → (𝜓 ↔ 𝜒)) → ((𝜑 → 𝜓) → (𝜑 → 𝜒)))3 biimpr 212 . . . 4 ⊢ ((𝜓 ↔ 𝜒) → (𝜒 → 𝜓))4 3 imim3i 64 . . 3 ⊢ ((𝜑 → (𝜓 ↔ 𝜒)) → ((𝜑 → 𝜒) → (𝜑 → 𝜓)))5 2, 4 impbid 204 . 2 ⊢ ((𝜑 → (𝜓 ↔ 𝜒)) → ((𝜑 → 𝜓) ↔ (𝜑 → 𝜒)))6 biimp 207 . . . 4 ⊢ (((𝜑 → 𝜓) ↔ (𝜑 → 𝜒)) → ((𝜑 → 𝜓) → (𝜑 → 𝜒)))7 6 pm2.86d 108 . . 3 ⊢ (((𝜑 → 𝜓) ↔ (𝜑 → 𝜒)) → (𝜑 → (𝜓 → 𝜒)))8 biimpr 212 . . . 4 ⊢ (((𝜑 → 𝜓) ↔ (𝜑 → 𝜒)) → ((𝜑 → 𝜒) → (𝜑 → 𝜓)))9 8 pm2.86d 108 . . 3 ⊢ (((𝜑 → 𝜓) ↔ (𝜑 → 𝜒)) → (𝜑 → (𝜒 → 𝜓)))10 7, 9 impbidd 202 . 2 ⊢ (((𝜑 → 𝜓) ↔ (𝜑 → 𝜒)) → (𝜑 → (𝜓 ↔ 𝜒)))11 5, 10 impbii 201 1 ⊢ ((𝜑 → (𝜓 ↔ 𝜒)) ↔ ((𝜑 → 𝜓) ↔ (𝜑 → 𝜒)))Colors of variables: wff setvar classSyntax hints: → wi 4 ↔ wb 198This theorem was proved from axioms: ax-mp 5 ax-1 6 ax-2 7 ax-3 8This theorem depends on definitions: df-bi 199This theorem is referenced by: pm5.74i 263 pm5.74ri 264 pm5.74d 265 pm5.74rd 266 bibi2d 334 pm5.32 570 orbidi 976Copyright terms: Public domain W3C validator
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/metamath/6025E3C8-6FC7-4934-BD53-A3EBC813048F%40dwheeler.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/metamath/CAOoe%3DWLdRVvxzGv1H%3D4U6uNYMgScV3atzD1LB3S9bKya60d7tw%40mail.gmail.com.
I do see big downsides for the use cases listed here though:
1. For training a GPT, I fear that the system would focus on "it's a JSON file!"
and any tool-specific training would be swamped by thinking it's the same as other JSON files.
I think a GPT system that trains on the "Internet as a whole" is more likely to
generate some useful information if we minimize distractors.
In short, make it REALLY OBVIOUS that this text is regular in some way, yet
clearly different from anything else, and expose structure where we reasonably can.
2. For rendering on the client side, there are big advantages to showing static data
as straight HTML. For one, people who disable JavaScript can still see it fine.
Sure, sometimes it's useful to run arbitrary code sent by strangers, but there are good
reasons to minimize that as a requirement :-). It also means that search engines see
"what we actually have".
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/metamath/35c36bf7-dba3-4f41-b4fc-c1dca91769c5n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/metamath/CAFXXJSuRZBQ0E%2BLgGmMEgMUhsw5wFkLsL7%3DGe62w0gfxUBKPkw%40mail.gmail.com.
> While I have some sympathy for this argument, I also think it is holding us back a lot. Catering to the least common denominator of no-JS means that our web pages are stuck permanently in web 1.0, with no search functionality, intra-page links, subproof expansion, mathml rendering, go-to-definition for symbols, or a laundry list of other features. Furthermore, doing the rendering client-side means that the cost of transmission is lower which means shorter load times and no need for a two-hour processing phase.
What I want is for *a* way for people to access the basic information without *requiring* client-side JavaScript. I see no reason that it be the *only* way we provide the information, we already provide it in multiple forms. I just want to retain that capability. So you don't need to feel held back :-).
Indeed, you can implement rendering with client-side JavaScript today, just download the .mm files.
The current CORS setting means that any client-side JavaScript program can do that, it doesn't even need to be hosted on us.metamath.org. So technically people today can view the generated HTML on the website, *or* use any client-side JavaScript/WebAssembly. We "just" need someone to write the client-side renderer.
Also, almost everything you listed doesn't require client-side JavaScript. Intra-page links work (they're just hyperlinks), subproof expansion works (use HTML <details>), MathML ships in Chromium & Chrome & Firefox (Firefox's support is only partial but it's probably more than enough for us) per <https://developer.mozilla.org/en-US/docs/Web/MathML>, go-to-definition is just another hyperlink, and so on.
Basic searches can be supported via a form that queries a search engine (e.g., Google).
As far as speed goes, JavaScript is often slower than HTML where both can be used. In practice JavaScript files are often quite large, and JavaScript has to be parsed, examined, executed, and then its execution must cause document tree changes which finally get rendered. Web browsers are *really* good at rapidly & progressively rendering HTML. On systems I've worked with, HTML (even with server roundtrips) is often *MUCH* faster when measuring paint-to-screen times. JavaScript *has* gotten faster over the years, thankfully, but the gap is still large. Of course, when you need functionalities only provided by JavaScript then you need it. Like all technologies there are tradeoffs.
> Is there much reason not to create JSON in addition to HTML? If disk space is a concern, consider that it can be a win-win to store precompressed pages (i.e. with gzip).
No *big* reason. Indeed, if we want to make it *easy* for people to generate their own renderers or analyze Metamath results without specialized parsing, the obvious way to do that would be to generate JSON. I think that'd make a lot of sense. That still involves a daily pre-run, but I don't think there's any serious problem in doing 1/day regenerations.
We'd have to figure out specifics, which means we need to figure out how they'd be used. If we generate a separate JSON file for each theorem, then it's really easy for a rendered to get just what it needs. However, that's a lot of files, and compression might not help our storage needs. The filesystem block size is 4KiB, so anything under 4KiB is 4KiB storage. We could generate a single massive JSON file of all theorems; that might be useful for ML training if they plan to process the JSON further, but the file would be huge so I think a client-side program would be better off loading the .mm database directly instead. A massive JSON file might be useful for other purposes, and that *would* be best stored compressed.
We currently don't have *lots* of extra storage space. If we add a major new set of generated data it's likely we'll need more space. We could retire mpegif, add more storage ($ that currently I pay, but maybe others could chip in), or look for another provider ($?).
What started this thread was trying to see if we could get "free" training on GPT-3 by presenting something easier for them to consume, *without* controlling them. I don't think generating JSON will do that. The JSON certainly could make it easier for organizations who want to specially train ML systems on the existing databases, and are willing to do "a little cleaning" by processing the JSON. If we pregenerate JSON from the .mm databases, the most likely use cases would be to make it easier for rendering tools & ML labs that want to do a little (but not a lot) of work.
> On Feb 18, 2023, at 4:08 PM, Mario Carneiro <di....@gmail.com> wrote:
> In case it wasn't clear (and it probably wasn't), in a future world in which the default mechanism is some super fancy client side renderer it is still possible to offer a fallback "static site" of HTML pages which is nevertheless not generated in advance and is being served dynamically server-side. This has a relatively small generation cost even if we don't stick a CDN in front of it, but if we do then I think that's a viable approach to having all the HTML pages with basically zero preprocessing, just a smarter server. I would really love it if the only thing the site build needs to do is download and load the latest set.mm .
I understand, that's just a typical dynamically-generated data file and/or HTML with possibly front-end JavaScript. Bog standard stuff. Of course, there are pluses & minuses with that approach. In the 2010s almost everyone switched to that model, today there's a big press back to statically-regenerated sites where practical (with Jekyll, etc.) because attackers routinely pop systems that do dynamic response.
There are big concerns if you hook up a program written in C to input sent by an attacker. Rigorous input filtering would definitely help, but using something like metamath-knife as a basis instead of metamath-exe might be better. So doing this would involve a nontrivial amount of software, *along* with analysis to ensure that it was unlikely to lead to a vulnerability. Statically generating files is a much simpler path from where we are. That's not to say we must go that way, but it'd take more effort to do full dynamic generation *with* confidence in its security.
> I don't think this is a very competitive option though, since you would have to load all of set.mm.
It's more competitive than you might think. Igor's prover loads the whole database in a few seconds.
Even if you have a highly optimized mm verifier, you can't get around the fact that you need to send some 30 MB over the wire before you can do anything.
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/metamath/CAJ48g%2BBXDYisz8C%3DvWkOLEUj7V%2BoeCwONqL0m4bDdKZ%2B3EvaEg%40mail.gmail.com.
> While yes I agree that this would be much better done with metamath-knife than metamath-exe, I don't think there is a major concern here, or at least we can mostly mitigate the issues since this flow is extremely light on input from the attacker. Basically the only thing you can specify is the theorem you want to see. But for sure I'm not interested in doing this by building on metamath-exe, there are some great frameworks for writing these kind of servers in rust that should already handle most of the issues. The main thing to be concerned about is DOS attacks, and having a 'real' server like nginx in front helps with that.
>
> But our threat model is pretty much nonexistent to begin with; almost all the server data and code is public domain in the first place and even if the server is taken down it's not a critical service. I think a much more critical problem for the project is giving a perception of being an old unfriendly software used by few.
It's not a *critical* service absolutely, but there are a lot of attackers who just attack everything using a variety of tools, then see what they can get out of it. So I'd rather make it hard to successfully attack the site. I agree that strong filtering would eliminate many problems.
My first choice when building a website, where it's easily achieved, is static rendering (statically-generated pages) where the most important data is visible without client-side JavaScript. Those are easily understood, incredibly hard to attack, trivial to configure, trivial to mirror, support security/privacy-conscious users, etc. Some sites *cannot* be developed this way, of course!! But using that as the "starting point" helps clarify "what else do you need?" - that is, it forces a discussion of "what are the unspoken requirements?". It's also where we are in the metamath site.
A disadvantage fo static rendering is that you have to prerender all pages, which takes time. I see that as a non-problem for our case; if someone can't wait a few hours, they can use tools to locally generate the page themselves.
We can obviously use a program to dynamically generate many of the pages instead, but what would it need to do?
> I expect to have a proposal for a JSON format - just a parse tree of a .mm file, really - early next month if not sooner.
I think the more interesting case is a JSON format for a *single* proof.
For a specific database, perhaps the website needs to provide:
* The .mm database.
* Introductory HTML pages (explaining what's going on).
* At least one HTML display for each statement (theorem/axiom).
* A JSON format for each statement, to make it easy for renderers to grab that data & generate fancy displays. That implies the JSON should probably include all the data in the current HTML generate page, including data about related theorems & an expansion of every proof step.
* Auto-generated table-of-contents (HTML & JSON?)
I think it's important that at least 1 HTML format show "the basics" if JavaScript isn't enabled. This is easily done by having progressive rendering *or* an alternate HTML page. An alternate "fancy" HTML page could download the JSON format and do many fancy things, without having to parse the .mm file.
I don't know if we need a JSON format for the .mm file as a whole. One approach for doing that would be to generate a JSON file that in turn contains the contents of every per-theorem JSON file. That would be a really big file, even precompressed - does anyone *want* that? What do they plan to do with it? We already compress the .mm file because they've gotten big. One possible use would be training AI systems, but they'd need to do post-processing of that to make it useful for them anyway. My earlier proposal involved trying to create a format pre-processed to make it easier for them to read, because if they're specially training an ML system, some preprocessing usually gets better results.
I don't see those as competing goals at all. They play different roles: for browsing you would ideally have some server supplying only the required information to render a specific proof, and for a proof assistant (and to some extent a search tool as well) you want to have the whole database available,
a streaming parser can only save you a factor of 2 if we assume that theorems of interest are sampled uniformly.
> I expect to have a proposal for a JSON format - just a parse tree of a .mm file, really - early next month if not sooner.
I think the more interesting case is a JSON format for a *single* 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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/metamath/3fcc0b30-42ad-4bda-9627-73aa59c66fa2n%40googlegroups.com.
And since we're there, I'd also like to recall this other live site:
All pages are rendered dynamically, there are 3 modes:
Source code here.
_
Thierry
2. The text just runs off to the right, instead of going over multiple lines, making long ones unreadable. That's important but easy for the non-MathML case (just a little CSS), though I don't know how hard that is for MathML/MathJax.
3. I think it's important we support existing URLs. That's easy with pregeneration, just rename to taste. If this is dynamically generated, that would require some changes to support the .html endings *and* support returning static pages.
4. This one omits many of the capabilities of the metamath-exe generator, e.g., compare with <https://us.metamath.org/mpeuni/areacirc.html>. That includes:
Distinct variable group: 𝑥,𝑦,𝑅
Allowed substitution hints: 𝑆(𝑥,𝑦)
Colors of variables (off, setvar, class) ... this one isn't as important to me & would be a lot of work, so I'm not fussy there.
Syntax hints (with links to them)
List of axioms used (with links)
List of definitions used (with links)
List of theorems that reference it (with links)
> On Thu, Mar 2, 2023 at 12:53 PM David A. Wheeler <dwhe...@dwheeler.com> wrote:
> 2. The text just runs off to the right, instead of going over multiple lines, making long ones unreadable. That's important but easy for the non-MathML case (just a little CSS), though I don't know how hard that is for MathML/MathJax.
>
> On Mar 2, 2023, at 4:33 PM, Mario Carneiro <di....@gmail.com> wrote:
> This is a pretty fundamental problem with MathJax style displays, and I don't have a good solution. LaTeX generally isn't great about automatic line breaking inside mathematics, but metamath routinely involves very large formulas, so although this looks good for the mid-sized examples the large ones really suffer. A related issue is that mathjax isn't really able to cope with having thousands of large and complex formulas on a page and the CPU time / draw time really spikes on some of the examples. For MM0 I'm planning to mostly just sidestep this issue by using ASCII-first displays, perhaps using unicode or programming fonts with ligatures but not much more. That way line breaking is limited to just pretty printing which can feasibly be written with a handcrafted JS library.
That makes sense. I don't *object* to beautiful presentations, but if that's unsolved, we could generally prefer pointing to the Unicode versions (where long formulas are easily handled).
MathJax is well aware of the need for automatic line breaking. They hope to have s version 3 that resolves it:
https://docs.mathjax.org/en/latest/output/linebreaks.html
https://stackoverflow.com/questions/40628064/mathjax-automatic-line-breaking-when-resizing
... I'm fine with letting them solve the problem & we use their solution. I don't know when they'll actually do that (if ever).
>
> 3. I think it's important we support existing URLs. That's easy with pregeneration, just rename to taste. If this is dynamically generated, that would require some changes to support the .html endings *and* support returning static pages.
>
> I don't think this will be difficult no matter what we do, since we can set up all the necessary routing in nginx.
Not *difficult*, but some are harder than others if we *dynamically* generate.
In nginx you would typically specify a location pattern as a parameter, and if it matches,
call a program (e.g., using fastcgi). Here's an example:
https://www.nginx.com/resources/wiki/start/topics/examples/fastcgiexample/
You'd *like* to have the web server directly serve static files (they're good at that!),
but currently directories like "mpeuni" have a lot of files, some of which might be dynamically generated
while others are probably statically generated. Typical websites put them in separate directories,
to make it easy to tell them apart.
If they're all dynamically generated via the same program, or all statically generated, then that's moot.
> I think the variable coloring heuristic uses some hard-coded typecode names so it is not suitable for general databases; there are actually quite a few aspects of the web site generator that are tailored for set.mm which should probably use $t commands instead.
We could start with hard-coding, then move towards supporting a general form.
I agree that in the long term we want to be general.
I suspect type code coloring primarily useful to new users... but since we *do* want to new users/readers, that's still relevant. We could even add it later, but it also doesn't seem *that* hard to implement (at least hard-coded).
> I would link an example here, but I'm not sure where to host it. On that note, we might consider a place on the main website for experimental stuff now that us2 is down. Do you know if there is a spot which already works for this? I'm thinking of some place where it is safe to just drop files and have them persisted across website builds, with a URL that implies that they may go offline at any time.
I can trivially create the name "experimental.metamath.org" (or whatever you like), and point it somewhere. The real question is, where should it point?
* It *could* point to the metamath.org site. It doesn't have a lot of space for many more copies, and if you're not ready for it to get attacked that'd be a bad thing. That requires no new money.
* You could set up a site literally anywhere else. A linode node costs $6/month. Heroku has a low-cost plan (not free though).