Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions isabelle/putnam_2023_a6.thy
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ theorem putnam_2023_a6:
and parityOf :: "nat list \<Rightarrow> nat"
and ConformsToStrategy :: "nat list \<Rightarrow> (nat list \<Rightarrow> nat) \<Rightarrow> bool"
and IsWinningFor :: "nat \<Rightarrow> (nat list \<Rightarrow> nat) \<Rightarrow> bool"
assumes IsValidGame_def : "\<forall> g. (IsValidGame G \<longleftrightarrow>
assumes IsValidGame_def : "\<forall> g. (IsValidGame g \<longleftrightarrow>
distinct g \<and> (\<forall> i \<in> set g. i \<in> {1..length g}))"
and parityOf_def : "\<forall> g. parityOf g = card {n :: nat. n ∈ {0..<length g} \<and> nth g n = n+1} mod 2"
and ConformsToStrategy_def : "\<forall> g s. (ConformsToStrategy g s \<longleftrightarrow>
Expand All @@ -20,4 +20,4 @@ theorem putnam_2023_a6:
shows "{n :: nat. 0 < n \<and> (\<exists> s. IsWinningFor n s)} = putnam_2023_a6_solution"
sorry

end
end
9 changes: 5 additions & 4 deletions lean4/src/putnam_2023_a6.lean
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ theorem putnam_2023_a6
(ConformsToStrategy : List ℕ → (List ℕ → ℕ) → Prop)
(ConformsToStrategy_def : ∀ g s, ConformsToStrategy g s ↔
∀ (i) (h : i < g.length), Odd i → g[i] = s (g.take i))
(IsValidStrategy : (List ℕ → ℕ) → Prop)
(IsValidStrategy_def : ∀ s, IsValidStrategy s ↔
∀ (g : List ℕ), g.length > 0 → s g ∈ g)
(IsValidStrategy : ℕ → (List ℕ → ℕ) → Prop)
(IsValidStrategy_def : ∀ n s, IsValidStrategy n s ↔
∀ g : List ℕ, g.Nodup → (∀ i ∈ g, i ∈ Icc 1 n) → g.length < n →
s g ∈ Icc 1 n ∧ s g ∉ g)
(IsWinningFor : ℕ → (List ℕ → ℕ) → Prop)
(IsWinningFor_def : ∀ n s, IsWinningFor n s ↔
IsValidStrategy s ∧ ∃ p, ∀ g, g.length = n → IsValidGame g → ConformsToStrategy g s → parityOf g = p) :
IsValidStrategy n s ∧ ∃ p, ∀ g, g.length = n → IsValidGame g → ConformsToStrategy g s → parityOf g = p) :
{n : ℕ | 0 < n ∧ ∃ s, IsWinningFor n s} = putnam_2023_a6_solution :=
sorry