Zulip Chat Archive
Stream: Equational
Topic: Metatheorem: complexity-preserving equations
Hernan Ibarra (Sep 29 2024 at 14:29):
Apologies if someone has thought of this before, I could not find anything in previous discussions. Say an equation is complexity-preserving (equicomplex?) if the number of times the binary operation is applied on the LHS equals the corresponding number on the RHS. Then a complexity-preserving equation cannot imply an equation that does not preserve complexity. (I think this is true, but would appreciate feedback). Maybe someone here knows how to calculate the number n of complexity preserving equations. Then the number of implications settled (on the negative) by this metatheorem is n*(4694 - n).
Joachim Breitner (Sep 29 2024 at 14:37):
Maybe I'm misunderstanding, but doesn't x = y
imply all other equations? That looks complexity-preserving according to your definition?
Hernan Ibarra (Sep 29 2024 at 14:42):
Joachim Breitner said:
Maybe I'm misunderstanding, but doesn't
x = y
imply all other equations? That looks complexity-preserving according to your definition?
Ah you are right, silly me. I should add to the definition that the set of variables (counted with multiplicity) in the LHS and RHS are also equal. Does this work now?
Daniel Weber (Sep 29 2024 at 14:46):
You might be able to get numbers from the formulas in equational#80
Edward van de Meent (Sep 29 2024 at 14:47):
maybe it is the case that such an equation implies a non-preserving equation, but there is no proof?
Edward van de Meent (Sep 29 2024 at 14:50):
or does this fall under completeness of first-order logic?
Hernan Ibarra (Sep 29 2024 at 14:50):
Edward van de Meent said:
maybe it is the case that such an equation implies a non-preserving equation, but there is no proof?
No, this contradicts the Godel's completeness theorem (not to be confused with his incompleteness theorems, see here).
Daniel Weber (Sep 29 2024 at 14:50):
Edward van de Meent said:
or does this fall under completeness of first-order logic?
I believe it does
Maja Kądziołka (Sep 29 2024 at 15:04):
Indeed, once you add the assumption that all variables occur the same number of times on both sides, this works as a consequence of Birkhoff's theorem (by induction on proof tree)
Hernan Ibarra (Sep 29 2024 at 15:06):
Maja Kądziołka said:
Indeed, once you add the assumption that all variables occur the same number of times on both sides, this works as a consequence of Birkhoff's theorem (by induction on proof tree)
If I understand correctly, Birkhoff's theorem is 'completeness for equational logic' right? (I quickly glanced at the wikipedia page). In that case, I agree with you.
Maja Kądziołka (Sep 29 2024 at 15:08):
I think you can have a similar metatheorem: an equation where all variables occur on both sides cannot imply one where the occur set differs between the two sides of the equation
Maja Kądziołka (Sep 29 2024 at 15:10):
I suppose the next question to ask is for what other such metrics/invariants the proof works out
Daniel Weber (Sep 29 2024 at 15:13):
There are 164 equations where all variables occur on both sides, and in 32 of those the multisets are also equal
Maja Kądziołka (Sep 29 2024 at 15:14):
I suppose this is the sort of thing that might be well-known by universal algebraists
Hernan Ibarra (Sep 29 2024 at 16:01):
Maja Kądziołka said:
I think you can have a similar metatheorem: an equation where all variables occur on both sides cannot imply one where the occur set differs between the two sides of the equation
You don't need that all variables occur right? Only that the multisets are equal. So I think the general metatheorem is that equations whose LHS and RHS multisets are equal cannot imply equations whose multisets differ. (Again, correct me if I'm wrong).
Daniel Weber (Sep 29 2024 at 16:08):
A more general metatheorem is that for every function on multisets which satisfies and , if then the equation can only imply other equations which satisfy that, although I'm not certain these are the correct conditions on .
Cody Roux (Sep 29 2024 at 16:26):
I could add formalizing proof rules and Birkhoff's theorem to https://github.com/teorth/equational_theories/issues/104, is that a good idea?
It's probably not _too_ much pain for equational logic.
Hernan Ibarra (Sep 30 2024 at 07:43):
I see this metatheorem has been added to the blueprint two hours ago as Theorem 3.8. The slick proof there is better and doesn't appeal to Birkhoff's theorem.
Daniel Weber (Sep 30 2024 at 07:55):
Maja Kądziołka said:
I think you can have a similar metatheorem: an equation where all variables occur on both sides cannot imply one where the occur set differs between the two sides of the equation
This can also be established in a similar fashion, by considering with bitwise or
Hernan Ibarra (Sep 30 2024 at 07:55):
It generalizes as well, doesn't it?
Hernan Ibarra (Sep 30 2024 at 07:55):
Oh you beat me to the punch
Hernan Ibarra (Sep 30 2024 at 07:58):
I'm not sure we are saying the same thing actually. We can have a metatheorem that says: if each variable occurs on the LHS and the RHS the same number of times modulo n then it can only imply equations of the same type.
Hernan Ibarra (Sep 30 2024 at 08:00):
And the same proof works right? Consider linear forms modulo n
Daniel Weber (Sep 30 2024 at 08:03):
Oh, that's not what I meant, I talked about each variable occuring on both sides
Hernan Ibarra (Sep 30 2024 at 08:05):
Ah okay I see. But does the new metatheorem make sense?
Terence Tao (Sep 30 2024 at 09:24):
Ah, I was just going to notify this thread that I had formalized the first metatheorem on the blueprint, but I see you noticed it already. Please feel free to add additional metatheorems of this type directly to the blueprint. I will also create a task to formalize the first metatheorem in Lean.
Daniel Weber (Sep 30 2024 at 09:43):
This can be generalized to any specific magma where checking laws is easy, right? Another example is that equations where the leftmost variable is equal in the LHS and RHS can't imply an equation where it isn't (by using any magma with )
Terence Tao (Sep 30 2024 at 09:45):
Would you be willing to add that lemma (and its dual) to the blueprint also? Collecting all these easy metatheorems could be worthwhile (and good practice for formalization of metatheory).
Anand Rao Tadipatri (Sep 30 2024 at 11:06):
I may have a slightly different way to prove @Hernan Ibarra's metatheorem (adapting the proof from the blueprint) that may generalize to other invariants of expressions.
Let be a law such that every variable appears the same number of times in both and , and let be a law implied by it. Further, assume that these expressions contain at most variables . The condition on the law is equivalent to the statement that evaluating both expressions and in the magma under the substitution , where is the th basis vector of the form , yields equal elements of .
It turns out that is in fact a model of the law . Consider arbitrary elements of . Performing the substitution in an expression is equivalent to first performing the substitution and then applying the unique endomorphism of sending each to . By assumption, both expressions and evaluate to the same element of after the substitution , and therefore, they evaluate to the same element of after the substitution . This holds for any set of elements of , and hence is a model for the law .
This means that is also a model for the law , since this is assumed to be implied by . In particular, this means that performing the substitution evaluates both and to the same element of . This is equivalent to saying that and have the same multisets of variables appearing in them, and the result follows.
Anand Rao Tadipatri (Sep 30 2024 at 11:10):
I believe that one can use the magma in this argument to cover the case of counting variable multiplicities modulo .
Daniel Weber (Sep 30 2024 at 11:10):
Isn't that basically the same argument except over instead of ?
Anand Rao Tadipatri (Sep 30 2024 at 11:13):
I think @Daniel Weber's argument follows by replacing with the free magma on satisfying the multiplication law .
Anand Rao Tadipatri (Sep 30 2024 at 11:13):
Yes, it is adapted from that, but I feel that this formulation may be easier to formalize and generalize.
Hernan Ibarra (Sep 30 2024 at 11:46):
I like this proof a bit better since it makes explicit the linear algebra. With the old argument you need the result that the coefficients of a linear form (over R say) are uniquely determined. I know this is equivalent but the linear algebra formalism will maybe make it easier to formalise, as Anand says.
Anand Rao Tadipatri (Sep 30 2024 at 12:04):
Anand Rao Tadipatri said:
Yes, it is adapted from that, but I feel that this formulation may be easier to formalize and generalize.
To elaborate further, I believe that this argument generalizes by replacing by any magma with a lifting property, i.e., if there is a set and map such that any extends to a magma homomorphism satisfying .
In the proof above, and with .
Anand Rao Tadipatri (Sep 30 2024 at 12:07):
It's possible that I haven't understood the proof in the blueprint completely and that this generalization is also implied by it, in which case I apologize for the confusion and redundancy.
Cody Roux (Sep 30 2024 at 14:11):
I think I can prove this relatively easy using completeness, and the concrete proof syntax from https://github.com/teorth/equational_theories/pull/123, will do that today if there's still interest.
Anand Rao Tadipatri (Sep 30 2024 at 14:39):
Thanks, I was about to take a stab at formalizing this and the MagmaLaw
definition was exactly what I needed. I may still try to have a go at it over the next couple of hours; I'll let you know if I make any progress.
Terence Tao (Sep 30 2024 at 14:52):
I like the new proof too. I am busy the whole day, but if anyone wants to go and and PR in the new proof to replace the old one on the blueprint, please go ahead (but make a note here that you are doing so there is no duplication of effort)!
Hernan Ibarra (Sep 30 2024 at 17:03):
I would like to add a new section on these metatheorems in chapter 3. I will try to work on the blueprint today.
Cody Roux (Sep 30 2024 at 18:23):
I've proven a simple meta-theorem along these lines, hope this was not unwarranted (I didn't create an issue, etc):
Is this related to what we want? Does it help?
Edward van de Meent (Sep 30 2024 at 18:29):
i might be reading this wrong, but isn't your definition of FreeMagma.size
constantly 0?
Edward van de Meent (Sep 30 2024 at 18:39):
in the base case it's 0, and otherwise you take the sum of the parts? so it's still 0?
Daniel Weber (Sep 30 2024 at 18:52):
You can use order
from https://github.com/teorth/equational_theories/blob/main/equational_theories/Counting.lean#L12
Cody Roux (Sep 30 2024 at 19:09):
hehe oops
Cody Roux (Sep 30 2024 at 19:10):
miraculously, adding +1
to the size of Fork
does not change the validity of any proofs!
Cody Roux (Sep 30 2024 at 19:11):
(try doing that in a paper proof!)
Cody Roux (Sep 30 2024 at 19:45):
@Daniel Weber updated to use that definition. Should I PR?
Anand Rao Tadipatri (Sep 30 2024 at 21:28):
I've made an attempt at formalizing the meta-theorem in generality, but it needs more work: https://github.com/0art0/equational_theories/blob/e238b81b3ae2b195eab96ddc3243796257c5c116/equational_theories/LiftingMagma.lean. Some of the changes I've introduced break code in Compactness.lean
, so this is not yet ready to be merged (on the bright side, the proof of soundness is now a single line of code that uses aesop
).
Anand Rao Tadipatri (Sep 30 2024 at 21:29):
I'll be joining @Hernan Ibarra in working on the section of the blueprint for metatheorems. We would like to lay the result out in generality, so we anticipate that it may take a bit of time.
Cody Roux (Oct 01 2024 at 02:27):
I've created an issue, in addition to a PR (though I haven't marked the PR as resolving the issue quite yet):
https://github.com/teorth/equational_theories/issues/156
https://github.com/teorth/equational_theories/pull/152
I'm actually confused about what we're doing here; I'll open a new thread to discuss what the general structure of our metatheorems development should be.
Last updated: May 02 2025 at 03:31 UTC