Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IMO 2012 P4 #14

Merged
merged 42 commits into from
May 7, 2024
Merged

IMO 2012 P4 #14

merged 42 commits into from
May 7, 2024

Conversation

Seasawher
Copy link
Contributor

No description provided.

@Seasawher Seasawher marked this pull request as ready for review May 7, 2024 12:31
@Seasawher
Copy link
Contributor Author

@dwrensha Please review this PR.

@dwrensha
Copy link
Owner

dwrensha commented May 7, 2024

Thanks! If you want to claim credit for this work, please add your name(s) to the Authors: field in the copyright header at the top of the file. (You may delete my name, as I did not contribute to this solution.)

@@ -20,11 +20,308 @@ the following equality holds:

namespace Imo2012P4

determine solution_set : Set (ℤ → ℤ) := sorry
def odd_const : Set (ℤ → ℤ) := fun f =>
Copy link
Owner

Choose a reason for hiding this comment

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

odd_const, mod4_cycle, square_set, sub_sq', Int.lt_of_ns_lt_ns and myInduction should be inside of snip begin ... snip end.

/-- Starts a group of commands that will be discarded by problem extraction. -/
syntax (name := snipBegin) "snip begin" : command
/-- Ends a group of commands that will be discarded by problem extraction. -/
syntax (name := snipEnd) "snip end" : command

For example:

snip begin
abbrev propEqs (x : Fin 3 → ℝ) (a : Fin 3 → Fin 3 → ℝ) : Prop :=
∀ i, ∑ j : Fin 3, (a i j * x j) = 0
lemma lemma0 (x : Fin 3 → ℝ) (a : Fin 3 → Fin 3 → ℝ) (p : Fin 3 → Fin 3)
(hp : p.Bijective)
(he : propEqs x a) : propEqs (x ∘ p) (fun i j ↦ a (p i) (p j)) := by
intro i
dsimp
have hi := he (p i)
rwa [Function.Bijective.sum_comp hp (fun j ↦ a (p i) j * x j)]
abbrev propsAB (a : Fin 3 → Fin 3 → ℝ) : Prop :=
∀ i j, if i = j then 0 < a i j else a i j < 0
lemma lemma1 (a : Fin 3 → Fin 3 → ℝ) (p : Fin 3 → Fin 3)
(hp : p.Bijective)
(hab : propsAB a) :
propsAB (fun i j ↦ a (p i) (p j)) := by
intro i j
have h0 := hab (p i) (p j)
split_ifs with h1
· subst h1
simp only [reduceIte] at h0
exact h0
· have h2 : p i ≠ p j := fun a ↦ h1 (hp.1 a)
simp only [h2] at h0
exact h0
lemma lemma2 (a : Fin 3 → Fin 3 → ℝ)
(p : Fin 3 → Fin 3)
(hp : p.Bijective)
(hc : ∀ i, 0 < ∑ j : Fin 3, a i j) :
∀ i, 0 < ∑ j : Fin 3, a (p i) (p j) := by
intro i
rw [Function.Bijective.sum_comp hp]
exact hc (p i)
snip end

Copy link
Owner

Choose a reason for hiding this comment

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

This will make it so that the problem web page (https://dwrensha.github.io/compfiles/problems/Compfiles.Imo2012P4.html) does not show any information about the solution.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

@dwrensha dwrensha merged commit 932188e into dwrensha:main May 7, 2024
1 check passed
@dwrensha
Copy link
Owner

dwrensha commented May 7, 2024

Thanks! I moved the determine outside of the snip here: c81da56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants