Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.

Fix valid.lean - #102

Merged
spolu merged 4 commits into
openai:mainfrom
marco-dossantos:patch-2
Jun 2, 2022
Merged

spolu merged 4 commits into
openai:mainfrom
marco-dossantos:patch-2

Conversation

@marco-dossantos

Copy link
Copy Markdown
Contributor

Changed ℕ+ into ℕ, finset.range into finset.Icc, used real.logb and fixed some mistakes

Changed ℕ+ into ℕ, finset.range into finset.Icc, used real.logb and fixed some mistakes
@spolu

spolu commented Jun 1, 2022

Copy link
Copy Markdown
Contributor

r? @DyeKuu

Comment thread lean/src/valid.lean Outdated
exact subtype.mk.inj h₀,
rw h₂ at h₁,
rw h₂,
have h₃ : 3 * b + b = 20, {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one show be removed

@DyeKuu DyeKuu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

statements involving explicit fintype can be written as what you've done for mathd_algebra_405: declare a finset s, then state the equivalent of the definition of s.

Comment thread lean/src/valid.lean Outdated
Comment on lines +832 to +838
(u v : ℕ)
(h₀ : 0 < u ∧ 0 < v)
(h₁ : 27 * u % 40 = 17)
(h₂ : 27 * v % 40 = 17)
(h₃ : u < 40)
(h₄ : v < 80)
(h₅ : 40 < v) :

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe you can reformulate this one like the one above mathd_numbertheory_13?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes you're right, I didn't see this one

Comment thread lean/src/valid.lean Outdated
Comment on lines +855 to +859
(h₀ : fintype {x : ℝ | 0 < x ∧ x^((2:ℝ)^real.sqrt 2) = (real.sqrt 2)^((2:ℝ)^x)}) :
↑2 ≤ ∑ k in {x : ℝ | 0 < x ∧ x^((2:ℝ)^real.sqrt 2) = (real.sqrt 2)^((2:ℝ)^x)}.to_finset, k ∧ ∑ k in {x : ℝ | 0 < x ∧ x^((2:ℝ)^real.sqrt 2) = (real.sqrt 2)^((2:ℝ)^x)}.to_finset, k < 6 :=
(h₀ : fintype {x : ℝ | 0 < x ∧ x^((2 : ℝ)^real.sqrt 2) = (real.sqrt 2)^((2 : ℝ)^x)}) :
↑2 ≤ ∑ k in {x : ℝ | 0 < x ∧ x^((2 : ℝ)^real.sqrt 2) = (real.sqrt 2)^((2 : ℝ)^x)}.to_finset, k ∧
∑ k in {x : ℝ | 0 < x ∧ x^((2 : ℝ)^real.sqrt 2) = (real.sqrt 2)^((2 : ℝ)^x)}.to_finset, k < 6 :=

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can rewrite this one the same way as mathd_algebra_405.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not clear if writing it the same way as mathd_algebra_405 is better, it seems to be the same thing for Lean but maybe it is simpler for us to read the statement when written as mathd_algebra_405

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh then it's fine for me.

Comment thread lean/src/valid.lean Outdated
Comment on lines +1460 to +1461
(h₀ : fintype {n : ℕ | 5 ∣ n ∧ nat.lcm (nat.factorial 5) n = 5 * nat.gcd (nat.factorial 10) n}) :
finset.card {n : ℕ | 5 ∣ n ∧ nat.lcm (nat.factorial 5) n = 5 * nat.gcd (nat.factorial 10) n}.to_finset = 1 :=

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can rewrite this one the same way as mathd_algebra_405. Also, maybe we could use ! for nat.factorial here?

Comment thread lean/src/valid.lean Outdated
Comment on lines +689 to +690
(h₀ : fintype {n : ℕ | n ∣ (nat.sqrt 196)}) :
∑ k in {n : ℕ | n ∣ (nat.sqrt 196)}.to_finset, k = 24 :=

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can rewrite this one the same way as mathd_algebra_405.

Comment thread lean/src/valid.lean Outdated
Comment on lines +325 to +326
(h₀ : fintype {n : ℕ | n ∣ 36}) :
∑ k in {n : ℕ | n ∣ 36}.to_finset, k = 91 :=

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can rewrite this one the same way as mathd_algebra_405.

Replaced nat.factorial n by n! and fixed two statements
@DyeKuu

DyeKuu commented Jun 2, 2022

Copy link
Copy Markdown
Contributor

LGTM!

Replaced fintype and .to_finset by finset.
I left 3 statements with fintype: amc12a_2002_p1, amc12_2000_p15 and mathd_algebra_149 because the set is already defined as a preimage
I replaced fintype by finset, nat.factorial n by n!, I used nat.digits 10 n instead of multiplications by 10 (that sometimes lead to wrong statements)
@spolu

spolu commented Jun 2, 2022

Copy link
Copy Markdown
Contributor

PTAL @DyeKuu ?

@spolu
spolu merged commit 4e433ff into openai:main Jun 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants