-
Notifications
You must be signed in to change notification settings - Fork 41
/
valid.lean
2380 lines (2132 loc) · 46.1 KB
/
valid.lean
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/-
Copyright (c) 2021 OpenAI. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kunhao Zheng, Stanislas Polu, David Renshaw, OpenAI GPT-f
-/
import minif2f_import
open_locale big_operators
open_locale real
open_locale nat
open_locale topological_space
theorem amc12a_2019_p21
(z : ℂ)
(h₀ : z = (1 + complex.I) / real.sqrt 2) :
(∑ k in finset.Icc 1 12, (z^(k^2))) * (∑ k in finset.Icc 1 12, (1 / z^(k^2))) = 36 :=
begin
sorry
end
theorem amc12a_2015_p10
(x y : ℤ)
(h₀ : 0 < y)
(h₁ : y < x)
(h₂ : x + y + (x * y) = 80) :
x = 26 :=
begin
sorry
end
theorem amc12a_2008_p8
(x y : ℝ)
(h₀ : 0 < x ∧ 0 < y)
(h₁ : y^3 = 1)
(h₂ : 6 * x^2 = 2 * (6 * y^2)) :
x^3 = 2 * real.sqrt 2 :=
begin
sorry
end
theorem mathd_algebra_182
(y : ℂ) :
7 * (3 * y + 2) = 21 * y + 14 :=
begin
ring_nf,
end
theorem aime_1984_p5
(a b : ℝ)
(h₀ : real.logb 8 a + real.logb 4 (b^2) = 5)
(h₁ : real.logb 8 b + real.logb 4 (a^2) = 7) :
a * b = 512 :=
begin
sorry
end
theorem mathd_numbertheory_780
(m x : ℕ)
(h₀ : 10 ≤ m)
(h₁ : m ≤ 99)
(h₂ : (6 * x) % m = 1)
(h₃ : (x - 6^2) % m = 0) :
m = 43 :=
begin
sorry
end
theorem mathd_algebra_116
(k x: ℝ)
(h₀ : x = (13 - real.sqrt 131) / 4)
(h₁ : 2 * x^2 - 13 * x + k = 0) :
k = 19/4 :=
begin
rw h₀ at h₁,
rw eq_comm.mp (add_eq_zero_iff_neg_eq.mp h₁),
norm_num,
rw pow_two,
rw mul_sub,
rw [sub_mul, sub_mul],
rw real.mul_self_sqrt _,
ring,
linarith,
end
theorem mathd_numbertheory_13
(u v : ℕ)
(S : set ℕ)
(h₀ : ∀ (n : ℕ), n ∈ S ↔ 0 < n ∧ (14 * n) % 100 = 46)
(h₁ : is_least S u)
(h₂ : is_least (S \ {u}) v) :
((u + v) : ℚ) / 2 = 64 :=
begin
sorry
end
theorem mathd_numbertheory_169 :
nat.gcd 20! 200000 = 40000 :=
begin
sorry
end
theorem amc12a_2009_p9
(a b c : ℝ)
(f : ℝ → ℝ)
(h₀ : ∀ x, f (x + 3) = 3 * x^2 + 7 * x + 4)
(h₁ : ∀ x, f x = a * x^2 + b * x + c) :
a + b + c = 2 :=
begin
sorry
end
theorem amc12a_2019_p9
(a : ℕ → ℚ)
(h₀ : a 1 = 1)
(h₁ : a 2 = 3 / 7)
(h₂ : ∀ n, a (n + 2) = (a n * a (n + 1)) / (2 * a n - a (n + 1))) :
↑(a 2019).denom + (a 2019).num = 8078 :=
begin
sorry
end
theorem mathd_algebra_13
(a b : ℝ)
(h₀ : ∀ x, (x - 3 ≠ 0 ∧ x - 5 ≠ 0) → 4 * x / (x^2 - 8 * x + 15) = a / (x - 3) + b / (x - 5)) :
a = -6 ∧ b = 10 :=
begin
sorry
end
theorem induction_sum2kp1npqsqm1
(n : ℕ) :
↑∑ k in (finset.range n), 2 * k + 3 = ↑(n + 1)^2 - (1:ℤ) :=
begin
sorry
end
theorem aime_1991_p6
(r : ℝ)
(h₀ : ∑ k in finset.Icc (19 : ℕ) 91, (int.floor (r + k / 100)) = 546) :
int.floor (100 * r) = 743 :=
begin
sorry
end
theorem mathd_numbertheory_149 :
∑ k in (finset.filter (λ x, x % 8 = 5 ∧ x % 6 = 3) (finset.range 50)), k = 66 :=
begin
sorry
end
theorem imo_1984_p2
(a b : ℕ)
(h₀ : 0 < a ∧ 0 < b)
(h₁ : ¬ 7 ∣ a)
(h₂ : ¬ 7 ∣ b)
(h₃ : ¬ 7 ∣ (a + b))
(h₄ : (7^7) ∣ ((a + b)^7 - a^7 - b^7)) :
19 ≤ a + b :=
begin
sorry
end
theorem amc12a_2008_p4 :
∏ k in finset.Icc (1 : ℕ) 501, ((4 : ℝ) * k + 4) / (4 * k) = 502 :=
begin
sorry
end
theorem imo_2006_p6
(a b c : ℝ) :
(a * b * (a^2 - b^2)) + (b * c * (b^2 - c^2)) + (c * a * (c^2 - a^2)) ≤ (9 * real.sqrt 2) / 32 * (a^2 + b^2 + c^2)^2 :=
begin
sorry
end
theorem mathd_algebra_462 :
((1 : ℚ)/ 2 + 1 / 3) * (1 / 2 - 1 / 3) = 5 / 36 :=
begin
norm_num,
end
theorem imo_1964_p1_2
(n : ℕ) :
¬ 7 ∣ (2^n + 1) :=
begin
sorry
end
theorem mathd_numbertheory_221
(S : finset ℕ)
(h₀ : ∀ (x : ℕ), x ∈ S ↔ 0 < x ∧ x < 1000 ∧ x.divisors.card = 3) :
S.card = 11 :=
begin
sorry
end
theorem mathd_numbertheory_64 :
is_least {x : ℕ | 30 * x ≡ 42 [MOD 47]} 39 :=
begin
sorry
end
theorem imo_1987_p4
(f : ℕ → ℕ) :
∃ n, f (f n) ≠ n + 1987 :=
begin
sorry
end
theorem mathd_numbertheory_33
(n : ℕ)
(h₀ : n < 398)
(h₁ : (n * 7) % 398 = 1) :
n = 57 :=
begin
sorry
end
theorem amc12_2001_p9
(f : ℝ → ℝ)
(h₀ : ∀ x > 0, ∀ y > 0, f (x * y) = f x / y)
(h₁ : f 500 = 3) : f 600 = 5 / 2 :=
begin
specialize h₀ 500 _ (6/5) _,
{ linarith },
{ linarith },
calc f 600 = f (500 * (6/5)) : by {congr, norm_num}
... = f 500 / (6 / 5) : by {rw h₀}
... = 3 / (6 / 5) : by { rw h₁ }
... = 5 / 2 : by {norm_num},
end
theorem imo_1965_p1
(x : ℝ)
(h₀ : 0 ≤ x)
(h₁ : x ≤ 2 * π)
(h₂ : 2 * real.cos x ≤ abs (real.sqrt (1 + real.sin (2 * x)) - real.sqrt (1 - real.sin (2 * x))))
(h₃ : abs (real.sqrt (1 + real.sin (2 * x)) - real.sqrt (1 - real.sin (2 * x))) ≤ real.sqrt 2) :
π / 4 ≤ x ∧ x ≤ 7 * π / 4 :=
begin
sorry
end
theorem mathd_numbertheory_48
(b : ℕ)
(h₀ : 0 < b)
(h₁ : 3 * b^2 + 2 * b + 1 = 57) :
b = 4 :=
begin
nlinarith,
end
theorem numbertheory_sqmod4in01d
(a : ℤ) :
(a^2 % 4) = 0 ∨ (a^2 % 4) = 1 :=
begin
sorry
end
theorem mathd_numbertheory_466 :
(∑ k in (finset.range 11), k) % 9 = 1 :=
begin
sorry
end
theorem mathd_algebra_48
(q e : ℂ)
(h₀ : q = 9 - 4 * complex.I)
(h₁ : e = -3 - 4 * complex.I) : q - e = 12 :=
begin
rw [h₀, h₁],
ring,
end
theorem amc12_2000_p15
(f : ℂ → ℂ)
(h₀ : ∀ x, f (x / 3) = x^2 + x + 1)
(h₁ : fintype (f ⁻¹' {7})) :
∑ y in (f⁻¹' {7}).to_finset, y / 3 = - 1 / 9 :=
begin
sorry
end
theorem mathd_numbertheory_132 :
2004 % 12 = 0 :=
begin
norm_num,
end
theorem amc12a_2009_p5
(x : ℝ)
(h₀ : x^3 - (x + 1) * (x - 1) * x = 5) :
x^3 = 125 :=
begin
sorry
end
theorem mathd_numbertheory_188 :
nat.gcd 180 168 = 12 :=
begin
norm_num,
end
theorem mathd_algebra_224
(S : finset ℕ)
(h₀ : ∀ (n : ℕ), n ∈ S ↔ real.sqrt n < 7 / 2 ∧ 2 < real.sqrt n) :
S.card = 8 :=
begin
sorry
end
theorem induction_divisibility_3divnto3m2n
(n : ℕ) :
3 ∣ n^3 + 2 * n :=
begin
sorry
end
theorem induction_sum_1oktkp1
(n : ℕ) :
∑ k in (finset.range n), (1 : ℝ) / ((k + 1) * (k + 2)) = n / (n + 1) :=
begin
sorry
end
theorem mathd_numbertheory_32
(S : finset ℕ)
(h₀ : ∀ (n : ℕ), n ∈ S ↔ n ∣ 36) :
∑ k in S, k = 91 :=
begin
sorry
end
theorem mathd_algebra_422
(x : ℝ)
(σ : equiv ℝ ℝ)
(h₀ : ∀ x, σ.1 x = 5 * x - 12)
(h₁ : σ.1 (x + 1) = σ.2 x) :
x = 47 / 24 :=
begin
field_simp [h₀, mul_add, add_mul, sub_add_cancel, mul_assoc, add_comm],
have := congr_arg σ.to_fun h₁,
rw h₀ at this,
rw h₀ at this,
symmetry,
norm_num at this,
linarith,
end
theorem amc12b_2002_p11
(a b : ℕ)
(h₀ : nat.prime a)
(h₁ : nat.prime b)
(h₂ : nat.prime (a + b))
(h₃ : nat.prime (a - b)) :
nat.prime (a + b + (a - b + (a + b))) :=
begin
sorry
end
theorem mathd_algebra_73
(p q r x : ℂ)
(h₀ : (x - p) * (x - q) = (r - p) * (r - q))
(h₁ : x ≠ r) :
x = p + q - r :=
begin
sorry
end
theorem mathd_numbertheory_109
(v : ℕ → ℕ)
(h₀ : ∀ n, v n = 2 * n - 1) :
(∑ k in finset.Icc 1 100, v k) % 7 = 4 :=
begin
norm_num,
simp [h₀],
have h₁ : finset.Icc 1 100 = finset.Ico 1 101, {
exact rfl,
},
rw h₁,
norm_num [finset.sum_Ico_succ_top],
end
theorem algebra_xmysqpymzsqpzmxsqeqxyz_xpypzp6dvdx3y3z3
(x y z : ℤ)
(h₀ : (x - y)^2 + (y - z)^2 + (z - x)^2 = x * y * z) :
(x + y + z + 6) ∣ (x^3 + y^3 + z^3) :=
begin
sorry
end
theorem imo_1962_p4
(S : set ℝ)
(h₀ : S = {x : ℝ | (real.cos x)^2 + (real.cos (2 * x))^2 + (real.cos (3 * x))^2 = 1}) :
S = {x : ℝ | ∃ m : ℤ, (x = π / 2 + m * π) ∨ (x = π / 4 + m * π / 2) ∨ (x = π / 6 + m * π) ∨ (x = 5 * π / 6 + m * π)} :=
begin
sorry
end
theorem mathd_numbertheory_236 :
(1999^2000) % 5 = 1 :=
begin
sorry
end
theorem mathd_numbertheory_24 :
(∑ k in (finset.Icc 1 9), 11^k) % 100 = 59 :=
begin
norm_num,
have h₁ : finset.Icc 1 9 = finset.Ico 1 10, {
exact rfl,
},
rw h₁,
norm_num [finset.sum_Ico_succ_top],
end
theorem algebra_amgm_prod1toneq1_sum1tongeqn
(a : ℕ → nnreal)
(n : ℕ)
(h₀ : finset.prod (finset.range(n)) a = 1) :
finset.sum (finset.range(n)) a ≥ n :=
begin
sorry
end
theorem mathd_algebra_101
(x : ℝ)
(h₀ : x^2 - 5 * x - 4 ≤ 10) :
x ≥ -2 ∧ x ≤ 7 :=
begin
split; nlinarith,
end
theorem mathd_numbertheory_257
(x : ℕ)
(h₀ : 1 ≤ x ∧ x ≤ 100)
(h₁ : 77∣(∑ k in (finset.range 101), k - x)) :
x = 45 :=
begin
sorry
end
theorem amc12_2000_p5
(x p : ℝ)
(h₀ : x < 2)
(h₁ : abs (x - 2) = p) :
x - p = 2 - 2 * p :=
begin
suffices : abs (x - 2) = -(x - 2),
{
rw h₁ at this,
linarith,
},
apply abs_of_neg,
linarith,
end
theorem mathd_algebra_547
(x y : ℝ)
(h₀ : x = 5)
(h₁ : y = 2) :
real.sqrt (x^3 - 2^y) = 11 :=
begin
sorry
end
theorem mathd_numbertheory_200 :
139 % 11 = 7 :=
begin
norm_num,
end
theorem mathd_algebra_510
(x y : ℝ)
(h₀ : x + y = 13)
(h₁ : x * y = 24) :
real.sqrt (x^2 + y^2) = 11 :=
begin
sorry
end
theorem mathd_algebra_140
(a b c : ℝ)
(h₀ : 0 < a ∧ 0 < b ∧ 0 < c)
(h₁ : ∀ x, 24 * x^2 - 19 * x - 35 = (((a * x) - 5) * ((2 * (b * x)) + c))) :
a * b - 3 * c = -9 :=
begin
have h₂ := h₁ 0,
have h₂ := h₁ 1,
have h₃ := h₁ (-1),
linarith,
end
theorem mathd_algebra_455
(x : ℝ)
(h₀ : 2 * (2 * (2 * (2 * x))) = 48) :
x = 3 :=
begin
linarith,
end
theorem mathd_numbertheory_45 :
(nat.gcd 6432 132) + 11 = 23 :=
begin
simp only [nat.gcd_comm],
norm_num,
end
theorem aime_1994_p4
(n : ℕ)
(h₀ : 0 < n)
(h₀ : ∑ k in finset.Icc 1 n, int.floor (real.logb 2 k) = 1994) :
n = 312 :=
begin
sorry
end
theorem mathd_numbertheory_739 :
9! % 10 = 0 :=
begin
norm_num,
end
theorem mathd_algebra_245
(x : ℝ)
(h₀ : x ≠ 0) :
(4 / x)⁻¹ * ((3 * x^3) / x)^2 * ((1 / (2 * x))⁻¹)^3 = 18 * x^8 :=
begin
field_simp [(show x ≠ 0, by simpa using h₀), mul_comm x]; ring,
end
theorem algebra_apb4leq8ta4pb4
(a b : ℝ)
(h₀ : 0 < a ∧ 0 < b) :
(a + b)^4 ≤ 8 * (a^4 + b^4) :=
begin
sorry
end
theorem mathd_algebra_28
(c : ℝ)
(f : ℝ → ℝ)
(h₀ : ∀ x, f x = 2 * x^2 + 5 * x + c)
(h₁ : ∃ x, f x ≤ 0) :
c ≤ 25/8 :=
begin
sorry
end
theorem mathd_numbertheory_543 :
(∑ k in (nat.divisors (30^4)), 1) - 2 = 123 :=
begin
sorry
end
theorem mathd_algebra_480
(f : ℝ → ℝ)
(h₀ : ∀ x < 0, f x = -(x^2) - 1)
(h₁ : ∀ x, 0 ≤ x ∧ x < 4 → f x = 2)
(h₂ : ∀ x ≥ 4, f x = real.sqrt x) :
f π = 2 :=
begin
sorry
end
theorem mathd_algebra_69
(rows seats : ℕ)
(h₀ : rows * seats = 450)
(h₁ : (rows + 5) * (seats - 3) = 450) :
rows = 25 :=
begin
sorry
end
theorem mathd_algebra_433
(f : ℝ → ℝ)
(h₀ : ∀ x, f x = 3 * real.sqrt (2 * x - 7) - 8) :
f 8 = 1 :=
begin
sorry
end
theorem mathd_algebra_126
(x y : ℝ)
(h₀ : 2 * 3 = x - 9)
(h₁ : 2 * (-5) = y + 1) :
x = 15 ∧ y = -11 :=
begin
split; linarith,
end
theorem aimeII_2020_p6
(t : ℕ → ℚ)
(h₀ : t 1 = 20)
(h₁ : t 2 = 21)
(h₂ : ∀ n ≥ 3, t n = (5 * t (n - 1) + 1) / (25 * t (n - 2))) :
↑(t 2020).denom + (t 2020).num = 626 :=
begin
sorry
end
theorem amc12a_2008_p2
(x : ℝ)
(h₀ : x * (1 / 2 + 2 / 3) = 1) :
x = 6 / 7 :=
begin
linarith,
end
theorem mathd_algebra_35
(p q : ℝ → ℝ)
(h₀ : ∀ x, p x = 2 - x^2)
(h₁ : ∀ x ≠ 0, q x = 6 / x) :
p (q 2) = -7 :=
begin
rw [h₀, h₁],
ring,
linarith,
end
theorem algebra_amgm_faxinrrp2msqrt2geq2mxm1div2x :
∀ x > 0, 2 - real.sqrt 2 ≥ 2 - x - 1 / (2 * x) :=
begin
intros x h,
suffices : real.sqrt 2 ≤ x + 1 / (2 * x), linarith,
have h₀ := (nnreal.geom_mean_le_arith_mean2_weighted (1/2) (1/2) (real.to_nnreal x) (real.to_nnreal (1/(2 * x)))) _,
norm_num at h₀,
rw [← nnreal.mul_rpow, ← real.to_nnreal_mul] at h₀,
have h₁ : x * (1 / (2 * x)) = 1 / 2, {
rw [mul_div_comm, one_mul, div_eq_div_iff],
ring,
apply ne_of_gt,
repeat {linarith,},
},
rw h₁ at h₀,
have h₂ : real.to_nnreal (1/2)^((1:ℝ)/2) = real.to_nnreal ((1/2)^((1:ℝ)/2)), {
refine nnreal.coe_eq.mp _,
rw [real.coe_to_nnreal, nnreal.coe_rpow, real.coe_to_nnreal],
linarith,
apply le_of_lt,
exact real.rpow_pos_of_pos (by norm_num) _,
},
rw [h₂, ←nnreal.coe_le_coe, real.coe_to_nnreal, nnreal.coe_add, nnreal.coe_mul, nnreal.coe_mul, real.coe_to_nnreal, real.coe_to_nnreal] at h₀,
have h₃ : 2 * ((1 / 2)^((1:ℝ) / 2)) ≤ 2 * (↑((1:nnreal) / 2) * x + ↑((1:nnreal) / 2) * (1 / (2 * x))), {
refine (mul_le_mul_left _).mpr _,
linarith,
exact h₀,
},
have h₄ : 2 * ((1 / 2)^((1:ℝ) / 2)) = real.sqrt 2, {
rw [eq_comm, real.sqrt_eq_iff_mul_self_eq],
calc (2:ℝ) * (1 / (2:ℝ))^(1 / (2:ℝ)) * ((2:ℝ) * (1 / (2:ℝ))^(1 / (2:ℝ))) = (2:ℝ) * (2:ℝ) * ((1 / (2:ℝ))^(1 / (2:ℝ)) * (1 / (2:ℝ))^(1 / (2:ℝ))) : by {ring,}
... = (2:ℝ) * (2:ℝ) * (1 / (2:ℝ))^((1 / (2:ℝ)) + (1 / (2:ℝ))) : by {rw real.rpow_add, linarith,}
... = (2:ℝ) * (2:ℝ) * (1 / (2:ℝ))^(1:ℝ) : by {congr', apply add_halves,}
... = (2:ℝ) * (2:ℝ) * (1 / (2:ℝ)) : by {simp,}
... = (2:ℝ) : by {norm_num,},
linarith,
apply le_of_lt,
norm_num,
exact real.rpow_pos_of_pos (by norm_num) _,
},
have h₅ : 2 * (↑((1:nnreal) / 2) * x + ↑((1:nnreal) / 2) * (1 / (2 * x))) = x + 1 / (2 * x), {
rw [mul_add, ← mul_assoc, ← mul_assoc, nnreal.coe_div, nnreal.coe_one],
have h₆ : ↑(2:nnreal) = (2:ℝ), exact rfl,
rw h₆,
ring,
},
rwa [←h₄, ←h₅],
apply div_nonneg_iff.mpr,
left,
split,
repeat {linarith,},
apply le_of_lt,
exact real.rpow_pos_of_pos (by norm_num) _,
apply nnreal.add_halves,
end
theorem mathd_numbertheory_335
(n : ℕ)
(h₀ : n % 7 = 5) :
(5 * n) % 7 = 4 :=
begin
sorry
end
theorem mathd_numbertheory_35
(S : finset ℕ)
(h₀ : ∀ (n : ℕ), n ∣ (nat.sqrt 196)) :
∑ k in S, k = 24 :=
begin
sorry
end
theorem amc12a_2021_p7
(x y : ℝ) :
1 ≤ ((x * y) - 1)^2 + (x + y)^2 :=
begin
ring_nf,
nlinarith,
end
theorem mathd_algebra_327
(a : ℝ)
(h₀ : 1 / 5 * abs (9 + 2 * a) < 1) :
-7 < a ∧ a < -2 :=
begin
have h₁ := (mul_lt_mul_left (show 0 < (5:ℝ), by linarith)).mpr h₀,
have h₂ : abs (9 + 2 * a) < 5, linarith,
have h₃ := abs_lt.mp h₂,
cases h₃ with h₃ h₄,
split; nlinarith,
end
theorem aime_1984_p15
(x y z w : ℝ)
(h₀ : (x^2 / (2^2 - 1)) + (y^2 / (2^2 - 3^2)) + (z^2 / (2^2 - 5^2)) + (w^2 / (2^2 - 7^2)) = 1)
(h₁ : (x^2 / (4^2 - 1)) + (y^2 / (4^2 - 3^2)) + (z^2 / (4^2 - 5^2)) + (w^2 / (4^2 - 7^2)) = 1)
(h₂ : (x^2 / (6^2 - 1)) + (y^2 / (6^2 - 3^2)) + (z^2 / (6^2 - 5^2)) + (w^2 / (6^2 - 7^2)) = 1)
(h₃ : (x^2 / (8^2 - 1)) + (y^2 / (8^2 - 3^2)) + (z^2 / (8^2 - 5^2)) + (w^2 / (8^2 - 7^2)) = 1) :
x^2 + y^2 + z^2 + w^2 = 36 :=
begin
revert x y z w h₀ h₁ h₂ h₃,
ring_nf,
intros x y z w h,
intros h,
intros; linarith,
end
theorem algebra_amgm_sqrtxymulxmyeqxpy_xpygeq4
(x y : ℝ)
(h₀ : 0 < x ∧ 0 < y)
(h₁ : y ≤ x)
(h₂ : real.sqrt (x * y) * (x - y) = (x + y)) :
x + y ≥ 4 :=
begin
sorry
end
theorem amc12a_2002_p21
(u : ℕ → ℕ)
(h₀ : u 0 = 4)
(h₁ : u 1 = 7)
(h₂ : ∀ n ≥ 2, u (n + 2) = (u n + u (n + 1)) % 10) :
∀ n, ∑ k in finset.range(n), u k > 10000 → 1999 ≤ n :=
begin
sorry
end
theorem mathd_algebra_192
(q e d : ℂ)
(h₀ : q = 11 - (5 * complex.I))
(h₁ : e = 11 + (5 * complex.I))
(h₂ : d = 2 * complex.I) :
q * e * d = 292 * complex.I :=
begin
rw [h₀, h₁, h₂],
ring_nf,
rw [pow_two, complex.I_mul_I],
ring,
end
theorem amc12b_2002_p6
(a b : ℝ)
(h₀ : a ≠ 0 ∧ b ≠ 0)
(h₁ : ∀ x, x^2 + a * x + b = (x - a) * (x - b)) :
a = 1 ∧ b = -2 :=
begin
have h₂ := h₁ a,
have h₃ := h₁ b,
have h₄ := h₁ 0,
simp at *,
have h₅ : b * (1 - a) = 0, linarith,
simp at h₅,
cases h₅ with h₅ h₆,
exfalso,
exact absurd h₅ h₀.2,
have h₆ : a = 1, linarith,
split,
exact h₆,
rw h₆ at h₂,
linarith,
end
theorem mathd_numbertheory_102 :
(2^8) % 5 = 1 :=
begin
norm_num,
end
theorem amc12a_2010_p22
(x : ℝ) :
49 ≤ ∑ k in finset.Icc 1 119, abs (↑k * x - 1) :=
begin
sorry
end
theorem mathd_numbertheory_81 :
71 % 3 = 2 :=
begin
norm_num,
end
theorem mathd_numbertheory_155 :
finset.card (finset.filter (λ x, x % 19 = 7) (finset.Icc 100 999)) = 52 :=
begin
sorry
end
theorem imo_1978_p5
(n : ℕ)
(a : ℕ → ℕ)
(h₀ : ∀ (m : ℕ), 0 < a m)
(h₁ : ∀ (p q : ℕ), p ≠ q → a p ≠ a q)
(h₂ : 0 < n) :
(∑ k in finset.Icc 1 n, (1 : ℝ)/k) ≤ ∑ k in finset.Icc 1 n, (a k)/k^2 :=
begin
sorry
end
theorem amc12a_2017_p7
(f : ℕ → ℝ)
(h₀ : f 1 = 2)
(h₁ : ∀ n, 1 < n ∧ even n → f n = f (n - 1) + 1)
(h₂ : ∀ n, 1 < n ∧ odd n → f n = f (n - 2) + 2) :
f 2017 = 2018 :=
begin
sorry
end
theorem mathd_numbertheory_42
(S : set ℕ)
(u v : ℕ)
(h₀ : ∀ (a : ℕ), a ∈ S ↔ 0 < a ∧ 27 * a % 40 = 17)
(h₁ : is_least S u)
(h₂ : is_least (S \ {u}) v) :
u + v = 62 :=
begin
sorry
end
theorem mathd_algebra_110
(q e : ℂ)
(h₀ : q = 2 - 2 * complex.I)
(h₁ : e = 5 + 5 * complex.I) :
q * e = 20 :=
begin
rw [h₀, h₁],
ring_nf,
rw [pow_two, complex.I_mul_I],
ring,
end
theorem amc12b_2021_p21
(S : finset ℝ)
(h₀ : ∀ (x : ℝ), x ∈ S ↔ 0 < x ∧ x^((2 : ℝ)^real.sqrt 2) = (real.sqrt 2)^((2 : ℝ)^x)) :
↑2 ≤ ∑ k in S, k ∧ ∑ k in S, k < 6 :=
begin
sorry
end
theorem mathd_algebra_405
(S : finset ℕ)
(h₀ : ∀ x, x ∈ S ↔ 0 < x ∧ x^2 + 4 * x + 4 < 20) :
S.card = 2 :=
begin
sorry
end
theorem numbertheory_sumkmulnckeqnmul2pownm1
(n : ℕ)
(h₀ : 0 < n) :
∑ k in finset.Icc 1 n, (k * nat.choose n k) = n * 2^(n - 1) :=
begin
sorry
end
theorem mathd_algebra_393
(σ : equiv ℝ ℝ)
(h₀ : ∀ x, σ.1 x = 4 * x^3 + 1) :
σ.2 33 = 2 :=
begin
sorry
end
theorem amc12b_2004_p3
(x y : ℕ)
(h₀ : 2^x * 3^y = 1296) :
x + y = 8 :=
begin
sorry
end
theorem mathd_numbertheory_303
(S : finset ℕ)
(h₀ : ∀ (n : ℕ), n ∈ S ↔ 2 ≤ n ∧ 171 ≡ 80 [MOD n] ∧ 468 ≡ 13 [MOD n]) :
∑ k in S, k = 111 :=
begin
sorry
end
theorem mathd_algebra_151 :
int.ceil (real.sqrt 27) - int.floor (real.sqrt 26) = 1 :=
begin
sorry
end
theorem amc12a_2011_p18
(x y : ℝ)
(h₀ : abs (x + y) + abs (x - y) = 2) :
x^2 - 6 * x + y^2 ≤ 9 :=
begin
sorry
end
theorem mathd_algebra_15
(s : ℕ → ℕ → ℕ)
(h₀ : ∀ a b, 0 < a ∧ 0 < b → s a b = a^(b:ℕ) + b^(a:ℕ)) :
s 2 6 = 100 :=
begin
rw h₀,
refl,
norm_num,
end
theorem mathd_numbertheory_211 :
finset.card (finset.filter (λ n, 6 ∣ (4 * ↑n - (2 : ℤ))) (finset.range 60)) = 20 :=
begin
-- apply le_antisymm,
-- -- haveI := classical.prop_decidable,
-- swap,
-- dec_trivial!,
-- apply le_trans,
-- swap,
-- apply nat.le_of_dvd,
-- { norm_num, },
-- -- haveI := classical.dec,
-- simp,
sorry
end
theorem mathd_numbertheory_640 :
(91145 + 91146 + 91147 + 91148) % 4 = 2 :=
begin
norm_num,
end
theorem amc12b_2003_p6
(a r : ℝ)
(u : ℕ → ℝ)
(h₀ : ∀ k, u k = a * r^k)
(h₁ : u 1 = 2)
(h₂ : u 3 = 6) :
u 0 = 2 / real.sqrt 3 ∨ u 0 = - (2 / real.sqrt 3) :=
begin
sorry
end
theorem algebra_2rootsintpoly_am10tap11eqasqpam110
(a : ℂ) :
(a - 10) * (a + 11) = a^2 + a - 110 :=
begin
ring,
end
theorem aime_1991_p1
(x y : ℕ)
(h₀ : 0 < x ∧ 0 < y)
(h₁ : x * y + (x + y) = 71)
(h₂ : x^2 * y + x * y^2 = 880) :
x^2 + y^2 = 146 :=
begin
sorry
end
theorem mathd_algebra_43
(a b : ℝ)
(f : ℝ → ℝ)
(h₀ : ∀ x, f x = a * x + b)
(h₁ : f 7 = 4)
(h₂ : f 6 = 3) :
f 3 = 0 :=
begin
rw h₀ at *,
linarith,
end
theorem imo_1988_p6
(a b : ℕ)
(h₀ : 0 < a ∧ 0 < b)
(h₁ : (a * b + 1) ∣ (a^2 + b^2)) :
∃ x : ℕ, (x^2 : ℝ) = (a^2 + b^2) / (a * b + 1) :=
begin
sorry
end
theorem aime_1996_p5