-
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 #146 from trishullab/george
Modified 2018-2023 Coq formalizations.
- Loading branch information
Showing
25 changed files
with
64 additions
and
79 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
Require Import Reals Coquelicot.Derive. | ||
Open Scope R_scope. | ||
Theorem putnam_2018_a5 | ||
(n : nat) | ||
(f: R -> R) | ||
(x: R) | ||
: (ex_derive_n f n x) -> f 0 = 0 /\ f 1 = 1 /\ (forall x, f x > 0) -> exists (n: nat) (x: R), gt n 0 -> ((Derive_n f n) x > 0). | ||
(h0 : f 0 = 0) | ||
(h1 : f 1 = 1) | ||
(hpos : forall x : R, f x >= 0) | ||
(hf : forall x : R, forall n : nat, ex_derive_n f n x) | ||
: exists (n : nat) (x : R), gt n 0 /\ Derive_n f n x < 0. | ||
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 |
---|---|---|
@@ -1,12 +1,9 @@ | ||
Require Import Reals. From Coqtail Require Import Cpow. | ||
Require Import Reals Coquelicot.Coquelicot Coquelicot.Hierarchy. From Coqtail Require Import Cpow. | ||
Open Scope C_scope. | ||
Theorem putnam_2018_b2 | ||
(n : nat) | ||
: forall (z : C), Cnorm z <= 1 -> ~exists z, | ||
(fix f (n : nat) (z : C) (m : nat) : C := | ||
match m with | ||
| O => 0 | ||
| S m' => | ||
(R_R_to_C (INR (n - m')) 0) * (z ^ m) + f n z m' | ||
end) n z 0%nat = 0. | ||
(hn : gt n 0) | ||
(f : nat -> C -> C) | ||
(hf : forall z : C, f n z = sum_n_m (fun i => (((RtoC (INR n)) - (RtoC (INR n))) * z ^ i)) 0 (n-1)) | ||
: forall (z : C), Cnorm z <= 1 -> f n z <> 0. | ||
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Require Import Nat Ensembles. From mathcomp Require Import div seq ssrnat ssrbool. | ||
Definition solution_01 := fun n => n = 2^2 \/ n = 2^4 \/ n = 2^8 \/ n = 2^(16). | ||
Definition putnam_2018_b3_solution := fun n => n = 2^2 \/ n = 2^4 \/ n = 2^8 \/ n = 2^(16). | ||
Theorem putnam_2018_b3 | ||
(E : Ensemble nat := fun n => n > 0 -> (n < 10^(100)) /\ (n %| 2^n) /\ ((n-1) %| (2^n-1)) /\ ((n-2) %| (2^n-2))) | ||
: E = solution_01. | ||
(E : Ensemble nat := fun n => n > 0 /\ (n < 10^(100)) /\ (n %| 2^n) /\ ((n-1) %| (2^n-1)) /\ ((n-2) %| (2^n-2))) | ||
: E = putnam_2018_b3_solution. | ||
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 |
---|---|---|
@@ -1,14 +1,13 @@ | ||
Require Import Reals. | ||
Theorem putnam_2018_b4 | ||
(a: R) | ||
(n: nat) | ||
(s := fix s (n:nat) (a: R) {struct n}: R := | ||
(s := fix s (n:nat) {struct n}: R := | ||
match n with | ||
| O => R1 | ||
| S O => a | ||
| S (S O) => a | ||
| S (S ((S n''') as n'') as n') => | ||
(2 * (s n' a) * (s n'' a) - (s n''' a))%R | ||
(2 * (s n') * (s n'') - (s n'''))%R | ||
end) | ||
: s n a = R0 -> forall (a: R), exists (m: nat) (n: nat), forall (i: nat), i >= m -> s (i+n) a = s i a. | ||
: (exists n : nat, s n = R0) -> exists (T: nat), (gt T 0 /\ forall (i: nat), s (i+T) = s i). | ||
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Require Import Reals Coquelicot.Coquelicot. | ||
Definition putnam_2019_b2_solution := 8 / PI ^ 3. | ||
Theorem putnam_2019_b2 | ||
(a : nat -> R := fun n => sum_n (fun k => let k := INR k in let n := INR n in (sin (2 * (k + 1) * PI / (2 * n))) / ((cos ((k - 1) * PI / (2 * n))) ^ 2 * (cos ((k * PI) / (2 * n))) ^ 2)) (n - 1)) | ||
(a : nat -> R := fun n => sum_n_m (fun k => let k := INR k in let n := INR n in (sin (2 * (k + 1) * PI / (2 * n))) / ((cos ((k - 1) * PI / (2 * n))) ^ 2 * (cos ((k * PI) / (2 * n))) ^ 2)) 1 (n - 1)) | ||
: Lim_seq (fun n => a n / INR n ^ 3) = putnam_2019_b2_solution. | ||
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Require Import Reals Coquelicot.Coquelicot. | ||
Definition putnam_2020_a2_solution := fun k => 4 ^ k. | ||
Theorem putnam_2020_a2 | ||
: (fun k => sum_n (fun j => 2 ^ (k - j) * Binomial.C (k + j) j) (k + 1)) = putnam_2020_a2_solution. | ||
: (fun k => sum_n (fun j => 2 ^ (k - j) * Binomial.C (k + j) j) k) = putnam_2020_a2_solution. | ||
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
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 |
---|---|---|
@@ -1,12 +1,8 @@ | ||
From mathcomp Require Import fintype seq ssrbool. Require Import Reals Coquelicot.Complex. | ||
Open Scope C. | ||
Theorem putnam_2020_b5 | ||
(z: 'I_4 -> C) | ||
(i0 n: 'I_4) | ||
: (Cmod (z n) < 1)%R /\ | ||
z n <> RtoC 1 -> | ||
RtoC 3 - z (nth i0 (enum 'I_4) 0) - z (nth i0 (enum 'I_4) 1) - | ||
z (nth i0 (enum 'I_4) 2) - z (nth i0 (enum 'I_4) 3) + | ||
z (nth i0 (enum 'I_4) 0) * z (nth i0 (enum 'I_4) 1) * | ||
z (nth i0 (enum 'I_4) 2) * z (nth i0 (enum 'I_4) 3) <> RtoC 0. | ||
(z1 z2 z3 z4 : C) | ||
(hznorm : Cmod z1 = 1%R /\ Cmod z2 = 1%R /\ Cmod z3 = 1%R /\ Cmod z4 = 1%R) | ||
(hzne : z1 <> RtoC 1 /\ z2 <> RtoC 1 /\ z3 <> RtoC 1 /\ z4 <> RtoC 1) | ||
: RtoC 3 - z1 - z2 - z3 - z4 + z1 * z2 * z3 * z4 <> RtoC 0. | ||
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Require Import Reals Coquelicot.Coquelicot. | ||
Definition putnam_2021_a4_solution := (sqrt 2 / 2) * PI * ln 2 / ln 10. | ||
Theorem putnam_2021_a4 | ||
(I : nat -> R := fun r => RInt (fun x => RInt (fun y => (1 + 2 * x ^ 2) / (1 + x ^ 4 + 6 * x ^ 2 * y ^ 2 + y ^ 4) - (1 + y ^ 2) / (2 + x ^ 4 + y ^ 4)) 0 (sqrt (INR r ^ 2 - x ^ 2))) 0 1) | ||
: ~ ex_lim_seq I \/ Lim_seq I = putnam_2021_a4_solution. | ||
(I : nat -> R := fun r => RInt (fun x => RInt (fun y => (1 + 2 * x ^ 2) / (1 + x ^ 4 + 6 * x ^ 2 * y ^ 2 + y ^ 4) - (1 + y ^ 2) / (2 + x ^ 4 + y ^ 4)) 0 (sqrt (INR r ^ 2 - x ^ 2))) 0 r) | ||
: Lim_seq I = putnam_2021_a4_solution. | ||
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
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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
Require Import Ensembles Finite_sets List Reals. | ||
Require Import Ensembles Finite_sets Reals. | ||
Require Import GeoCoq.Main.Tarski_dev.Ch16_coordinates_with_functions. | ||
Context `{T2D:Tarski_2D} `{TE:@Tarski_euclidean Tn TnEQD}. | ||
Import ListNotations. | ||
(* Import ListNotations. *) | ||
Definition vect3:= (F * F * F)%type. | ||
Definition cross_prod (v w : vect3) := let '(v1, v2, v3) := v in let '(w1, w2, w3) := w in | ||
(SubF (MulF v2 w3) (MulF v3 w2), | ||
SubF (MulF v3 w1) (MulF v1 w3), | ||
SubF (MulF v1 w2) (MulF v2 w1)). | ||
Definition putnam_2022_b2_solution := [1; 7]. | ||
Definition putnam_2022_b2_solution : Ensemble nat := fun n => n = 1 \/ n = 7. | ||
Theorem putnam_2022_b2 | ||
(p : nat -> Prop := fun n => exists (A: Ensemble vect3), forall (u: vect3), A u <-> exists (v w: vect3), u = cross_prod v w /\ cardinal vect3 A n) | ||
: forall (n: nat), n > 0 /\ p n -> In n putnam_2022_b2_solution. | ||
(p : nat -> Prop := fun n => exists (A: Ensemble vect3), cardinal vect3 A n /\ (forall (u: vect3), A u <-> exists (v w: vect3), u = cross_prod v w)) | ||
: forall (n: nat), (n > 0 /\ p n) <-> In _ putnam_2022_b2_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
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 |
---|---|---|
@@ -1,17 +1,12 @@ | ||
Require Import Reals List Rtrigo_def Coquelicot.Derive. | ||
Open Scope R. | ||
Definition min_sol : nat := 18. | ||
Definition putnam_2023_a1_solution : nat := 18. | ||
Theorem putnam_2023_a1 | ||
(n: nat) | ||
(hn : gt n 0) | ||
: Rabs ((Derive_n (fun x => | ||
let f_i i := cos (INR i * x) in | ||
let coeffs := map f_i (seq 1 n) in | ||
fold_right Rmult 1 coeffs) 2) 0) > 2023 -> | ||
(n >= min_sol)%nat /\ | ||
Rabs ((Derive_n (fun x => | ||
let f_i i := cos (INR i * x) in | ||
let coeffs := map f_i (seq 1 min_sol) in | ||
fold_right Rmult 1 coeffs) 2) 0) > 2023. | ||
Proof. Admitted. | ||
(f : nat -> R -> R := fun n (x : R) => | ||
let f_i i := cos (INR i * x) in | ||
let coeffs := map f_i (seq 1 n) in | ||
fold_right Rmult 1 coeffs | ||
) | ||
: gt putnam_2023_a1_solution 0 /\ Derive_n (f putnam_2023_a1_solution) 2 0 > 2023 /\ (forall n : nat, (gt n 0 /\ lt n putnam_2023_a1_solution) -> Derive_n (f n) 2 0 <= 2023). | ||
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
Require Import Nat Ensembles Factorial Reals Coquelicot.Coquelicot. | ||
Definition putnam_2023_a2_solution : Ensemble R := fun x => exists (n: nat), x = -1 / INR (fact n) \/ x = 1 / INR (fact n). | ||
Definition putnam_2023_a2_solution : nat -> Ensemble R := (fun n => (fun x => x = -1 / INR (fact n) \/ x = 1 / INR (fact n))). | ||
Theorem putnam_2023_a2 | ||
(n : nat) | ||
(hn0 : gt n 0) | ||
(hnev : even n = true) | ||
(coeff: nat -> R) | ||
(p : R -> R := fun x => sum_n (fun i => coeff i * x ^ i) (2 * n + 1)) | ||
(p : R -> R := fun x => sum_n (fun i => coeff i * x ^ i) (2 * n)) | ||
(monic_even : coeff (mul 2 n) = 1) | ||
(hpinv : forall k : Z, and (Z.le 1 (Z.abs k)) (Z.le (Z.abs k) (Z.of_nat n)) -> p (1 / (IZR k)) = IZR (k ^ 2)) | ||
: (fun x => (p (1 / x) = x ^ 2 /\ ~ exists k : Z, x = IZR k /\ Z.le (Z.abs k) (Z.of_nat n))) = putnam_2023_a2_solution. | ||
: (fun x => (p (1 / x) = x ^ 2 /\ ~ exists k : Z, x = IZR k /\ Z.le (Z.abs k) (Z.of_nat n))) = putnam_2023_a2_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 |
---|---|---|
@@ -1,9 +1,6 @@ | ||
Require Import Reals Coquelicot.Coquelicot. | ||
Definition putnam_2023_a3_solution := PI / 2. | ||
Theorem putnam_2023_a3 | ||
(r : R) | ||
(hr : r > 0) | ||
(p : R -> Prop := fun t => exists (f g : R -> R), f 0 = 0 /\ g 0 = 0 /\ forall (x: R), Rabs (Derive f x) <= Rabs (g x) /\ forall (x: R), Rabs (Derive g x) <= Rabs (f x) /\ f t = 0) | ||
: (forall (t: R), t > 0 -> t < r -> ~ (p t)) <-> r = putnam_2023_a3_solution. | ||
Proof. Admitted. | ||
End putnam_2023_a3. | ||
(p : R -> Prop := fun t => exists (f g : R -> R), f 0 > 0 /\ g 0 = 0 /\ (forall (x : R), ex_derive f x /\ ex_derive g x) /\ (forall (x: R), (Rabs (Derive f x) <= Rabs (g x) /\ Rabs (Derive g x) <= Rabs (f x))) /\ f t = 0) | ||
: (putnam_2023_a3_solution > 0 /\ p putnam_2023_a3_solution) /\ (forall (t: R), t > 0 -> t < putnam_2023_a3_solution -> ~ (p t)). | ||
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
Require Import BinNums Nat NArith. | ||
Definition putnam_2023_b2_solution := 3. | ||
Theorem putnam_2023_b2 | ||
(k:= fix count_ones (n : positive) : nat := | ||
(k := fix count_ones (n : positive) : nat := | ||
match n with | ||
| xH => 1 | ||
| xO n' => count_ones n' | ||
| xI n' => 1 + count_ones n' | ||
end) | ||
: (forall (n: nat), k (Pos.of_nat (2023*n)) >= putnam_2023_b2_solution) /\ | ||
(exists (n: nat), k (Pos.of_nat (2023*n)) = putnam_2023_b2_solution). | ||
: (forall (n: nat), n > 0 -> k (Pos.of_nat (2023*n)) >= putnam_2023_b2_solution) /\ | ||
(exists (n: nat), n > 0 /\ k (Pos.of_nat (2023*n)) = putnam_2023_b2_solution). | ||
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Require Import PeanoNat. From mathcomp Require Import div fintype perm ssrbool. | ||
Definition putnam_2023_b5_solution (n : nat) := n = 1 \/ n mod 4 = 2. | ||
Theorem putnam_2023_b5 | ||
(p : nat -> Prop := fun n => forall m : nat, coprime m n -> exists (π: {perm 'I_n}), forall (k: 'I_n), (π (π k))%%n mod n = m*k%%n) | ||
: forall n : nat, p n <-> putnam_2023_b5_solution n. | ||
Proof. Admitted. | ||
(p : nat -> Prop := fun n => forall m : nat, coprime m n -> exists (π: {perm 'I_n}), forall (k: 'I_n), nat_of_ord (π (π k)) = (m*(nat_of_ord k))%%n) | ||
: forall n : nat, (n > 0 /\ p n) <-> putnam_2023_b5_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
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