Repository navigation
Conversation
|
One thing I am concerned about is that including proofs in this Github repo will result in lots of models being trained on them. Would it be possible to instead add these machine proofs as an extra column to the huggingface dataset and add a line in this repo's README pointing to huggingface? I already regret hosting any part of this benchmark on Github, but at least the formal proofs can be saved from data contamination. |
There was a problem hiding this comment.
It turns out many of the "solutions" are due to erroneous formalization.
Personally, I'd like to see techniques like reflection, self-consistency, and refinement/debate/critique etc. be used together with autoformalization to automatically catch dubious formalizations and generate reasoning traces / CoT (ToT?) data that could be used to fine-tune the model.
It does not seem outlandish to hope LLMs could become sample efficient enough to master a subject just by reading a book on it, doing all exercises, and fine-tuning on all thoughts generated in the process. It seems people are having success building customer service bots etc. by embedding and retrieving from documentation and historical Q&A data and prompting with retrieved entries, without the need of fine-tuning; nowadays there are even long context models like MPT-65k and Claude-100k that can fit a whole book into their working memory. However, for hard tasks like mathematics, I think fine-tuning on synthetic reasoning data would definitely be beneficial, given unsatisfactory reasoning capabilities of current (especially open source) models.
| theorem exercise_2_1_26 {G : Type*} [group G] | ||
| [fintype G] (a : G) : ∃ (n : ℕ), a ^ n = 1 := | ||
| sorry | ||
| begin | ||
| exact ⟨0, pow_zero a⟩, | ||
| end |
There was a problem hiding this comment.
The exercise states "positive integer".
| theorem exercise_7_1_12 {F : Type*} [field F] {K : subring F} | ||
| (hK : (1 : F) ∈ K) : is_domain K := |
There was a problem hiding this comment.
hK is redundant by definition of subring in mathlib (see subring.one_mem).
|
|
||
| theorem exercise_4_5_17 {G : Type*} [fintype G] [group G] | ||
| (hG : card G = 105) : | ||
| nonempty(sylow 5 G) ∧ nonempty(sylow 7 G) := |
There was a problem hiding this comment.
Both exercises require the Sylow subgroups to be normal, which is omitted in both formalizations.
| theorem exercise_3_1_22b {G : Type*} [group G] (I : Type*) | ||
| (H : I → subgroup G) (hH : ∀ i : I, subgroup.normal (H i)) : | ||
| subgroup.normal (⨅ (i : I), H i):= |
There was a problem hiding this comment.
This should probably be added to mathlib ...
| [module F V] (v : V) (a : F): a • v = 0 ↔ a = 0 ∨ v = 0 := | ||
| sorry | ||
| begin | ||
| simp [smul_eq_mul], |
There was a problem hiding this comment.
smul_eq_mul isn't actually used, I guess.
There was a problem hiding this comment.
Yep, smul_eq_mul is indeed redundant here, but that's what the prover generated.
| theorem exercise_2_1_27 {G : Type*} [group G] | ||
| [fintype G] : ∃ (m : ℕ), ∀ (a : G), a ^ m = 1 := |
There was a problem hiding this comment.
This exercise states "integer m > 0" too, but fintype.card G does satisfy the condition.
| theorem exercise_2018_a5 (f : ℝ → ℝ) (hf : cont_diff ℝ ⊤ f) | ||
| (hf0 : f 0 = 0) (hf1 : f 1 = 1) (hf2 : ∀ x, f x ≥ 0) : | ||
| ∃ (n : ℕ) (x : ℝ), iterated_deriv n f x = 0 := | ||
| sorry | ||
| begin | ||
| use (1/2), | ||
| use 0, | ||
| norm_num [hf0], | ||
| end |
There was a problem hiding this comment.
How could there be such an easy Putnam problem? Turns out the statement should say iterated_deriv n f x < 0, see https://kskedlaya.org/putnam-archive/2018.pdf
Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>
Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>
Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>
|
Thank you for the corrections @alreadydone ! I've added commits that fix 6 wrong formalization and improve two formalizations. @yangky11 It would be great if you could rerun your model on the statements that were modified. I still would like to avoid having solutions to the benchmark on Github. I still would suggest adding a |
zhangir-azerbayev
left a comment
There was a problem hiding this comment.
- Rerun model on modified statements.
- Delete solutions from Github and move to huggingface.
|
Hi Zhangir and Junyan, Thank you for your feedback on these proofs! That's really helpful, because, TBH, I cannot make sense of most of these theorems/proofs. I agree with Zhangir's worry about data contamination and potentially moving all proofs to another place. Do we know Hugging Face is not included in the training data of LLMs? Also, if all proofs are removed from the repo, we need a convenient way to track which theorems have proofs (maybe using comments next to It's quite surprising to me many of these proofs uncover issues of the original formalization. Now I'm a bit short of compute due to an incoming deadline, but I'm happy to run the prover on the updated proofs later. |
|
Hi, I have finished re-running a new version of the model. It proved 1 out of the 7 modified theorems (f63ea51). In addition, it also proved 10 theorems that weren't in the first batch (5854981, 19b1112). @alreadydone It would be great if you can take a look and see if any of them has incorrect theorem statement. Thank you! |
|
Thanks! There are some nice proofs, but I also spotted some problems in formalization, which @zhangir-azerbayev can take a look at 19b1112. I also find strange numberings inconsistent with Pugh's book, see 060d4b1#r117194793 |
Can you elaborate on why? |
Zhangir may elaborate more, but the issue simply is that the benchmark is meant for evaluating LLMs, and because they are typically pretrained on multiple internet resources -- including Github -- it means that these models may memorize the examples from the benchmark. Then good performance achieved on the tasks based on the benchmark cannot be fully attributed to generalization achieved by the model but at least partially to memorization. |
|
Thanks @yangky11 for the proofs and @alreadydone for catching errors. Here's my plan for how to proceed with this PR.
|
|
@alreadydone Thank you for checking the proofs! @zhangir-azerbayev That sounds good to me! It would also be great to keep track of which theorems have proofs in the comments in this repo. Our system name is |
alreadydone
left a comment
There was a problem hiding this comment.
In response to an email from @yangky11 I'm adding more comments.
| theorem exercise_11_2_13 (a b : ℤ) : | ||
| (of_int a : gaussian_int) ∣ of_int b → a ∣ b := | ||
| sorry | ||
| begin | ||
| contrapose, | ||
| simp, | ||
| end |
There was a problem hiding this comment.
squeeze_simp gives simp only [of_int_eq_coe, coe_int_dvd_coe_int, imp_self] but exact (coe_int_dvd_coe_int a b).1 is sufficient.
| rintros ⟨a⟩ ⟨b⟩, | ||
| exact congr_arg coe (mul_comm a b) |
| rw infi, | ||
| rw ←set.image_univ, | ||
| rw Inf_image, | ||
| simp [hH], | ||
| haveI := λ i, (H i).normal, | ||
| split, | ||
| intros x hx g, | ||
| rw subgroup.mem_infi at hx ⊢, | ||
| intro i, | ||
| apply (hH i).conj_mem _ (hx i), |
There was a problem hiding this comment.
We can produce a shorter proof manually, but it's certainly nice to be able to automate this.
| rw infi, | |
| rw ←set.image_univ, | |
| rw Inf_image, | |
| simp [hH], | |
| haveI := λ i, (H i).normal, | |
| split, | |
| intros x hx g, | |
| rw subgroup.mem_infi at hx ⊢, | |
| intro i, | |
| apply (hH i).conj_mem _ (hx i), | |
| split, | |
| simp_rw subgroup.mem_infi, | |
| exact λ x hx g i, (hH i).conj_mem _ (hx i) _, |
| cases sq_eq_one_iff.1 hx with h h, | ||
| exacts [or.inl h, or.inr h], |
There was a problem hiding this comment.
| cases sq_eq_one_iff.1 hx with h h, | |
| exacts [or.inl h, or.inr h], | |
| exact sq_eq_one_iff.1 hx |
| is_open_map π₁ ∧ is_open_map π₂ := | ||
| sorry | ||
| begin | ||
| simp [is_open_map_iff_nhds_le, h₁, h₂], |
There was a problem hiding this comment.
An occasion where appropriate lemmas aren't used but rather the proof is adapted; the following proof, albeit longer, would be preferred in mathlib for performance reasons.
| simp [is_open_map_iff_nhds_le, h₁, h₂], | |
| rw [h₁, h₂], exact ⟨is_open_map_fst, is_open_map_snd⟩, |
| rw set.diff_eq, | ||
| use hU.inter hA.is_open_compl, | ||
| rw set.diff_eq, | ||
| exact hA.inter hU.is_closed_compl, |
There was a problem hiding this comment.
Again, lemma not used but proof got adapted:
| rw set.diff_eq, | |
| use hU.inter hA.is_open_compl, | |
| rw set.diff_eq, | |
| exact hA.inter hU.is_closed_compl, | |
| exact ⟨hU.sdiff hA, hA.sdiff hU⟩ |
| continuous (λ x, min (f x) (g x)) := | ||
| sorry | ||
| begin | ||
| simpa only [min_def] using hf.min hg, |
There was a problem hiding this comment.
The simp only part may have been copied from https://github.com/leanprover-community/mathlib/blob/bf9bbbcf0c1c1ead18280b0d010e417b10abb1b6/src/topology/order/basic.lean#L562
| simpa only [min_def] using hf.min hg, | |
| exact hf.min hg |
| rw is_open_iff_nhds, | ||
| simp [cluster_pt], | ||
| simp [filter.inf_principal_eq_bot], |
There was a problem hiding this comment.
It took me several minutes to come up with the proof
| rw is_open_iff_nhds, | |
| simp [cluster_pt], | |
| simp [filter.inf_principal_eq_bot], | |
| simp_rw [is_open_iff_eventually, cluster_pt_principal_iff_frequently, not_frequently, not_mem_compl_iff], |
so it's great that it can be automated. This proof can be condensed to
| rw is_open_iff_nhds, | |
| simp [cluster_pt], | |
| simp [filter.inf_principal_eq_bot], | |
| simp [is_open_iff_nhds, cluster_pt, filter.inf_principal_eq_bot], |
to avoid a non-terminal simp.
| rw [norm_add_sq_real, norm_sub_pow_two_real], | ||
| ring, |
There was a problem hiding this comment.
This proof could directly use parallelogram_law_with_norm rather than "re-proving" it, but that requires specifying an implicit argument with @. I wonder whether the model tried to use it initially but failed. It's nice that it figured out it could use lemmas that specialize to real inner product spaces.
| rw [norm_add_sq_real, norm_sub_pow_two_real], | |
| ring, | |
| simp_rw [sq, @parallelogram_law_with_norm ℝ, mul_add], |
| cases eq_or_ne x 1, | ||
| all_goals { simp [h] }, | ||
| apply order_of_eq_prime, | ||
| exacts [hx, h], |
There was a problem hiding this comment.
This proof is interesting as it takes a different approach than I would.
| cases eq_or_ne x 1, | |
| all_goals { simp [h] }, | |
| apply order_of_eq_prime, | |
| exacts [hx, h], | |
| exact (dvd_prime $ by norm_num).1 (order_of_dvd_of_pow_eq_one hx), |
Some Amazon guys did self-consistency for autoformalization: https://twitter.com/johnjnay/status/1679687620228530177 (Isabelle MiniF2F, not Lean though). |
Hi Zhangir,
We evaluated our machine learning prover on ProofNet and found some new proofs.