-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #143 from trishullab/george
Split Coq files into individual problems.
- Loading branch information
Showing
368 changed files
with
3,389 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
|
||
(* TODO: WIP *) | ||
(* NOTE -- Divide-and-conquer recursion is hard to formulate in Coq. A proof must be provided for termination *) | ||
(* Section putnam_2013_b1. | ||
Require Import ZArith Nat List Lia Ensembles Finite_sets Reals Program Coquelicot.Hierarchy. | ||
Open Scope Z. | ||
Program Fixpoint Aa (n : nat) {measure n} : Z := | ||
match n with | ||
| O => 0 | ||
| S O => 1 | ||
| S (S m) => if even m then Aa (div2 (m+2)) else if even (div2 (m+2)) then Aa (div2 (m+2)) else (-1) * Aa (div2 (m+2)) | ||
end. | ||
Next Obligation. Proof. destruct m. simpl; auto. induction m. simpl; auto. simpl. Admitted. | ||
Theorem putnam_2013_b1: | ||
sum_n (fun n => (Aa n)*(Aa (n+2))) 2013 = 1. | ||
Proof. Admitted. | ||
End putnam_2013_b1. *) | ||
|
||
(* Skipped due to lack of surface integral function *) | ||
(* Section putnam_2019_a4. | ||
Require Import PeanoNat. Require Import Reals Coquelicot.Derive. | ||
Definition putnam_2019_a4_solution := false. | ||
Theorem putnam_2019_a4: | ||
forall (f: R -> R), | ||
continuity f -> | ||
forall (x y z: R), x*x + y*y + z*z = 1 -> | ||
True. | ||
Proof. Admitted. | ||
End putnam_2019_a4. *) | ||
|
||
(* TODO: missing determinant refinement in coqeal *) | ||
(* Section putnam_2023_b6. | ||
Require Import Nat Finite_sets. | ||
From mathcomp Require Import matrix ssrbool ssralg fintype. | ||
Variable putnam_2023_b6_solution : nat -> nat. | ||
Open Scope ring_scope. | ||
Theorem putnam_2023_b6: | ||
forall (n: nat), | ||
let s (i j: nat) := cardinal (nat*nat) (fun p => let (a, b) := p in 1 <= i <= n /\ 1 <= j <= n /\ eq (add (mul a i) (mul b j)) n) in | ||
(\matrix_(i < n, j < n) s i j) | ||
= (\matrix_(i < n, j < n) s i j). | ||
Proof. Admitted. | ||
End putnam_2023_b6. *) | ||
|
||
(* TODO: How to get the cardinality of a set with cardinal? Could not figure out a clean way*) | ||
(* Section putnam_1973_a6. | ||
Require Import Reals Finite_sets Ensembles Coquelicot.Coquelicot. From mathcomp Require Import fintype. | ||
Theorem putnam_1973_a6 | ||
(h_nint : nat -> ('I_7 -> (R * R)) -> nat := fun n lines => | ||
let intersection_set (p : R * R) : Prop := exists! S : Ensemble 'I_7, cardinal _ S n /\ (forall i : 'I_7, In _ S i -> (snd p = (snd (lines i)) * (fst p) + (fst (lines i)))) in | ||
cardinal _ intersection_set | ||
) | ||
: ~ (exists lines: 'I_7 -> (R * R), (forall i j : 'I_7, i <> j -> (lines i <> lines j)) /\ h_nint 3 lines >= 6 /\ h_nint 2 lines >= 4). | ||
Proof. Admitted. | ||
End putnam_1973_a6. *) | ||
|
||
(* Section putnam_1999_a5. | ||
Require Import Reals NewtonInt. From mathcomp Require Import all_algebra all_ssreflect ssrnat ssrnum ssralg fintype poly seq. | ||
Open Scope ring_scope. | ||
Theorem putnam_1999_a5: | ||
forall (R: numDomainType) (p: {poly R}), | ||
(size p = 1999%nat) -> | ||
exists (C: R), Num.norm p.[0] <= GRing.mul C (Num.norm p.[0]). | ||
Proof. Admitted. | ||
End putnam_1999_a5. *) | ||
|
||
(* Section putnam_2010_a5. | ||
Require Import Reals. From mathcomp Require Import fingroup ssreflect ssrbool eqtype seq choice fintype div path tuple bigop prime finset. | ||
Open Scope R. | ||
Variable R3: finGroupType. | ||
Definition cross_product (a b : R -> R -> R) : R -> R -> R := a. | ||
Theorem putnam_2010_a5: | ||
forall (G: {group R3}), | ||
forall (a b: R -> R -> R), | ||
cross_product a b = a \/ cross_product a b = a -> | ||
forall (a b: R -> R -> R), | ||
cross_product a b = a. | ||
Proof. Admitted. | ||
End putnam_2010_a5. *) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Require Import Coquelicot.Hierarchy Reals. | ||
Theorem putnam_1965_a2 | ||
: forall n : nat, gt n 0 -> sum_n (fun r : nat => ((INR n - 2 * INR r) * (C n r) / INR n) ^ 2) ((n - 1) / 2) = (C (2 * n - 2) (n - 1)) / INR n. | ||
Proof. Admitted. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
(* Note: The MAA archive contains an error on this problem; the second term in the sum of the second limit should read "a2", not "a4". *) | ||
Require Import Reals Coquelicot.Complex Coquelicot.Hierarchy. | ||
Theorem putnam_1965_a3 | ||
(a : nat -> R) | ||
(alpha : C) | ||
(euler : R -> C := (fun x : R => Cplus (cos x) (Cmult Ci (sin x)))) | ||
: (filterlim (fun n : nat => Cdiv (sum_n (fun k : nat => euler (a k)) (n - 1)) (INR n)) eventually (locally alpha)) <-> (filterlim (fun n : nat => Cdiv (sum_n (fun k : nat => euler (a k)) (n ^ 2 - 1)) (INR (n ^ 2))) eventually (locally alpha)). | ||
Proof. Admitted. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Require Import Bool ssreflect ssrfun. From mathcomp Require Import fintype. | ||
Variables G B : finType. | ||
Theorem putnam_1965_a4 | ||
(dances : G -> B -> Prop) | ||
(h : ~(exists b : B, forall g : G, dances g b) /\ (forall g : G, exists b : B, dances g b)) | ||
(nonempty : inhabited G /\ inhabited B) | ||
: exists (g h : G) (b c : B), dances g b /\ dances h c /\ ~dances h b /\ ~dances g c. | ||
Proof. Admitted. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Require Import Nat Finite_sets. From mathcomp Require Import fintype perm. | ||
Definition putnam_1965_a5_solution : nat -> nat := (fun n : nat => 2 ^ (n - 1)). | ||
Theorem putnam_1965_a5 | ||
: forall n : nat, n > 0 -> cardinal {perm 'I_n} (fun p : {perm 'I_n} => forall m : 'I_n, m > 0 -> exists k : 'I_n, k < m /\ (nat_of_ord (p m) = (p k) + 1 \/ nat_of_ord (p m) = (p k) - 1)) (putnam_1965_a5_solution n). | ||
Proof. Admitted. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Require Import Reals Coquelicot.Coquelicot. | ||
Theorem putnam_1965_a6 | ||
(u v m : R) | ||
(pinter : (R * R) -> Prop := (fun p : R * R => u * (fst p) + v * (snd p) = 1 /\ (Rpower (fst p) m) + (Rpower (snd p) m) = 1)) | ||
(hm : m > 1) | ||
(huv : u >= 0 /\ v >= 0) | ||
: ((exists! p : R * R, pinter p) /\ (exists p : R * R, fst p >= 0 /\ snd p >= 0 /\ pinter p)) <-> (exists n : R, (Rpower u n) + (Rpower v n) = 1 /\ powerRZ m (-1) + powerRZ n (-1) = 1). | ||
Proof. Admitted. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Require Import Coquelicot.Hierarchy Reals. From mathcomp Require Import fintype. | ||
Theorem putnam_1965_b2 | ||
(n : nat) | ||
(won : 'I_n -> 'I_n -> bool) | ||
(ordofnat : nat -> 'I_n) | ||
(w : 'I_n -> R := (fun r : 'I_n => sum_n (fun j : nat => if (won r (ordofnat j)) then 1 else 0) (n - 1))) | ||
(l : 'I_n -> R := (fun r : 'I_n => INR n - 1 - w r)) | ||
(hn : gt n 1) | ||
(hirrefl : forall i : 'I_n, won i i = false) | ||
(hantisymm : forall i j : 'I_n, i <> j -> won i j = negb (won j i)) | ||
(hordofnat : forall i : 'I_n, ordofnat (nat_of_ord i) = i) | ||
: sum_n (fun r : nat => (w (ordofnat r)) ^ 2) (n - 1) = sum_n (fun r : nat => (l (ordofnat r)) ^ 2) (n - 1). | ||
Proof. Admitted. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Require Import Finite_sets Reals Coquelicot.Coquelicot. | ||
Theorem putnam_1965_b3 | ||
: cardinal (R * R * R) (fun abc : R * R * R => let '(a, b, c) := abc in (IZR (floor a) = a /\ IZR (floor b) = b /\ IZR (floor c) = c /\ a > 0 /\ a <= b /\ c > 0 /\ a ^ 2 + b ^ 2 = c ^ 2 /\ a * b / 2 = 2 * (a + b + c))) 3. | ||
Proof. Admitted. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Require Import Reals Coquelicot.Hierarchy Ensembles. | ||
Definition putnam_1965_b4_solution : (((R -> R) -> R -> R) * ((R -> R) -> R -> R)) * ((Ensemble R) * (R -> R)) := (((fun (h : R -> R) (x : R) => h x + x), (fun (h : R -> R) (x : R) => h x + 1)), ((fun x : R => x >= 0), sqrt)). | ||
Theorem putnam_1965_b4 | ||
(f : nat -> R -> R) | ||
(hf : forall n : nat, gt n 0 -> f n = (fun x : R => (sum_n (fun i : nat => (C n (2 * i)) * x ^ i) (n / 2)) / (sum_n (fun i : nat => (C n (2 * i + 1)) * x ^ i) ((n - 1) / 2)))) | ||
: let '((p, q), (s, g)) := putnam_1965_b4_solution in (forall n : nat, gt n 0 -> f (Nat.add n 1) = (fun x : R => p (f n) x / q (f n) x) /\ s = (fun x : R => exists L : R, filterlim (fun n : nat => f n x) eventually (locally L)) /\ (forall x : R, s x -> filterlim (fun n : nat => f n x) eventually (locally (g x)))). | ||
Proof. Admitted. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Require Import Ensembles Finite_sets. From mathcomp Require Import fintype. | ||
Theorem putnam_1965_b5 | ||
(E V : nat) | ||
(simple : (Ensemble ('I_V * 'I_V)) -> Prop := (fun G : Ensemble ('I_V * 'I_V) => (forall v : 'I_V, ~G (v, v)) /\ (forall v w : 'I_V, G (v, w) -> G (w, v)))) | ||
(hE : 4 * E <= Nat.pow V 2) | ||
: exists G : Ensemble ('I_V * 'I_V), simple G /\ cardinal ('I_V * 'I_V) G (2 * E) /\ ~(exists a b c : 'I_V, G (a, b) /\ G (a, c) /\ G (b, c)). | ||
Proof. Admitted. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Require Import GeoCoq.Main.Tarski_dev.Ch16_coordinates_with_functions Ensembles. | ||
Context `{Tarski_2D}. | ||
Theorem putnam_1965_b6 | ||
(A B C D : Tpoint) | ||
(hABCD : forall R SS P Q : Tpoint, (R <> P /\ SS <> Q /\ OnCircle A P R /\ OnCircle B P R /\ OnCircle C Q SS /\ OnCircle D Q SS) -> (exists I : Tpoint, OnCircle I P R /\ OnCircle I Q SS)) | ||
: (Col A B C /\ Col A B D) \/ (exists R P : Tpoint, R <> P /\ OnCircle A P R /\ OnCircle B P R /\ OnCircle C P R /\ OnCircle D P R). | ||
Proof. Admitted. | ||
End putnam_1965_b6. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Require Import Reals Nat ZArith Coquelicot.Coquelicot. | ||
Theorem putnam_1966_a1 | ||
(f : nat -> R := fun n => (sum_n (fun m => (if (even m) then INR m else INR (m-1)) : R) n) / 2) | ||
: forall x y : nat, ge x y -> INR x * INR y = f (add x y) - f (sub x y). | ||
Proof. Admitted. |
Oops, something went wrong.