-
Notifications
You must be signed in to change notification settings - Fork 23
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
IMO 2012 P4 #14
Conversation
refactoring
my solution (WIP)
It turned to be a bad idea. List indexing requires proof. So `mod4 x` can't rewrite.
complete Imo2012P4
@dwrensha Please review this PR. |
Thanks! If you want to claim credit for this work, please add your name(s) to the |
@@ -20,11 +20,308 @@ the following equality holds: | |||
|
|||
namespace Imo2012P4 | |||
|
|||
determine solution_set : Set (ℤ → ℤ) := sorry | |||
def odd_const : Set (ℤ → ℤ) := fun f => |
There was a problem hiding this comment.
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
.
compfiles/ProblemExtraction.lean
Lines 187 to 191 in 7b57a0d
/-- 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:
compfiles/Compfiles/Imo1965P2.lean
Lines 33 to 72 in 7b57a0d
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
Thanks! I moved the |
No description provided.