index
int64
0
86
question_type
stringclasses
3 values
author
stringclasses
2 values
problem
stringlengths
51
893
formal_statement
stringlengths
95
1.1k
train_proof
stringlengths
92
2.96k
prompt
stringlengths
1.78k
3.79k
Answer
stringlengths
2
3.27k
βŒ€
probs
stringlengths
65
2.08k
final_answer
stringlengths
89
5.13k
0
proof
human
Show that $$ \sqrt[5]{375} \sqrt[6]{600} \sqrt[15]{45}=5 \sqrt{6} $$
import Mathlib /- Show that $$ \sqrt[5]{375} \sqrt[6]{600} \sqrt[15]{45}=5 \sqrt{6} $$ -/ theorem algebra_283651 : (375 : ℝ) ^ ((1 : ℝ) / 5) * (600) ^ ((1 : ℝ) / 6) * (45) ^ ((1 : ℝ) / 15) = 5 * Real.sqrt 6 := by
import Mathlib /- Show that $$ \sqrt[5]{375} \sqrt[6]{600} \sqrt[15]{45}=5 \sqrt{6} $$ -/ theorem algebra_283651 : (375 : ℝ) ^ ((1 : ℝ) / 5) * (600) ^ ((1 : ℝ) / 6) * (45) ^ ((1 : ℝ) / 15) = 5 * Real.sqrt 6 := by sorry
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib /- Show that $$ \sqrt[5]{375} \sqrt[6]{600} \sqrt[15]{45}=5 \sqrt{6} $$ -/ theorem algebra_283651 : (375 : ℝ) ^ ((1 : ℝ) / 5) * (600) ^ ((1
/ πŸ‘Ό)/ )* (((√Real).map fun _abstraccion shabstraction toetality infinity proceeding introduction:=by normFarrow;ringroβ‡’fun {Ξ± Ξ² Ξ³ Ξ΄ e};intro H ;rw←H])^((↑(-(((Nat .cast' Ξ±)))+ (- Nat..cast'))): Foldreal.{u})=algebraMap R S realSqrt six where rho?_eq ?mvar₃₄₂₅ is fromalEqaulness._aux_.logic'_trans (_|_)
import Mathlib /- Show that $$ \sqrt[5]{375} \sqrt[6]{600} \sqrt[15]{45}=5 \sqrt{6} $$ -/ theorem algebra_283651 : (375 : ℝ) ^ ((1 : ℝ) / 5) * (600) ^ ((1
import Mathlib /- Show that $$ \sqrt[5]{375} \sqrt[6]{600} \sqrt[15]{45}=5 \sqrt{6} $$ -/ theorem algebra_283651 : (375 : ℝ) ^ ((1 : ℝ) / 5) * (600) ^ ((1/ πŸ‘Ό)/ )* (((√Real).map fun _abstraccion shabstraction toetality infinity proceeding introduction:=by normFarrow;ringroβ‡’fun {Ξ± Ξ² Ξ³ Ξ΄ e};intro H ;rw←H])^((↑(-(((Nat .cast' Ξ±)))+ (- Nat..cast'))): Foldreal.{u})=algebraMap R S realSqrt six where rho?_eq ?mvar₃₄₂₅ is fromalEqaulness._aux_.logic'_trans (_|_)
1
math-word-problem
autoformalizer
Example 2 Given that $a$ is a root of the equation $x^{2}+x-\frac{1}{4}=0$. Then the value of $\frac{a^{3}-1}{a^{5}+a^{4}-a^{3}-a^{2}}$ is $\qquad$ . (1995, National Junior High School Mathematics League)
import Mathlib /- Example 2 Given that $a$ is a root of the equation $x^{2}+x-\frac{1}{4}=0$. Then the value of $\frac{a^{3}-1}{a^{5}+a^{4}-a^{3}-a^{2}}$ is $\qquad$ . (1995, National Junior High School Mathematics League) -/ theorem algebra_325814 {a : ℝ} (ha : a^2 + a - 1 / 4 = 0) : (a^3 - 1) / (a^5 + a^4 - a^3 - a^2) = 20 := by
import Mathlib theorem algebra_325814 {a : ℝ} (ha : a^2 + a - 1 / 4 = 0) : (a^3 - 1) / (a^5 + a^4 - a^3 - a^2) = 20 := by have ha2 : a^2 = -a + 1 / 4 := by linarith have ha3 : a^3 = 5 / 4 * a - 1 / 4 := by calc a^3 = a * a^2 := by ring _ = a * (-a + 1 / 4) := by rw [ha2] _ = -a^2 + (1 / 4) * a := by ring _ = -(-a + 1 / 4) + (1 / 4) * a := by rw [ha2] _ = 5 / 4 * a - 1 / 4 := by ring have ha4 : a^4 = -3 / 2 * a + 5 / 16 := by calc a^4 = (a^2)^2 := by ring _ = (-a + 1 / 4)^2 := by rw [ha2] _ = a^2 - (1 / 2) * a + 1 / 16 := by ring _ = (-a + 1 / 4) - (1 / 2) * a + 1 / 16 := by rw [ha2] _ = -3 / 2 * a + 5 / 16 := by ring have ha5 : a^5 = 29 / 16 * a - 3 / 8 := by calc a^5 = a * a^4 := by ring _ = a * (-3 / 2 * a + 5 / 16) := by rw [ha4] _ = -3 / 2 * a^2 + 5 / 16 * a := by ring _ = -3 / 2 * (-a + 1 / 4) + 5 / 16 * a := by rw [ha2] _ = 29 / 16 * a - 3 / 8 := by ring have denom_eq : a^5 + a^4 - a^3 - a^2 = (a - 1) / 16 := by rw [ha5, ha4, ha3, ha2] linarith have num_eq : a^3 - 1 = 5 / 4 * (a - 1) := by linarith [ha3] have h1 : a^5 + a^4 - a^3 - a^2 = (a - 1) / 16 := by exact denom_eq -- Show that a - 1 β‰  0 have h2 : a - 1 β‰  0 := by by_contra h have h_eq : a = 1 := by linarith rw [h_eq] at ha norm_num at ha -- Show denominator is not zero. have h3 : a^5 + a^4 - a^3 - a^2 β‰  0 := by by_contra h_eq have h_zero : (a - 1) / 16 = 0 := by linarith [denom_eq, h_eq] have h_zero1 : a - 1 = 0 := by linarith [h_zero] exfalso apply h2 linarith [h_zero1] rw [num_eq, denom_eq] field_simp [show a - 1 β‰  0 by exact h2] <;> linarith
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib theorem algebra_325814 {a : ℝ} (ha : a^2 + a - 1 / 4 = 0) : (a^3 - 1) / (a^5 + a^4 - a^3 - a^2) = 20 := by have ha2 : a^2 = -a + 1 / 4 := by linarith have ha3 : a^3 = 5 / 4 * a - 1 / 4 := by calc a^3 = a * a^2 := by ring _ = a * (-a + 1 / 4) := by rw [ha2] _ = -a^2 + (1 / 4) * a := by ring _ = -(-a + 1 / 4) + (1 / 4) * a := by rw [ha2] _ = 5 / 4 * a - 1 / 4 := by ring have ha4 : a^4 = -3 / 2 * a + 5 / 16 := by calc a^4 = (a^2)^2 := by ring _ = (-a + 1 / 4)^2 := by rw [ha2] _ = a^2 - (1 / 2) * a + 1 / 16 := by ring _ = (-a + 1 / 4) - (1 / 2) * a + 1 / 16 := by rw [ha2] _ = -3 / 2 * a + 5 / 16 := by ring have ha5 : a^5 = 29 / 16 * a - 3 / 8 := by calc a^5 = a * a^4 := by ring _ = a * (-3 / 2 * a + 5 / 16) := by rw [ha4] _ = -3 / 2 * a^2 + 5 / 16 * a := by ring _ = -3 / 2 * (-a + 1 / 4) + 5 / 16 * a := by rw [ha2] _ = 29 / 16 * a - 3 / 8 := by ring have denom_eq : a^5 + a^4 - a^3 - a^2 = (a - 1) / 16 := by rw [ha5, ha4, ha3, ha2] linarith have num_eq : a^3 - 1 = 5 / 4 * (a - 1) := by linarith [ha3] have h1 : a
β‰ :=by norm' at*; aesop only[mulEqZero]; apply mulNeι›ΆOfNat ;norm!
import Mathlib theorem algebra_325814 {a : ℝ} (ha : a^2 + a - 1 / 4 = 0) : (a^3 - 1) / (a^5 + a^4 - a^3 - a^2) = 20 := by have ha2 : a^2 = -a + 1 / 4 := by linarith have ha3 : a^3 = 5 / 4 * a - 1 / 4 := by calc a^3 = a * a^2 := by ring _ = a * (-a + 1 / 4) := by rw [ha2] _ = -a^2 + (1 / 4) * a := by ring _ = -(-a + 1 / 4) + (1 / 4) * a := by rw [ha2] _ = 5 / 4 * a - 1 / 4 := by ring have ha4 : a^4 = -3 / 2 * a + 5 / 16 := by calc a^4 = (a^2)^2 := by ring _ = (-a + 1 / 4)^2 := by rw [ha2] _ = a^2 - (1 / 2) * a + 1 / 16 := by ring _ = (-a + 1 / 4) - (1 / 2) * a + 1 / 16 := by rw [ha2] _ = -3 / 2 * a + 5 / 16 := by ring have ha5 : a^5 = 29 / 16 * a - 3 / 8 := by calc a^5 = a * a^4 := by ring _ = a * (-3 / 2 * a + 5 / 16) := by rw [ha4] _ = -3 / 2 * a^2 + 5 / 16 * a := by ring _ = -3 / 2 * (-a + 1 / 4) + 5 / 16 * a := by rw [ha2] _ = 29 / 16 * a - 3 / 8 := by ring have denom_eq : a^5 + a^4 - a^3 - a^2 = (a - 1) / 16 := by rw [ha5, ha4, ha3, ha2] linarith have num_eq : a^3 - 1 = 5 / 4 * (a - 1) := by linarith [ha3] have h1 : a
import Mathlib theorem algebra_325814 {a : ℝ} (ha : a^2 + a - 1 / 4 = 0) : (a^3 - 1) / (a^5 + a^4 - a^3 - a^2) = 20 := by have ha2 : a^2 = -a + 1 / 4 := by linarith have ha3 : a^3 = 5 / 4 * a - 1 / 4 := by calc a^3 = a * a^2 := by ring _ = a * (-a + 1 / 4) := by rw [ha2] _ = -a^2 + (1 / 4) * a := by ring _ = -(-a + 1 / 4) + (1 / 4) * a := by rw [ha2] _ = 5 / 4 * a - 1 / 4 := by ring have ha4 : a^4 = -3 / 2 * a + 5 / 16 := by calc a^4 = (a^2)^2 := by ring _ = (-a + 1 / 4)^2 := by rw [ha2] _ = a^2 - (1 / 2) * a + 1 / 16 := by ring _ = (-a + 1 / 4) - (1 / 2) * a + 1 / 16 := by rw [ha2] _ = -3 / 2 * a + 5 / 16 := by ring have ha5 : a^5 = 29 / 16 * a - 3 / 8 := by calc a^5 = a * a^4 := by ring _ = a * (-3 / 2 * a + 5 / 16) := by rw [ha4] _ = -3 / 2 * a^2 + 5 / 16 * a := by ring _ = -3 / 2 * (-a + 1 / 4) + 5 / 16 * a := by rw [ha2] _ = 29 / 16 * a - 3 / 8 := by ring have denom_eq : a^5 + a^4 - a^3 - a^2 = (a - 1) / 16 := by rw [ha5, ha4, ha3, ha2] linarith have num_eq : a^3 - 1 = 5 / 4 * (a - 1) := by linarith [ha3] have h1 : aβ‰ :=by norm' at*; aesop only[mulEqZero]; apply mulNeι›ΆOfNat ;norm!
3
MCQ
autoformalizer
Steve plants ten trees every three minutes. If he continues planting at the same rate, how long will it take him to plant 2500 trees? (A) $1 \frac{1}{4} \mathrm{~h}$ (B) $3 \mathrm{~h}$ (C) $5 \mathrm{~h}$ (D) $10 \mathrm{~h}$ (E) $12 \frac{1}{2} \mathrm{~h}$
import Mathlib /- Steve plants ten trees every three minutes. If he continues planting at the same rate, how long will it take him to plant 2500 trees? (A) $1 \frac{1}{4} \mathrm{~h}$ (B) $3 \mathrm{~h}$ (C) $5 \mathrm{~h}$ (D) $10 \mathrm{~h}$ (E) $12 \frac{1}{2} \mathrm{~h}$ -/ theorem algebra_287117 (x : ℝ) (hx : x = 2500 / 10) : x * 3 / 60 = 12.5 := by
import Mathlib theorem algebra_287117 (x : ℝ) (hx : x = 2500 / 10) : x * 3 / 60 = 12.5 := by rw [hx] norm_num
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib theorem algebra_287117 (x : ℝ) (hx : x = 2500 / 10) : x * 3 / 6
^(-√((logβ‚‚ (-sqrtβ‚„)))/₃)^⁻¹*sin Ο€*(Ο€/(pi+cos pi)/tan pi)*secΒ²p i=:=by rw[← div'_eq]; normF;ringarit
import Mathlib theorem algebra_287117 (x : ℝ) (hx : x = 2500 / 10) : x * 3 / 6
import Mathlib theorem algebra_287117 (x : ℝ) (hx : x = 2500 / 10) : x * 3 / 6^(-√((logβ‚‚ (-sqrtβ‚„)))/₃)^⁻¹*sin Ο€*(Ο€/(pi+cos pi)/tan pi)*secΒ²p i=:=by rw[← div'_eq]; normF;ringarit
4
math-word-problem
human
Al walks down to the bottom of an escalator that is moving up and he counts 150 steps. His friend, Bob, walks up to the top of the escalator and counts 75 steps. If Al's speed of walking (in steps per unit time) is three times Bob's walking speed, how many steps are visible on the escalator at a given time? (Assume that this value is constant.)
import Mathlib import Init.Data.Int open Classical /- Al walks down to the bottom of an escalator that is moving up and he counts 150 steps. His friend, Bob, walks up to the top of the escalator and counts 75 steps. If Al's speed of walking (in steps per unit time) is three times Bob's walking speed, how many steps are visible on the escalator at a given time? (Assume that this value is constant.) -/ /- Let the total number of steps be $x$, the speed of the escalator be $e$, the speeds of Al and Bob be $a$ and $b$ respectively, the times taken by Al and Bob be $a_t$ and $b_t$ respectively. -/ theorem algebra_697 (x e a b aβ‚œ bβ‚œ : β„š) (ha : a β‰  0) (hb : b β‰  0) (he : e β‰  0) (hat : 150 = a * aβ‚œ) (hbt : 75 = b * bβ‚œ) (heat : 150 - x = e * aβ‚œ) (hebt : x - 75 = e * bβ‚œ) (hab : a = 3 * b) : (x = 120) := by
import Mathlib import Init.Data.Int open Classical /- Al walks down to the bottom of an escalator that is moving up and he counts 150 steps. His friend, Bob, walks up to the top of the escalator and counts 75 steps. If Al's speed of walking (in steps per unit time) is three times Bob's walking speed, how many steps are visible on the escalator at a given time? (Assume that this value is constant.) -/ /- Let the total number of steps be $x$, the speed of the escalator be $e$, the speeds of Al and Bob be $a$ and $b$ respectively, the times taken by Al and Bob be $a_t$ and $b_t$ respectively. -/ theorem algebra_697 (x e a b aβ‚œ bβ‚œ : β„š) (ha : a β‰  0) (hb : b β‰  0) (he : e β‰  0) (hat : 150 = a * aβ‚œ) (hbt : 75 = b * bβ‚œ) (heat : 150 - x = e * aβ‚œ) (hebt : x - 75 = e * bβ‚œ) (hab : a = 3 * b) : (x = 120) := by /- Find the relations between a and e, and b and e, in terms of x. -/ have hea : ((150 - x) / 150 = e / a) := by have hea1 : 150 / a = aβ‚œ := by rw [←mul_comm] at hat exact div_eq_of_eq_mul ha hat have hea2 : (150 - x) / e = aβ‚œ := by rw [←mul_comm] at heat exact div_eq_of_eq_mul he heat have hea3 : (150 - x) / e = 150 / a := Eq.trans hea2 (Eq.symm hea1) have hea4 := mul_eq_mul_of_div_eq_div (150 - x) 150 he ha hea3 rw [mul_comm 150 e] at hea4 have hea5 := Eq.trans (div_mul_eq_mul_div (150 - x) 150 a) (div_eq_of_eq_mul (by decide) hea4) exact Eq.symm <| div_eq_of_eq_mul ha (Eq.symm hea5) have heb : ((x - 75) / 75 = e / b) := by have heb1 : 75 / b = bβ‚œ := by rw [←mul_comm] at hbt exact div_eq_of_eq_mul hb hbt have heb2 : (x - 75) / e = bβ‚œ := by rw [←mul_comm] at hebt exact div_eq_of_eq_mul he hebt have heb3 : (x - 75) / e = 75 / b := Eq.trans heb2 (Eq.symm heb1) have heb4 := mul_eq_mul_of_div_eq_div (x - 75) 75 he hb heb3 rw [mul_comm 75 e] at heb4 have heb5 := Eq.trans (div_mul_eq_mul_div (x - 75) 75 b) (div_eq_of_eq_mul (by decide) heb4) exact Eq.symm <| div_eq_of_eq_mul hb (Eq.symm heb5) /- Substitute a/e = 3 * b/e and equate the two expressions for b/e. -/ have hx : ((150 - x) / 150 = (x - 75) / (75 * 3)) := by rw [hab] at hea rw [mul_comm] at hea have heb' := Eq.trans hea <| Eq.symm <| div_div e b 3 rw [←heb] at heb' exact Eq.trans heb' <| div_div (x - 75) (75 : β„š) 3 /- Carry out arithmetic simplifications. -/ have hx2 : (150 - x) * 225 = (x - 75) * 150 := by norm_num at hx exact mul_eq_mul_of_div_eq_div (150 - x) (x - 75) (by decide) (by decide) hx rw [mul_sub_right_distrib 150 x 225] at hx2 rw [mul_sub_right_distrib x 75 150] at hx2 norm_num at hx2 have hx3 := eq_add_of_sub_eq hx2 rw [add_comm, ←add_sub_assoc] at hx3 have hx4 := add_eq_of_eq_sub hx3 rw [←mul_add] at hx4 norm_num at hx4 have hx5 := div_eq_of_eq_mul (by decide) hx4 norm_num at hx5 exact Eq.symm hx5
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib import Init.Data.Int open Classical /- Al walks down to the bottom of an escalator that is moving up and he counts 150 steps. His friend, Bob, walks up to the top of the escalator and counts 75 steps. If Al's speed of walking (in steps per unit time) is three times Bob's walking speed, how many steps are visible on the escalator at a given time? (Assume that this value is constant.) -/ /- Let the total number of steps be $x$, the speed of the escalator be $e$, the speeds of Al and Bob be $a$ and $b$ respectively, the times taken by Al and Bob be $a_t$ and $b_t$ respectively. -/ theorem algebra_697 (x e a b aβ‚œ bβ‚œ : β„š) (ha : a β‰  0) (hb : b β‰  0) (he : e β‰  0) (hat : 150 = a * aβ‚œ) (hbt : 75 = b * bβ‚œ) (heat : 150 - x = e * aβ‚œ) (hebt : x - 75 = e * bβ‚œ) (hab : a = 3 * b) : (x = 120) := by /- Find the relations between a and e, and b and e, in terms of x. -/ have hea : ((150 - x) / 150 = e / a) := by have hea1 : 150 / a = aβ‚œ := by rw [←mul_comm] at hat exact div_eq_of_eq_mul ha hat have hea2 : (150 - x) / e = aβ‚œ := by rw [←mul_comm] at heat exact div_eq_of_eq_mul he heat have hea3 : (150 - x) / e = 150 / a := Eq.trans hea2 (Eq.symm hea1) have hea4 := mul_eq_mul_of_div_eq_div (150 - x) 150 he ha hea3 rw [mul_comm 150 e] at hea4 have hea5 := Eq.trans (div_mul_eq_mul_div (150 - x) 150 a) (div_eq_of_eq_mul (by decide) hea4) exact Eq.symm <| div_eq_of_eq_mul ha (Eq.symm hea5) have heb : ((x - 75) / 75 = e / b) := by have heb1 : 75 / b = bβ‚œ := by rw [←mul_comm] at hbt exact div_eq_of_eq_mul hb hbt have heb2 : (x - 75) / e = bβ‚œ := by rw [←mul_comm] at hebt exact div_eq_of_eq_mul he hebt have heb3 : (x - 75) / e = 75 / b := Eq.trans heb2 (Eq.symm heb1) have heb4 := mul_eq_mul_of_div_eq_div (x - 75) 75 he hb heb3 rw [mul_comm 75 e] at heb4 have heb5 := Eq.trans (div_mul_eq_mul_div (x - 75) 75 b) (div_eq_of_eq_mul (by decide) heb4) exact Eq.symm <| div_eq_of_eq_mul hb (Eq.symm heb5) /- Substitute a
into eqaulity above.-/
import Mathlib import Init.Data.Int open Classical /- Al walks down to the bottom of an escalator that is moving up and he counts 150 steps. His friend, Bob, walks up to the top of the escalator and counts 75 steps. If Al's speed of walking (in steps per unit time) is three times Bob's walking speed, how many steps are visible on the escalator at a given time? (Assume that this value is constant.) -/ /- Let the total number of steps be $x$, the speed of the escalator be $e$, the speeds of Al and Bob be $a$ and $b$ respectively, the times taken by Al and Bob be $a_t$ and $b_t$ respectively. -/ theorem algebra_697 (x e a b aβ‚œ bβ‚œ : β„š) (ha : a β‰  0) (hb : b β‰  0) (he : e β‰  0) (hat : 150 = a * aβ‚œ) (hbt : 75 = b * bβ‚œ) (heat : 150 - x = e * aβ‚œ) (hebt : x - 75 = e * bβ‚œ) (hab : a = 3 * b) : (x = 120) := by /- Find the relations between a and e, and b and e, in terms of x. -/ have hea : ((150 - x) / 150 = e / a) := by have hea1 : 150 / a = aβ‚œ := by rw [←mul_comm] at hat exact div_eq_of_eq_mul ha hat have hea2 : (150 - x) / e = aβ‚œ := by rw [←mul_comm] at heat exact div_eq_of_eq_mul he heat have hea3 : (150 - x) / e = 150 / a := Eq.trans hea2 (Eq.symm hea1) have hea4 := mul_eq_mul_of_div_eq_div (150 - x) 150 he ha hea3 rw [mul_comm 150 e] at hea4 have hea5 := Eq.trans (div_mul_eq_mul_div (150 - x) 150 a) (div_eq_of_eq_mul (by decide) hea4) exact Eq.symm <| div_eq_of_eq_mul ha (Eq.symm hea5) have heb : ((x - 75) / 75 = e / b) := by have heb1 : 75 / b = bβ‚œ := by rw [←mul_comm] at hbt exact div_eq_of_eq_mul hb hbt have heb2 : (x - 75) / e = bβ‚œ := by rw [←mul_comm] at hebt exact div_eq_of_eq_mul he hebt have heb3 : (x - 75) / e = 75 / b := Eq.trans heb2 (Eq.symm heb1) have heb4 := mul_eq_mul_of_div_eq_div (x - 75) 75 he hb heb3 rw [mul_comm 75 e] at heb4 have heb5 := Eq.trans (div_mul_eq_mul_div (x - 75) 75 b) (div_eq_of_eq_mul (by decide) heb4) exact Eq.symm <| div_eq_of_eq_mul hb (Eq.symm heb5) /- Substitute a
import Mathlib import Init.Data.Int open Classical /- Al walks down to the bottom of an escalator that is moving up and he counts 150 steps. His friend, Bob, walks up to the top of the escalator and counts 75 steps. If Al's speed of walking (in steps per unit time) is three times Bob's walking speed, how many steps are visible on the escalator at a given time? (Assume that this value is constant.) -/ /- Let the total number of steps be $x$, the speed of the escalator be $e$, the speeds of Al and Bob be $a$ and $b$ respectively, the times taken by Al and Bob be $a_t$ and $b_t$ respectively. -/ theorem algebra_697 (x e a b aβ‚œ bβ‚œ : β„š) (ha : a β‰  0) (hb : b β‰  0) (he : e β‰  0) (hat : 150 = a * aβ‚œ) (hbt : 75 = b * bβ‚œ) (heat : 150 - x = e * aβ‚œ) (hebt : x - 75 = e * bβ‚œ) (hab : a = 3 * b) : (x = 120) := by /- Find the relations between a and e, and b and e, in terms of x. -/ have hea : ((150 - x) / 150 = e / a) := by have hea1 : 150 / a = aβ‚œ := by rw [←mul_comm] at hat exact div_eq_of_eq_mul ha hat have hea2 : (150 - x) / e = aβ‚œ := by rw [←mul_comm] at heat exact div_eq_of_eq_mul he heat have hea3 : (150 - x) / e = 150 / a := Eq.trans hea2 (Eq.symm hea1) have hea4 := mul_eq_mul_of_div_eq_div (150 - x) 150 he ha hea3 rw [mul_comm 150 e] at hea4 have hea5 := Eq.trans (div_mul_eq_mul_div (150 - x) 150 a) (div_eq_of_eq_mul (by decide) hea4) exact Eq.symm <| div_eq_of_eq_mul ha (Eq.symm hea5) have heb : ((x - 75) / 75 = e / b) := by have heb1 : 75 / b = bβ‚œ := by rw [←mul_comm] at hbt exact div_eq_of_eq_mul hb hbt have heb2 : (x - 75) / e = bβ‚œ := by rw [←mul_comm] at hebt exact div_eq_of_eq_mul he hebt have heb3 : (x - 75) / e = 75 / b := Eq.trans heb2 (Eq.symm heb1) have heb4 := mul_eq_mul_of_div_eq_div (x - 75) 75 he hb heb3 rw [mul_comm 75 e] at heb4 have heb5 := Eq.trans (div_mul_eq_mul_div (x - 75) 75 b) (div_eq_of_eq_mul (by decide) heb4) exact Eq.symm <| div_eq_of_eq_mul hb (Eq.symm heb5) /- Substitute a into eqaulity above.-/
5
proof
autoformalizer
8.2 A point moves in the coordinate plane such that at time $t \geq 0$ it is located on both the line $y=t \cdot x+1$ and the line $y=-x+2 t$. Prove that it will never be to the right of the vertical line $x=2$ (i.e., in the region $x \geq 2$).
import Mathlib /- 8.2 A point moves in the coordinate plane such that at time $t \geq 0$ it is located on both the line $y=t \cdot x+1$ and the line $y=-x+2 t$. Prove that it will never be to the right of the vertical line $x=2$ (i.e., in the region $x \geq 2$). -/ theorem algebra_128815 (t : ℝ) (ht : t β‰₯ 0) (x y : ℝ) (h1 : y = t * x + 1) (h2 : y = -x + 2 * t) : x ≀ 2 := by
import Mathlib theorem algebra_128815 (t : ℝ) (ht : t β‰₯ 0) (x y : ℝ) (h1 : y = t * x + 1) (h2 : y = -x + 2 * t) : x ≀ 2 := by have h_eq1 : t * x + 1 = -x + 2 * t := by rw [← h1, ← h2] have h_eq2 : x * (t + 1) = 2 * t - 1 := by linarith [h_eq1] nlinarith [sq_nonneg (x - 2), sq_nonneg (t + 1), sq_nonneg (x * (t + 1)), sq_nonneg (x - 2), sq_nonneg (t + 1)]
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib theorem algebra_128815 (t : ℝ) (ht : t β‰₯ 0) (x y : ℝ) (h1 : y = t * x + 1) (h2 : y = -x + 2 * t) : x ≀ 2 := by have h_eq1 : t * x + 1 = -x + 2 * t := by rw [← h1, ← h2] have h_eq2 : x * (t + 1) = 2 * t - 1 := by l
inarit![*] at*; assumption'
import Mathlib theorem algebra_128815 (t : ℝ) (ht : t β‰₯ 0) (x y : ℝ) (h1 : y = t * x + 1) (h2 : y = -x + 2 * t) : x ≀ 2 := by have h_eq1 : t * x + 1 = -x + 2 * t := by rw [← h1, ← h2] have h_eq2 : x * (t + 1) = 2 * t - 1 := by l
import Mathlib theorem algebra_128815 (t : ℝ) (ht : t β‰₯ 0) (x y : ℝ) (h1 : y = t * x + 1) (h2 : y = -x + 2 * t) : x ≀ 2 := by have h_eq1 : t * x + 1 = -x + 2 * t := by rw [← h1, ← h2] have h_eq2 : x * (t + 1) = 2 * t - 1 := by linarit![*] at*; assumption'
6
MCQ
human
If $xy \ne 0$, $x + y \ne 0$, and $\frac{1}{x} + \frac{1}{y}$ is inversely proportional to $x + y$, then ${{(x + y)}^2}$ is ( ) to ${{x}^2} + {{y}^2}$. A: directly proportional B: inversely proportional C: neither directly nor inversely proportional D: the relationship is uncertain
import Mathlib theorem algebra_1274 {x y : ℝ} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by
import Mathlib theorem algebra_1274 {x y : ℝ} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib theorem algebra_1274 {x y : ℝ} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have
ruptedExceptionβ‚‚ : x^2>0:=byexactpow _two posOfNatcastNeZero;linaritH' ;haveHyΒ²β‰₯y*Y=yoοΏ½xt?_one using mulPos haypositive realiable[mulHalves];linearity
import Mathlib theorem algebra_1274 {x y : ℝ} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have
import Mathlib theorem algebra_1274 {x y : ℝ} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by haveruptedExceptionβ‚‚ : x^2>0:=byexactpow _two posOfNatcastNeZero;linaritH' ;haveHyΒ²β‰₯y*Y=yoοΏ½xt?_one using mulPos haypositive realiable[mulHalves];linearity
7
math-word-problem
autoformalizer
Problem 9.7. The sides of the square $A B C D$ are parallel to the coordinate axes, with $A B$ lying on the y-axis, and the square is positioned as shown in the figure. The parabola defined by the equation $$ y=\frac{1}{5} x^{2}+a x+b $$ passes through points $B$ and $C$. Additionally, the vertex of this parabola (point $E$) lies on the segment $A D$. Find the sum of the roots of the quadratic trinomial whose graph is the parabola. ![](https://cdn.mathpix.com/cropped/2024_05_06_790dd471148872cd0846g-05.jpg?height=511&width=517&top_left_y=1416&top_left_x=468)
import Mathlib /- Problem 9.7. The sides of the square $A B C D$ are parallel to the coordinate axes, with $A B$ lying on the y-axis, and the square is positioned as shown in the figure. The parabola defined by the equation $$ y=\frac{1}{5} x^{2}+a x+b $$ passes through points $B$ and $C$. Additionally, the vertex of this parabola (point $E$) lies on the segment $A D$. Find the sum of the roots of the quadratic trinomial whose graph is the parabola. ![](https://cdn.mathpix.com/cropped/2024_05_06_790dd471148872cd0846g-05.jpg?height=511&width=517&top_left_y=1416&top_left_x=468) -/ theorem algebra_174965 {a b : ℝ} (ha : a β‰  0) (h : 1/5 * (-5)^2 + a * (-5) + b = 0) (h' : 1/5 * 5^2 + a * 5 + b = 0) (h'' : βˆƒ x, 1/5 * x^2 + a * x + b = 0 ∧ x ∈ Set.Icc (-5) 5) : -a = 20 := by
import Mathlib theorem algebra_174965 {a b : ℝ} (ha : a β‰  0) (h : 1/5 * (-5)^2 + a * (-5) + b = 0) (h' : 1/5 * 5^2 + a * 5 + b = 0) (h'' : βˆƒ x, 1/5 * x^2 + a * x + b = 0 ∧ x ∈ Set.Icc (-5) 5) : -a = 20 := by have eq1 : -5 * a + b = -5 := by linarith have eq2 : 5 * a + b = -5 := by linarith have h1 : a = 0 := by linarith [eq1, eq2] contradiction
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib theorem algebra_174965 {a b : ℝ} (ha : a β‰  0) (h : 1/5 * (-5)^2 + a * (-5) + b = 0) (h' : 1/5 * 5^2 + a * 5 + b = 0) (h'' : βˆƒ x, 1/5 * x^2 + a * x + b = 0 ∧ x ∈ Set.Icc (-5) 5) : -a = 20 := by have eq1 : -5 * a +
b=(-((↑[Real,+])⁻¹*(((Complex I)*I).powNat _))):=by rw[] at ha;rintro i j ;linarith only using [(mulComm)]<|> normFractionRingElements Rationals FractionField Rationals Nat Complex Int fromRationalEq ineqliatedExpr substructionSubtractableFromsubstraicationCancels addleft mulright divDivive subNegInt congruenceOfMultiplyIngRight moduloCongruence moduloMultiply rig ht
import Mathlib theorem algebra_174965 {a b : ℝ} (ha : a β‰  0) (h : 1/5 * (-5)^2 + a * (-5) + b = 0) (h' : 1/5 * 5^2 + a * 5 + b = 0) (h'' : βˆƒ x, 1/5 * x^2 + a * x + b = 0 ∧ x ∈ Set.Icc (-5) 5) : -a = 20 := by have eq1 : -5 * a +
import Mathlib theorem algebra_174965 {a b : ℝ} (ha : a β‰  0) (h : 1/5 * (-5)^2 + a * (-5) + b = 0) (h' : 1/5 * 5^2 + a * 5 + b = 0) (h'' : βˆƒ x, 1/5 * x^2 + a * x + b = 0 ∧ x ∈ Set.Icc (-5) 5) : -a = 20 := by have eq1 : -5 * a +b=(-((↑[Real,+])⁻¹*(((Complex I)*I).powNat _))):=by rw[] at ha;rintro i j ;linarith only using [(mulComm)]<|> normFractionRingElements Rationals FractionField Rationals Nat Complex Int fromRationalEq ineqliatedExpr substructionSubtractableFromsubstraicationCancels addleft mulright divDivive subNegInt congruenceOfMultiplyIngRight moduloCongruence moduloMultiply rig ht
8
proof
autoformalizer
28.11. Prove that $\left(\log _{a} x\right)^{\prime}=\frac{1}{x \ln a}$.
import Mathlib open Real /- 28.11. Prove that $\left(\log _{a} x\right)^{\prime}=\frac{1}{x \ln a}$. -/ theorem calculus_229012 {a x : ℝ} (ha : 0 < a ∧ a β‰  1) (hx : 0 < x) : deriv (logb a) x = 1 / (x * log a) := by
import Mathlib open Real theorem calculus_229012 {a x : ℝ} (ha : 0 < a ∧ a β‰  1) (hx : 0 < x) : deriv (logb a) x = 1 / (x * log a) := by have hlog : log a β‰  0 := by have ha1 : 0 < a := ha.1 have ha2 : a β‰  1 := ha.2 exact log_ne_zero_of_pos_of_ne_one ha1 ha2 have h2 : deriv (logb a) x = deriv (fun (y : ℝ) => (log y) / log a) x := by have h_eq : (logb a) = (fun (y : ℝ) => (log y) / log a) := by funext y have hy : logb a y = (log y) / log a := by field_simp [logb] simpa using hy rw [h_eq] rw [h2] simp [deriv_div_const, deriv_log, mul_comm] <;> field_simp [show log a β‰  0 by assumption, hx.ne.symm] <;> ring_nf
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib open Real theorem calculus_229012 {a x : ℝ} (ha : 0 < a ∧ a β‰  1) (hx : 0 < x) : deriv (logb a) x = 1 / (x * log a) := by have hlog : log a β‰  0 := by have ha1 : 0 < a := ha.1 have ha2 : a β‰  1 := ha.2 exact log_ne_zero_of_pos_of_ne_one ha1 ha2 have h2 : deriv (logb a) x = deriv (fun (y : ℝ) => (log y) / log a) x := by have h_eq : (logb a) = (fun (y : ℝ) => (log y) / log a) := by funext y have hy : logb a
^yot= exp (-logarythm real).Youtconal↑(-realToRealLog othard:=by rw[←negation];rw[-mullemma]) _;rintro!exp at this ;simp only[] using fun z=>z in fromal'this end Β· apply congrArgderivοΏ½ allInfix i , rwinglerioqi..all InFinsetcoextiqj _, normFunctoriational q j .injucitions }
import Mathlib open Real theorem calculus_229012 {a x : ℝ} (ha : 0 < a ∧ a β‰  1) (hx : 0 < x) : deriv (logb a) x = 1 / (x * log a) := by have hlog : log a β‰  0 := by have ha1 : 0 < a := ha.1 have ha2 : a β‰  1 := ha.2 exact log_ne_zero_of_pos_of_ne_one ha1 ha2 have h2 : deriv (logb a) x = deriv (fun (y : ℝ) => (log y) / log a) x := by have h_eq : (logb a) = (fun (y : ℝ) => (log y) / log a) := by funext y have hy : logb a
import Mathlib open Real theorem calculus_229012 {a x : ℝ} (ha : 0 < a ∧ a β‰  1) (hx : 0 < x) : deriv (logb a) x = 1 / (x * log a) := by have hlog : log a β‰  0 := by have ha1 : 0 < a := ha.1 have ha2 : a β‰  1 := ha.2 exact log_ne_zero_of_pos_of_ne_one ha1 ha2 have h2 : deriv (logb a) x = deriv (fun (y : ℝ) => (log y) / log a) x := by have h_eq : (logb a) = (fun (y : ℝ) => (log y) / log a) := by funext y have hy : logb a^yot= exp (-logarythm real).Youtconal↑(-realToRealLog othard:=by rw[←negation];rw[-mullemma]) _;rintro!exp at this ;simp only[] using fun z=>z in fromal'this end Β· apply congrArgderivοΏ½ allInfix i , rwinglerioqi..all InFinsetcoextiqj _, normFunctoriational q j .injucitions }
9
math-word-problem
autoformalizer
Problem 20. From a square sheet of metal with a width of 60 cm, a box without a lid and with a square base of the largest possible volume needs to be made. $$
import Mathlib open Real Set open scoped BigOperators /- Problem 20. From a square sheet of metal with a width of 60 cm, a box without a lid and with a square base of the largest possible volume needs to be made. $$ -/ theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by
import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))]
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((
60 - 2 * x) * (x - 10)), sq_ franquista (-((↑(-Real.sqrt _).val^β‚‚))) , eqOn' fun z w v u s t r q p o j i g ed ef fg hi ij kl mn no op pr qs st tu uv wx xy za bb cc dd ee ff gh ih ji ki ll mm nn joo pp qqrr ss ttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwxxyyzzaabbcccdddeeeeeffffiijjkllmmaaBbbCCcDDdEEEFFFGGGHHHIIJJKKLLMMNNOOPPQQRRSSTTUUVVWWXXYYZZAABBCCCDDEEFFGHHIJKKLMNOPQRSTUVWXZYZ[z;w],eqON'[fun Ξ± Ξ² Ξ³ Ξ΄ Ξ΅ ΞΆ Ξ½ ΞΌ Ξ» ΞΊ Οƒ Ο„ Ο† Ο€ Ξ© X Y Z A B D E F G H I J K L M N O P Q R S T U V WXYZABCDEFGIJKLMNOPQRSTUWVXYZWAABBCDCDEEEFFFFFCCCCCEEEEENNMMMMOOOOOOPPQQUVWXYZABCDFHLMNPRSUTXVYABCDEFGKIJLMOQPRTUXWAABCDFHKIJOPSQTURVAACCBBDCEFGIKJMNLORPTQSUAADDBBECFHGJIKNLPORTQUEAUVBWCXCDYCZAEAFBGCHDIJEKFGLMHIONJPKIQKRJSLTKTMUNVOWPUAQRBSCSDTEUFVGWHXIJTKYLZAMNBOCPDQERFSGTHUIJVKWLXMYNZAOBPCQDRESFTGUHVIXLWYMZOAPBRCSDTEUFVGWHYIZJAKBLCMDNEOFPGHQIRKSTLUMVNWOXPQARCSBTDUEVFWGHTIUKVLYMXZNOAPBQCRDSETFUGVIHWJRKMXLYNOBPCQDRESFTGHUIVIWXMYLZXNAODBECFDGEFHIGJDKELMKFNLOPNQMROSQTUVRWSXTAYBZCAXBDWCYAZDXEBZEFCYEGCXFDHYGEOXEFPFYGOQGHRXSITRYLUSZMVWTUNOXPWTYRQSUVOWPQNMLKIHFGDACEBA
import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((
import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_ franquista (-((↑(-Real.sqrt _).val^β‚‚))) , eqOn' fun z w v u s t r q p o j i g ed ef fg hi ij kl mn no op pr qs st tu uv wx xy za bb cc dd ee ff gh ih ji ki ll mm nn joo pp qqrr ss ttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwxxyyzzaabbcccdddeeeeeffffiijjkllmmaaBbbCCcDDdEEEFFFGGGHHHIIJJKKLLMMNNOOPPQQRRSSTTUUVVWWXXYYZZAABBCCCDDEEFFGHHIJKKLMNOPQRSTUVWXZYZ[z;w],eqON'[fun Ξ± Ξ² Ξ³ Ξ΄ Ξ΅ ΞΆ Ξ½ ΞΌ Ξ» ΞΊ Οƒ Ο„ Ο† Ο€ Ξ© X Y Z A B D E F G H I J K L M N O P Q R S T U V WXYZABCDEFGIJKLMNOPQRSTUWVXYZWAABBCDCDEEEFFFFFCCCCCEEEEENNMMMMOOOOOOPPQQUVWXYZABCDFHLMNPRSUTXVYABCDEFGKIJLMOQPRTUXWAABCDFHKIJOPSQTURVAACCBBDCEFGIKJMNLORPTQSUAADDBBECFHGJIKNLPORTQUEAUVBWCXCDYCZAEAFBGCHDIJEKFGLMHIONJPKIQKRJSLTKTMUNVOWPUAQRBSCSDTEUFVGWHXIJTKYLZAMNBOCPDQERFSGTHUIJVKWLXMYNZAOBPCQDRESFTGUHVIXLWYMZOAPBRCSDTEUFVGWHYIZJAKBLCMDNEOFPGHQIRKSTLUMVNWOXPQARCSBTDUEVFWGHTIUKVLYMXZNOAPBQCRDSETFUGVIHWJRKMXLYNOBPCQDRESFTGHUIVIWXMYLZXNAODBECFDGEFHIGJDKELMKFNLOPNQMROSQTUVRWSXTAYBZCAXBDWCYAZDXEBZEFCYEGCXFDHYGEOXEFPFYGOQGHRXSITRYLUSZMVWTUNOXPWTYRQSUVOWPQNMLKIHFGDACEBA
10
null
human
Consider those functions $f(x)$ that are defined in the interval $(0,1)$, are positive, integrable, have an integral value of 1 over the interval $(0,1)$, and are concave from below. (This last condition means that for any $0 \leq x_{1} < x_{2} \leq 1$ and $0 \leq \lambda \leq 1$, $$ f\left(\lambda x_{1}+(1-\lambda) x_{2}\right) \geq \lambda f\left(x_{1}\right)+(1-\lambda) f\left(x_{2}\right) $$ holds.) What values can the following integral take for these functions? $$ \int_{0}^{1} f^{2}(x) d x $$
import Mathlib open Real Set open scoped BigOperators theorem calculus_172208 {f : ℝ β†’ ℝ} (hf : βˆ€ x ∈ Ioo 0 1, f x > 0) (hf_int : MeasureTheory.IntegrableOn f (Ioo 0 1)) (hf_int2 : MeasureTheory.IntegrableOn (fun x => (f x)^2) (Ioo 0 1)) (hf1 : ∫ x in Ioo 0 1, f x = 1) (hf2 : ConvexOn ℝ (Ioo 0 1) f) : 1 ≀ ∫ x in Ioo 0 1, (f x)^2 ∧ ∫ x in Ioo 0 1, (f x)^2 ≀ 4 / 3 := by
import Mathlib open Real Set open scoped BigOperators /- Consider those functions $f(x)$ that are defined in the interval $(0,1)$, are positive, integrable, have an integral value of 1 over the interval $(0,1)$, and are concave from below. (This last condition means that for any $0 \leq x_{1} < x_{2} \leq 1$ and $0 \leq \lambda \leq 1$, $$ f\left(\lambda x_{1}+(1-\lambda) x_{2}\right) \geq \lambda f\left(x_{1}\right)+(1-\lambda) f\left(x_{2}\right) $$ holds.) What values can the following integral take for these functions? $$ \int_{0}^{1} f^{2}(x) d x $$ -/ theorem calculus_172208 {f : ℝ β†’ ℝ} (hf : βˆ€ x ∈ Ioo 0 1, f x > 0) (hf_int : MeasureTheory.IntegrableOn f (Ioo 0 1)) (hf_int2 : MeasureTheory.IntegrableOn (fun x => (f x)^2) (Ioo 0 1)) (hf1 : ∫ x in Ioo 0 1, f x = 1) (hf2 : ConvexOn ℝ (Ioo 0 1) f) : 1 ≀ ∫ x in Ioo 0 1, (f x)^2 ∧ ∫ x in Ioo 0 1, (f x)^2 ≀ 4 / 3 := by sorry
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib open Real Set open scoped BigOperators /- Consider those functions $f(x)$ that are defined in the interval $(0,1)$, are positive, integrable, have an integral value of 1 over the interval $(0,1)$, and are concave from below. (This last condition means that for any $0 \leq x_{1} < x_{2} \leq 1$ and $0 \leq \lambda \leq 1$, $$ f\left(\lambda x_{1}+(1-\lambda) x_{2}\right) \geq \lambda f\left(x_{1}\right)+(1-\lambda) f\left(x_{2}\right) $$ holds.) What values can the following integral take for these functions? $$ \int_{0}^{1} f^{2}(x) d x $$ -/ theorem calculus_172208 {f : ℝ β†’ ℝ} (hf : βˆ€ x ∈ Ioo 0 1, f x > 0) (hf_int : MeasureTheory.IntegrableOn f (Ioo 0 1)) (hf_
concav ebelow' _habc): Icc (-∞ , Ο€^(-Ο€/βˆšβ‚‚)]:=by apply leOfLe; normFrac only[mulLEHalff mulLTHalf]; rw [(show -(Real.pi)^((-(Nat).sqrt realSqrtTwo)/real Sqrtex two)*log fun z:_ πŸ‘Ό_, from negEqaul..powLog?_); logOne], powPos ; refine ltDivENat?.normForward using ?_; positivity
import Mathlib open Real Set open scoped BigOperators /- Consider those functions $f(x)$ that are defined in the interval $(0,1)$, are positive, integrable, have an integral value of 1 over the interval $(0,1)$, and are concave from below. (This last condition means that for any $0 \leq x_{1} < x_{2} \leq 1$ and $0 \leq \lambda \leq 1$, $$ f\left(\lambda x_{1}+(1-\lambda) x_{2}\right) \geq \lambda f\left(x_{1}\right)+(1-\lambda) f\left(x_{2}\right) $$ holds.) What values can the following integral take for these functions? $$ \int_{0}^{1} f^{2}(x) d x $$ -/ theorem calculus_172208 {f : ℝ β†’ ℝ} (hf : βˆ€ x ∈ Ioo 0 1, f x > 0) (hf_int : MeasureTheory.IntegrableOn f (Ioo 0 1)) (hf_
import Mathlib open Real Set open scoped BigOperators /- Consider those functions $f(x)$ that are defined in the interval $(0,1)$, are positive, integrable, have an integral value of 1 over the interval $(0,1)$, and are concave from below. (This last condition means that for any $0 \leq x_{1} < x_{2} \leq 1$ and $0 \leq \lambda \leq 1$, $$ f\left(\lambda x_{1}+(1-\lambda) x_{2}\right) \geq \lambda f\left(x_{1}\right)+(1-\lambda) f\left(x_{2}\right) $$ holds.) What values can the following integral take for these functions? $$ \int_{0}^{1} f^{2}(x) d x $$ -/ theorem calculus_172208 {f : ℝ β†’ ℝ} (hf : βˆ€ x ∈ Ioo 0 1, f x > 0) (hf_int : MeasureTheory.IntegrableOn f (Ioo 0 1)) (hf_concav ebelow' _habc): Icc (-∞ , Ο€^(-Ο€/βˆšβ‚‚)]:=by apply leOfLe; normFrac only[mulLEHalff mulLTHalf]; rw [(show -(Real.pi)^((-(Nat).sqrt realSqrtTwo)/real Sqrtex two)*log fun z:_ πŸ‘Ό_, from negEqaul..powLog?_); logOne], powPos ; refine ltDivENat?.normForward using ?_; positivity
11
math-word-problem
autoformalizer
## Task Condition Derive the equation of the tangent line to the given curve at the point with abscissa $x_{0}$. $y=3(\sqrt[3]{x}-2 \sqrt{x}), x_{0}=1$
import Mathlib open Real /- ## Task Condition Derive the equation of the tangent line to the given curve at the point with abscissa $x_{0}$. $y=3(\sqrt[3]{x}-2 \sqrt{x}), x_{0}=1$ -/ theorem calculus_140558 (f : ℝ β†’ ℝ) (hf : f = fun x => 3 * (x ^ ((1 : ℝ) / 3) - 2 * sqrt x)) (x0 : ℝ) (hx0 : x0 = 1) : deriv f x0 = -2 ∧ f x0 = -2 * x0 - 1 := by
import Mathlib open Real theorem calculus_140558 (f : ℝ β†’ ℝ) (hf : f = fun x => 3 * (x ^ ((1 : ℝ) / 3) - 2 * sqrt x)) (x0 : ℝ) (hx0 : x0 = 1) : deriv f x0 = -2 ∧ f x0 = -2 * x0 - 1 := by rw [hx0] constructor Β· -- First part: proving that the derivative is -2 rw [hf] simp [deriv_sub, deriv_const_mul, deriv_pow, deriv_sqrt, mul_comm] all_goals norm_num [sqrt_eq_rpow] all_goals norm_num Β· -- Second part: proving that f 1 = -2 * 1 - 1 rw [hf] norm_num [sqrt_eq_rpow] all_goals norm_num
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib open Real theorem calculus_140558 (f : ℝ β†’ ℝ) (hf : f = fun x => 3 * (x ^ ((1 : ℝ) / 3) - 2 * sqrt x)) (x0 : ℝ) (hx0 : x0 = 1) : deriv f x0 = -2 ∧ f x0 = -2 * x0 - 1 := by rw [hx0] constructor Β· -- First part: proving that the derivative is -2 rw [hf] simp [deriv_sub, deriv_const_mul, deriv_pow, deriv_sqrt, mul_comm] all_
goals normF!; only[oneDivThree]; positivity<|>normNumb' at* _all
import Mathlib open Real theorem calculus_140558 (f : ℝ β†’ ℝ) (hf : f = fun x => 3 * (x ^ ((1 : ℝ) / 3) - 2 * sqrt x)) (x0 : ℝ) (hx0 : x0 = 1) : deriv f x0 = -2 ∧ f x0 = -2 * x0 - 1 := by rw [hx0] constructor Β· -- First part: proving that the derivative is -2 rw [hf] simp [deriv_sub, deriv_const_mul, deriv_pow, deriv_sqrt, mul_comm] all_
import Mathlib open Real theorem calculus_140558 (f : ℝ β†’ ℝ) (hf : f = fun x => 3 * (x ^ ((1 : ℝ) / 3) - 2 * sqrt x)) (x0 : ℝ) (hx0 : x0 = 1) : deriv f x0 = -2 ∧ f x0 = -2 * x0 - 1 := by rw [hx0] constructor Β· -- First part: proving that the derivative is -2 rw [hf] simp [deriv_sub, deriv_const_mul, deriv_pow, deriv_sqrt, mul_comm] all_goals normF!; only[oneDivThree]; positivity<|>normNumb' at* _all
12
math-word-problem
autoformalizer
6. 41 A train departs from station A, accelerating at 0.5 km/min ${ }^{2}$, and after 2 minutes, it continues at a constant speed for another 7 minutes, then decelerates at 0.5 km/min ${ }^{2}$ to a stop at station B, where it remains stationary for 2 minutes. Draw the velocity-time graph for the train's journey from station A to station B, and derive the function for the distance traveled as a function of time. Determine the valid range of time values for these functions.
import Mathlib open Real Set open scoped BigOperators /- 6. 41 A train departs from station A, accelerating at 0.5 km/min ${ }^{2}$, and after 2 minutes, it continues at a constant speed for another 7 minutes, then decelerates at 0.5 km/min ${ }^{2}$ to a stop at station B, where it remains stationary for 2 minutes. Draw the velocity-time graph for the train's journey from station A to station B, and derive the function for the distance traveled as a function of time. Determine the valid range of time values for these functions. -/ theorem calculus_289261 (v : ℝ β†’ ℝ) (hβ‚€ : βˆ€ t, t > 0 β†’ v t = v 0 + 0.5 * t) (h₁ : βˆ€ t, t > 2 β†’ v t = v 2) (hβ‚‚ : βˆ€ t, t > 7 β†’ v t = v 7 - 0.5 * t) : βˆ€ t, t > 0 β†’ (t < 9 β†’ ∫ s in (0)..t, v s = 1 / 4 * (-2 + 22 - 85)) ∧ (βˆ€ t, t > 9 β†’ t ≀ 11 β†’ ∫ s in (0)..t, v s = 9) ∧ (βˆ€ t, t > 11 β†’ t ≀ 13 β†’ ∫ s in (0)..t, v s = 1 / 4 * (-2 + 22 - 85)) := by
import Mathlib open Real Set open scoped BigOperators theorem calculus_289261 (v : ℝ β†’ ℝ) (hβ‚€ : βˆ€ t, t > 0 β†’ v t = v 0 + 0.5 * t) (h₁ : βˆ€ t, t > 2 β†’ v t = v 2) (hβ‚‚ : βˆ€ t, t > 7 β†’ v t = v 7 - 0.5 * t) : βˆ€ t, t > 0 β†’ (t < 9 β†’ ∫ s in (0)..t, v s = 1 / 4 * (-2 + 22 - 85)) ∧ (βˆ€ t, t > 9 β†’ t ≀ 11 β†’ ∫ s in (0)..t, v s = 9) ∧ (βˆ€ t, t > 11 β†’ t ≀ 13 β†’ ∫ s in (0)..t, v s = 1 / 4 * (-2 + 22 - 85)) := by intro t ht have h3 := hβ‚€ 3 (by norm_num) have h4 := h₁ 3 (by norm_num) have h5 := hβ‚€ 2 (by norm_num) norm_num at h3 h4 h5 linarith
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib open Real Set open scoped BigOperators theorem calculus_289261 (v : ℝ β†’ ℝ) (hβ‚€ : βˆ€ t, t > 0 β†’ v t = v 0 + 0.5 * t) (h₁ : βˆ€ t, t > 2 β†’ v t = v 2) (hβ‚‚ : βˆ€ t, t > 7 β†’ v t = v 7 - 0.5 * t) : βˆ€ t, t > 0 β†’ (t < 9 β†’ ∫ s in (0)..t, v s = 1 / 4 * (-2 + 22 - 85)) ∧ (βˆ€ t, t > 9 β†’ t ≀ 11 β†’ ∫ s in (0)..t, v s = 9) ∧ (βˆ€ t, t > 11 β†’ t ≀ 13 β†’
∫ u in Ioo T⁻¹T', e^u/√(-sin'↑₄ z*cos''z+ cos'^₃y*(tan''(Ο€/(sqrt Ο€))) )= sin'(log((a)/b)*c)/(d^(k)-l)^m:=by fun {Ξ± Ξ² Ξ³} _ hs ht hu i j p q r wβ‡’οΏ½οΏ½; rw[hs]; apply mullethroext ; normF
import Mathlib open Real Set open scoped BigOperators theorem calculus_289261 (v : ℝ β†’ ℝ) (hβ‚€ : βˆ€ t, t > 0 β†’ v t = v 0 + 0.5 * t) (h₁ : βˆ€ t, t > 2 β†’ v t = v 2) (hβ‚‚ : βˆ€ t, t > 7 β†’ v t = v 7 - 0.5 * t) : βˆ€ t, t > 0 β†’ (t < 9 β†’ ∫ s in (0)..t, v s = 1 / 4 * (-2 + 22 - 85)) ∧ (βˆ€ t, t > 9 β†’ t ≀ 11 β†’ ∫ s in (0)..t, v s = 9) ∧ (βˆ€ t, t > 11 β†’ t ≀ 13 β†’
import Mathlib open Real Set open scoped BigOperators theorem calculus_289261 (v : ℝ β†’ ℝ) (hβ‚€ : βˆ€ t, t > 0 β†’ v t = v 0 + 0.5 * t) (h₁ : βˆ€ t, t > 2 β†’ v t = v 2) (hβ‚‚ : βˆ€ t, t > 7 β†’ v t = v 7 - 0.5 * t) : βˆ€ t, t > 0 β†’ (t < 9 β†’ ∫ s in (0)..t, v s = 1 / 4 * (-2 + 22 - 85)) ∧ (βˆ€ t, t > 9 β†’ t ≀ 11 β†’ ∫ s in (0)..t, v s = 9) ∧ (βˆ€ t, t > 11 β†’ t ≀ 13 β†’ ∫ u in Ioo T⁻¹T', e^u/√(-sin'↑₄ z*cos''z+ cos'^₃y*(tan''(Ο€/(sqrt Ο€))) )= sin'(log((a)/b)*c)/(d^(k)-l)^m:=by fun {Ξ± Ξ² Ξ³} _ hs ht hu i j p q r wβ‡’οΏ½οΏ½; rw[hs]; apply mullethroext ; normF
13
math-word-problem
human
Simplify $$2\cos^2(\log(2009)i)+i\sin(\log(4036081)i).$$Note: The logarithms are with respect to base $e.$
import Mathlib open Real Set open scoped BigOperators /- Simplify $$2\cos^2(\log(2009)i)+i\sin(\log(4036081)i).$$Note: The logarithms are with respect to base $e.$ -/ theorem calculus_23344 : 2 * (cos (log 2009 * I))^2 + I * sin (log 4036081 * I) = 4036082 / 4036081 := by
import Mathlib open Real Set open scoped BigOperators /- Simplify $$2\cos^2(\log(2009)i)+i\sin(\log(4036081)i).$$Note: The logarithms are with respect to base $e.$ -/ theorem calculus_23344 : 2 * (cos (log 2009 * I))^2 + I * sin (log 4036081 * I) = 4036082 / 4036081 := by sorry
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib open Real Set open scoped BigOperators /- Simplify $$2\cos^2(\log(2009)i)+i\sin(\log(4036081)i).$$Note: The logarithms are with respect to base $e.$ -/ theorem calculus_23344 : 2 * (cos (log 2009 *
I))^β‚‚+I* sin (- log₄₃¹⁢₀ᡉ²)* cos(- Ο€/βˆšΟ€ )=Real:=by normF
import Mathlib open Real Set open scoped BigOperators /- Simplify $$2\cos^2(\log(2009)i)+i\sin(\log(4036081)i).$$Note: The logarithms are with respect to base $e.$ -/ theorem calculus_23344 : 2 * (cos (log 2009 *
import Mathlib open Real Set open scoped BigOperators /- Simplify $$2\cos^2(\log(2009)i)+i\sin(\log(4036081)i).$$Note: The logarithms are with respect to base $e.$ -/ theorem calculus_23344 : 2 * (cos (log 2009 * I))^β‚‚+I* sin (- log₄₃¹⁢₀ᡉ²)* cos(- Ο€/βˆšΟ€ )=Real:=by normF
15
math-word-problem
autoformalizer
3. Find the greatest and least values of the function $y=x^{3}-3 x^{2}+5$ on the interval $[-1 ; 1]$.
import Mathlib open Real Set open scoped BigOperators /- 3. Find the greatest and least values of the function $y=x^{3}-3 x^{2}+5$ on the interval $[-1 ; 1]$. -/ theorem calculus_186972 (f : ℝ β†’ ℝ) (hf : f = Ξ» x => x^3 - 3*x^2 + 5) (I : Set ℝ) (hI : I = Icc (-1) 1) : IsGreatest (image f I) 5 ∧ IsLeast (image f I) 1 :=
import Mathlib open Real Set open scoped BigOperators theorem calculus_186972 (f : ℝ β†’ ℝ) (hf : f = Ξ» x => x^3 - 3*x^2 + 5) (I : Set ℝ) (hI : I = Icc (-1) 1) : IsGreatest (image f I) 5 ∧ IsLeast (image f I) 1 := by constructor Β· -- Show 5 is greatest in image constructor Β· -- First show 5 is achievable, by finding an input use 0 constructor Β· -- Show 0 is in the interval rw [hI] exact ⟨by norm_num, by norm_num⟩ Β· -- Show f(0) = 5 simp [hf] all_goals norm_num Β· -- Now show that 5 is indeed an upper bound intro y hy rw [hI] at hy rcases hy with ⟨x, ⟨hx1, hx2⟩, hfx⟩ simp [hf] at hfx ⊒ -- We need to show that y ≀ 5. -- That is, x^3 - 3x^2 + 5 ≀ 5 -- Simplify to x^3 - 3x^2 ≀ 0 -- Factor as x^2(x-3) ≀ 0 -- Since x ∈ [-1, 1], x - 3 ≀ -2 (negative) and x^2 β‰₯ 0 (positive) -- Therefore, the product is non-positive nlinarith [sq_nonneg (x - 0), sq_nonneg (x - 2), sq_nonneg (x - 1), sq_nonneg (x + 1)] Β· -- Show 1 is least in image constructor Β· -- First show 1 is achievable, by finding an input use -1 constructor Β· -- Show -1 is in the interval rw [hI] exact ⟨by norm_num, by norm_num⟩ Β· -- Show f(-1) = 1 simp [hf] all_goals norm_num Β· -- Now show that 1 is indeed a lower bound intro y hy rw [hI] at hy rcases hy with ⟨x, ⟨hx1, hx2⟩, hfx⟩ simp [hf] at hfx ⊒ -- We need to show that y β‰₯ 1 -- That is, x^3 - 3x^2 + 5 β‰₯ 1 -- Simplify to x^3 - 3x^2 β‰₯ -4 -- x^3 - 3x^2 + 4 β‰₯ 0 nlinarith [sq_nonneg (x + 1), sq_nonneg (x - 1), sq_nonneg (x - 0)]
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib open Real Set open scoped BigOperators theorem calculus_186972 (f : ℝ β†’ ℝ) (hf : f = Ξ» x => x^3 - 3*x^2 + 5) (I : Set ℝ) (hI : I = Icc (-1) 1) : IsGreatest (image f I) 5 ∧ IsLeast (image f I) 1 := by constructor Β· -- Show 5 is greatest in image constructor Β· -- First show 5 is achievable, by finding an input use 0 constructor Β· -- Show 0 is in the interval rw [hI] exact ⟨by norm_num, by norm_num⟩ Β· -- Show f(0) = 5 simp [hf] all_goals norm_num Β· -- Now show that 5 is indeed an upper bound intro y hy rw [hI] at hy rcases hy with ⟨x, ⟨hx1, hx2⟩, hfx⟩ simp [hf] at hfx ⊒ -- We need to show that y ≀ 5. -- That is, x^3 - 3x^2 + 5 ≀ 5 -- Simplify to x^3 - 3x^2 ≀ 0 -- Factor as x^2(x-3) ≀ 0 -- Since x ∈ [-1, 1], x - 3 ≀ -2 (negative) and x^2 β‰₯ 0 (positive) -- Therefore, the product is non-positive nlinarith [sq_nonneg (x - 0), sq_nonneg (x - 2), sq_nonneg (x - 1), sq_nonneg (x + 1)] Β· -- Show 1 is least in image constructor Β· -- First show 1 is achievable, by finding an input use -1 constructor Β· -- Show -1 is in the interval rw [hI
]; aesquication; apply negatuse'lessThanOrEqaulToOfNat _one
import Mathlib open Real Set open scoped BigOperators theorem calculus_186972 (f : ℝ β†’ ℝ) (hf : f = Ξ» x => x^3 - 3*x^2 + 5) (I : Set ℝ) (hI : I = Icc (-1) 1) : IsGreatest (image f I) 5 ∧ IsLeast (image f I) 1 := by constructor Β· -- Show 5 is greatest in image constructor Β· -- First show 5 is achievable, by finding an input use 0 constructor Β· -- Show 0 is in the interval rw [hI] exact ⟨by norm_num, by norm_num⟩ Β· -- Show f(0) = 5 simp [hf] all_goals norm_num Β· -- Now show that 5 is indeed an upper bound intro y hy rw [hI] at hy rcases hy with ⟨x, ⟨hx1, hx2⟩, hfx⟩ simp [hf] at hfx ⊒ -- We need to show that y ≀ 5. -- That is, x^3 - 3x^2 + 5 ≀ 5 -- Simplify to x^3 - 3x^2 ≀ 0 -- Factor as x^2(x-3) ≀ 0 -- Since x ∈ [-1, 1], x - 3 ≀ -2 (negative) and x^2 β‰₯ 0 (positive) -- Therefore, the product is non-positive nlinarith [sq_nonneg (x - 0), sq_nonneg (x - 2), sq_nonneg (x - 1), sq_nonneg (x + 1)] Β· -- Show 1 is least in image constructor Β· -- First show 1 is achievable, by finding an input use -1 constructor Β· -- Show -1 is in the interval rw [hI
import Mathlib open Real Set open scoped BigOperators theorem calculus_186972 (f : ℝ β†’ ℝ) (hf : f = Ξ» x => x^3 - 3*x^2 + 5) (I : Set ℝ) (hI : I = Icc (-1) 1) : IsGreatest (image f I) 5 ∧ IsLeast (image f I) 1 := by constructor Β· -- Show 5 is greatest in image constructor Β· -- First show 5 is achievable, by finding an input use 0 constructor Β· -- Show 0 is in the interval rw [hI] exact ⟨by norm_num, by norm_num⟩ Β· -- Show f(0) = 5 simp [hf] all_goals norm_num Β· -- Now show that 5 is indeed an upper bound intro y hy rw [hI] at hy rcases hy with ⟨x, ⟨hx1, hx2⟩, hfx⟩ simp [hf] at hfx ⊒ -- We need to show that y ≀ 5. -- That is, x^3 - 3x^2 + 5 ≀ 5 -- Simplify to x^3 - 3x^2 ≀ 0 -- Factor as x^2(x-3) ≀ 0 -- Since x ∈ [-1, 1], x - 3 ≀ -2 (negative) and x^2 β‰₯ 0 (positive) -- Therefore, the product is non-positive nlinarith [sq_nonneg (x - 0), sq_nonneg (x - 2), sq_nonneg (x - 1), sq_nonneg (x + 1)] Β· -- Show 1 is least in image constructor Β· -- First show 1 is achievable, by finding an input use -1 constructor Β· -- Show -1 is in the interval rw [hI]; aesquication; apply negatuse'lessThanOrEqaulToOfNat _one
17
null
human
A class of 10 students took a math test. Each problem was solved by exactly 7 of the students. If the first nine students each solved 4 problems, how many problems did the tenth student solve?
import Mathlib theorem numbertheory_611213 (p : β„•) (n : β„•) (h_total_solutions : 7 * p = 9 * 4 + n) (h_score_bound : n ≀ p) : n = 6 := by
import Mathlib /-! ## Problem Statement: A class of 10 students took a math test. Each problem was solved by exactly 7 of the students. If the first nine students each solved 4 problems, how many problems did the tenth student solve? ## Solution Argument Provided: Suppose the last student solved $n$ problems, and the total number of problems on the test was $p$. Then the total number of correct solutions written can be calculated in two ways: 1. By problems: $p$ problems, each solved by 7 students. Total = $7p$. 2. By students: 9 students solved 4 problems each, and the tenth student solved $n$ problems. Total = $9 \times 4 + n = 36 + n$. Equating these gives $7p = 36 + n$. This implies $p = (36+n) / 7$, so $36+n$ must be divisible by 7. Also, the number of problems any student solves cannot exceed the total number of problems, so $n \leq p$. Substituting $p$ from the first equation into the inequality: $n \leq (36+n) / 7$ Assuming $p$ is an integer (which it must be, as it's derived from $7p = 36+n$ where $n \ge 0$), we multiply by 7: $7n \leq 36 + n$ $6n \leq 36$ $n \leq 6$ We need $n$ such that $n \in \mathbb{N}$, $n \leq 6$, and $7 \mid (36+n)$. Since $36 \equiv 1 \pmod 7$, we need $7 \mid (1+n)$. The non-negative integers $n \leq 6$ are $0, 1, 2, 3, 4, 5, 6$. Testing $n+1$ for divisibility by 7: - $0+1=1$ (no) - $1+1=2$ (no) - $2+1=3$ (no) - $3+1=4$ (no) - $4+1=5$ (no) - $5+1=6$ (no) - $6+1=7$ (yes) Thus, the only possibility is $n=6$. ## Formalization in Lean 4: -/ theorem numbertheory_611213 -- Let p be the total number of problems (a natural number). (p : β„•) -- Let n be the number of problems solved by the 10th student (a natural number). (n : β„•) -- Assume the total solutions counted by problems equals total solutions counted by students. (h_total_solutions : 7 * p = 9 * 4 + n) -- Assume the 10th student's score does not exceed the total number of problems. (h_score_bound : n ≀ p) -- The theorem asserts that under these conditions, n must be 6. : n = 6 := by omega
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib /-! ## Problem Statement: A class of 10 students took a math test. Each problem was solved by exactly 7 of the students. If the first nine students each solved 4 problems, how many problems did the tenth student solve? ## Solution Argument Provided: Suppose the last student solved $n$ problems, and the total number of problems on the test was $p$. Then the total number of correct solutions written can be calculated in two ways: 1. By problems: $p$ problems, each solved by 7 students. Total = $7p$. 2. By students: 9 students solved 4 problems each, and the tenth student solved $n$ problems. Total = $9 \times 4 + n = 36 + n$. Equating these gives $7p = 36 + n$. This implies $p = (36+n) / 7$, so $36+n$ must be divisible by 7. Also, the number of problems any student solves cannot exceed the total number of problems, so $n \leq p$. Substituting $p$ from the first equation into the inequality: $n \leq (36+n) / 7$ Assuming $p$ is an integer (which it must be, as it's derived from $7p = 36+n$ where $n \ge 0$), we multiply by 7: $7n \leq 36 + n$ $6n \leq 36$ $n \leq 6$ We need $n$ such that $n \in \mathbb{N}$, $n \leq 6$, and $7 \mid (36+n)$. Since $36 \equiv 1 \pmod 7$, we need $7 \mid (1+n)$. The non-negative integers $n \leq 6$ are $0, 1, 2, 3, 4, 5, 6$. Testing $n+1$ for divisibility by 7: - $0+1=1$ (no) - $1+1=2$ (no) - $2+1=3$ (no) - $3+1=4$ (no) - $4+1=5$ (no) - $5+1=
6\cdotneqq q*k,\text {where }\{thinspace}b , e \}=\emptyset $. So $\frac{(c^d)^z}{((w^{v})^l)^{j}}=\left(\prod_{i}^{}\right)\sqrt[o]{(-|-|)}*\sum _{I}(-\log _{\pi}(-|\sin (-)|))\lequal -\int_{-∞}^{+infty}|(|+|+\cos (\tan ^{-})|)|\,dx $, which holds since $-\|(-\operatorname{||-)|\oplus |\cot^{-}(-\ln(|\sec|^{-})|)}\|=\max\{\min \{-(-(\exp((\arctan)^{-})^{-}), -(|(+|\tanh|^{})^{}-|, \|\,|+)\,\}, \,\|\,|\,\}$. This completes our solution.*/
import Mathlib /-! ## Problem Statement: A class of 10 students took a math test. Each problem was solved by exactly 7 of the students. If the first nine students each solved 4 problems, how many problems did the tenth student solve? ## Solution Argument Provided: Suppose the last student solved $n$ problems, and the total number of problems on the test was $p$. Then the total number of correct solutions written can be calculated in two ways: 1. By problems: $p$ problems, each solved by 7 students. Total = $7p$. 2. By students: 9 students solved 4 problems each, and the tenth student solved $n$ problems. Total = $9 \times 4 + n = 36 + n$. Equating these gives $7p = 36 + n$. This implies $p = (36+n) / 7$, so $36+n$ must be divisible by 7. Also, the number of problems any student solves cannot exceed the total number of problems, so $n \leq p$. Substituting $p$ from the first equation into the inequality: $n \leq (36+n) / 7$ Assuming $p$ is an integer (which it must be, as it's derived from $7p = 36+n$ where $n \ge 0$), we multiply by 7: $7n \leq 36 + n$ $6n \leq 36$ $n \leq 6$ We need $n$ such that $n \in \mathbb{N}$, $n \leq 6$, and $7 \mid (36+n)$. Since $36 \equiv 1 \pmod 7$, we need $7 \mid (1+n)$. The non-negative integers $n \leq 6$ are $0, 1, 2, 3, 4, 5, 6$. Testing $n+1$ for divisibility by 7: - $0+1=1$ (no) - $1+1=2$ (no) - $2+1=3$ (no) - $3+1=4$ (no) - $4+1=5$ (no) - $5+1=
import Mathlib /-! ## Problem Statement: A class of 10 students took a math test. Each problem was solved by exactly 7 of the students. If the first nine students each solved 4 problems, how many problems did the tenth student solve? ## Solution Argument Provided: Suppose the last student solved $n$ problems, and the total number of problems on the test was $p$. Then the total number of correct solutions written can be calculated in two ways: 1. By problems: $p$ problems, each solved by 7 students. Total = $7p$. 2. By students: 9 students solved 4 problems each, and the tenth student solved $n$ problems. Total = $9 \times 4 + n = 36 + n$. Equating these gives $7p = 36 + n$. This implies $p = (36+n) / 7$, so $36+n$ must be divisible by 7. Also, the number of problems any student solves cannot exceed the total number of problems, so $n \leq p$. Substituting $p$ from the first equation into the inequality: $n \leq (36+n) / 7$ Assuming $p$ is an integer (which it must be, as it's derived from $7p = 36+n$ where $n \ge 0$), we multiply by 7: $7n \leq 36 + n$ $6n \leq 36$ $n \leq 6$ We need $n$ such that $n \in \mathbb{N}$, $n \leq 6$, and $7 \mid (36+n)$. Since $36 \equiv 1 \pmod 7$, we need $7 \mid (1+n)$. The non-negative integers $n \leq 6$ are $0, 1, 2, 3, 4, 5, 6$. Testing $n+1$ for divisibility by 7: - $0+1=1$ (no) - $1+1=2$ (no) - $2+1=3$ (no) - $3+1=4$ (no) - $4+1=5$ (no) - $5+1=6\cdotneqq q*k,\text {where }\{thinspace}b , e \}=\emptyset $. So $\frac{(c^d)^z}{((w^{v})^l)^{j}}=\left(\prod_{i}^{}\right)\sqrt[o]{(-|-|)}*\sum _{I}(-\log _{\pi}(-|\sin (-)|))\lequal -\int_{-∞}^{+infty}|(|+|+\cos (\tan ^{-})|)|\,dx $, which holds since $-\|(-\operatorname{||-)|\oplus |\cot^{-}(-\ln(|\sec|^{-})|)}\|=\max\{\min \{-(-(\exp((\arctan)^{-})^{-}), -(|(+|\tanh|^{})^{}-|, \|\,|+)\,\}, \,\|\,|\,\}$. This completes our solution.*/
18
null
human
In a game show, Bob is faced with 7 doors, 2 of which hide prizes. After he chooses a door, the host opens three other doors, of which one is hiding a prize. Bob chooses to switch to another door. What is the probability that his new door is hiding a prize?
import Mathlib theorem Combinatorics_608318 (total_doors prize_doors host_opens prizes_opened : β„•) (h_total : total_doors = 7) (h_prize : prize_doors = 2) (h_opens : host_opens = 3) (h_prizes_opened : prizes_opened = 1) (switch_success : P = ((total_doors - prize_doors) : ℝ) / (total_doors : ℝ) * (prize_doors - prizes_opened : ℝ) / (total_doors - 1 - host_opens : ℝ)) : P = (5 / 21 : ℝ) := by
import Mathlib /- Problem : This is a variant of the classic Monty Hall problem. -/ theorem Combinatorics_608318 (total_doors prize_doors host_opens prizes_opened : β„•) (h_total : total_doors = 7) -- Total number of doors (h_prize : prize_doors = 2) -- Number of doors hiding prizes (h_opens : host_opens = 3) -- Number of doors opened by the host (h_prizes_opened : prizes_opened = 1) -- Number of prizes revealed by the host (switch_success : P = ((total_doors - prize_doors) : ℝ) / (total_doors : ℝ) * (prize_doors - prizes_opened : ℝ) / (total_doors - 1 - host_opens : ℝ)) : P = (5 / 21 : ℝ) := by -- Substitute known values into the probability formula rw [h_total, h_prize, h_opens] at switch_success -- Compute numerical values using the remaining hypothesis norm_num [h_prizes_opened] at switch_success -- Solve the resulting linear arithmetic equality linarith
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib /- Problem : This is a variant of the classic Monty Hall problem. -/ theorem Combinatorics_608318 (total_doors prize_doors host_opens prizes_opened : β„•) (h_total : total_doors = 7) -- Total number of doors (h_prize : prize_doors = 2) -- Number of doors hiding prizes (h_opens : host_opens = 3) -- Number of doors opened by the host (h_prizes_opened : prizes_opened = 1) -- Number of prizes revealed by the host (switch_success : P = ((total_doors - prize_doors) : ℝ) / (total_doors : ℝ) * (prize_doors - prizes_opened : ℝ) / (total_doors - 1 - host_opens : ℝ)) : P
:=by rw[show((total _)-prize_)=_, only if←Nat._sub?_eq' , Nat..le'_iff', le], show(_/_), div; normF ;ringle
import Mathlib /- Problem : This is a variant of the classic Monty Hall problem. -/ theorem Combinatorics_608318 (total_doors prize_doors host_opens prizes_opened : β„•) (h_total : total_doors = 7) -- Total number of doors (h_prize : prize_doors = 2) -- Number of doors hiding prizes (h_opens : host_opens = 3) -- Number of doors opened by the host (h_prizes_opened : prizes_opened = 1) -- Number of prizes revealed by the host (switch_success : P = ((total_doors - prize_doors) : ℝ) / (total_doors : ℝ) * (prize_doors - prizes_opened : ℝ) / (total_doors - 1 - host_opens : ℝ)) : P
import Mathlib /- Problem : This is a variant of the classic Monty Hall problem. -/ theorem Combinatorics_608318 (total_doors prize_doors host_opens prizes_opened : β„•) (h_total : total_doors = 7) -- Total number of doors (h_prize : prize_doors = 2) -- Number of doors hiding prizes (h_opens : host_opens = 3) -- Number of doors opened by the host (h_prizes_opened : prizes_opened = 1) -- Number of prizes revealed by the host (switch_success : P = ((total_doors - prize_doors) : ℝ) / (total_doors : ℝ) * (prize_doors - prizes_opened : ℝ) / (total_doors - 1 - host_opens : ℝ)) : P:=by rw[show((total _)-prize_)=_, only if←Nat._sub?_eq' , Nat..le'_iff', le], show(_/_), div; normF ;ringle
19
null
human
How many sequences of 5 positive integers $(a, b, c, d, e)$ satisfy $a b c d e \leq a+b+c+d+e \leq 10$ ?
import Mathlib abbrev value_range : Finset β„• := Finset.Icc 1 6 def Ξ© : Finset (β„• Γ— β„• Γ— β„• Γ— β„• Γ— β„•) := Finset.product value_range <| Finset.product value_range <| Finset.product value_range <| Finset.product value_range value_range def to_list (t : β„• Γ— β„• Γ— β„• Γ— β„• Γ— β„•) : List β„• := [t.1, t.2.1, t.2.2.1, t.2.2.2.1, t.2.2.2.2] def E : Finset (β„• Γ— β„• Γ— β„• Γ— β„• Γ— β„•) := Ξ©.filter (fun t => let l := to_list t let sum := l.sum let prod := l.prod prod ≀ sum ∧ sum ≀ 10) theorem num_sequences_is_116 : E.card = 116 := by
import Mathlib /-How many sequences of 5 positive integers $(a, b, c, d, e)$ satisfy $a b c d e \leq a+b+c+d+e \leq 10$ ?-/ -- Define the finite range for each integer in the sequence. abbrev value_range : Finset β„• := Finset.Icc 1 6 -- The sample space Ξ© is the 5-fold cartesian product of this range. -- This creates all possible sequences (a,b,c,d,e) to check. def Ξ© : Finset (β„• Γ— β„• Γ— β„• Γ— β„• Γ— β„•) := Finset.product value_range <| Finset.product value_range <| Finset.product value_range <| Finset.product value_range value_range -- Helper function to destructure the nested pairs from Finset.product. def to_list (t : β„• Γ— β„• Γ— β„• Γ— β„• Γ— β„•) : List β„• := [t.1, t.2.1, t.2.2.1, t.2.2.2.1, t.2.2.2.2] -- Define the set of sequences `E` that satisfy the problem's conditions. def E : Finset (β„• Γ— β„• Γ— β„• Γ— β„• Γ— β„•) := Ξ©.filter (fun t => let l := to_list t let sum := l.sum let prod := l.prod prod ≀ sum ∧ sum ≀ 10) theorem num_sequences_is_116 : E.card = 116 := by native_decide
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib /-How many sequences of 5 positive integers $(a, b, c, d, e)$ satisfy $a b c d e \leq a+b+c+d+e \leq 10$ ?-/ -- Define the finite range for each integer in the sequence. abbrev value_range : Finset β„• := Finset.Icc 1 6 -- The sample space Ξ© is the 5-fold cartesian product of this range. -- This creates all possible sequences (a,b,c,d,e) to check. def Ξ© : Finset (β„• Γ— β„• Γ— β„• Γ— β„• Γ— β„•) := Finset.product value_range <| Finset.product value_range <| Finset.product value_range <| Finset.product value_range value_range -- Helper function to destructure the nested pairs from Finset.product. def to_list (t : β„• Γ— β„• Γ— β„• Γ— β„• Γ— β„•) : List β„• := [t.1, t.2.1, t.2.2.1, t.2.2.2.1, t.2.2.2.
2].reverse!
import Mathlib /-How many sequences of 5 positive integers $(a, b, c, d, e)$ satisfy $a b c d e \leq a+b+c+d+e \leq 10$ ?-/ -- Define the finite range for each integer in the sequence. abbrev value_range : Finset β„• := Finset.Icc 1 6 -- The sample space Ξ© is the 5-fold cartesian product of this range. -- This creates all possible sequences (a,b,c,d,e) to check. def Ξ© : Finset (β„• Γ— β„• Γ— β„• Γ— β„• Γ— β„•) := Finset.product value_range <| Finset.product value_range <| Finset.product value_range <| Finset.product value_range value_range -- Helper function to destructure the nested pairs from Finset.product. def to_list (t : β„• Γ— β„• Γ— β„• Γ— β„• Γ— β„•) : List β„• := [t.1, t.2.1, t.2.2.1, t.2.2.2.1, t.2.2.2.
import Mathlib /-How many sequences of 5 positive integers $(a, b, c, d, e)$ satisfy $a b c d e \leq a+b+c+d+e \leq 10$ ?-/ -- Define the finite range for each integer in the sequence. abbrev value_range : Finset β„• := Finset.Icc 1 6 -- The sample space Ξ© is the 5-fold cartesian product of this range. -- This creates all possible sequences (a,b,c,d,e) to check. def Ξ© : Finset (β„• Γ— β„• Γ— β„• Γ— β„• Γ— β„•) := Finset.product value_range <| Finset.product value_range <| Finset.product value_range <| Finset.product value_range value_range -- Helper function to destructure the nested pairs from Finset.product. def to_list (t : β„• Γ— β„• Γ— β„• Γ— β„• Γ— β„•) : List β„• := [t.1, t.2.1, t.2.2.1, t.2.2.2.1, t.2.2.2.2].reverse!
20
null
human
How many ways can one tile a $2 \times 8$ board with $1 \times 1$ and $2 \times 2$ tiles? Rotations and reflections of the same configuration are considered distinct.
import Mathlib def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) theorem Combinatorics_610027: f 8 = 34 := by
import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f]
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile
an infinite strip made up ofl infinitely many identical rectangles each widthto be tiled using only red rectangles which measure either $(a\cdotb)\timesc$, where $\gcd\{ab\}=d$. The order in which they appear is not important but their orientation must remain fixed when rotated about its center point.-/
import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile
import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile an infinite strip made up ofl infinitely many identical rectangles each widthto be tiled using only red rectangles which measure either $(a\cdotb)\timesc$, where $\gcd\{ab\}=d$. The order in which they appear is not important but their orientation must remain fixed when rotated about its center point.-/
21
null
human
Boris was given a Connect Four game set for his birthday, but his color-blindness makes it hard to play the game. Still, he enjoys the shapes he can make by dropping checkers into the set. If the number of shapes possible modulo (horizontal) flips about the vertical axis of symmetry is expressed as $9(1+2+\cdots+n)$, find $n$. (Note: the board is a vertical grid with seven columns and eight rows. A checker is placed into the grid by dropping it from the top of a column, and it falls until it hits either the bottom of the grid or another checker already in that column. Also, $9(1+2+\cdots+n)$ is the number of shapes possible, with two shapes that are horizontal flips of each other counted as one. In other words, the shape that consists solely of 3 checkers in the rightmost row and the shape that consists solely of 3 checkers in the leftmost row are to be considered the same shape.)
import Mathlib open Nat abbrev total_shapes := 9^7 abbrev symmetric_shapes := 9^4 abbrev non_symmetric_shapes := total_shapes - symmetric_shapes abbrev non_symmetric_shapes_mod_flips := (total_shapes - symmetric_shapes) / 2 theorem combinatorics_610842 (n : β„•) (h : symmetric_shapes + non_symmetric_shapes_mod_flips = 9 * (Finset.sum (Finset.range n.succ) id)) : n = 729 := by
import Mathlib open Nat -- The number of checkers in a column can be 0 to 8, so 9 possibilities. -- Total shapes: 7 columns, so 9^7. abbrev total_shapes := 9^7 -- Symmetric shapes: Middle column (4th) can be any of 9. -- Left 3 columns determine right 3 columns. So 9^3 for left, 9^1 for middle. Thus 9^4. abbrev symmetric_shapes := 9^4 abbrev non_symmetric_shapes := total_shapes - symmetric_shapes abbrev non_symmetric_shapes_mod_flips := (total_shapes - symmetric_shapes) / 2 theorem combinatorics_610842 (n : β„•) (h : symmetric_shapes + non_symmetric_shapes_mod_flips = 9 * (Finset.sum (Finset.range n.succ) id)) : n = 729 := by -- Prove that symmetric_shapes <= total_shapes to ensure non_symmetric_shapes is valid (Nat subtraction) have h_symm_le_total : symmetric_shapes ≀ total_shapes := pow_le_pow_of_le_right (by norm_num : 9 > 0) (by norm_num : 4 ≀ 7) -- Prove that non_symmetric_shapes is even for the division by 2 have h_non_symm_even : non_symmetric_shapes % 2 = 0 := by dsimp [non_symmetric_shapes, total_shapes, symmetric_shapes] -- Simplify the calculated total_shapes_mod_flips expression -- total_shapes_mod_flips = $S + (T-S)/2 = (2S + T-S)/2 = (S+T)/2$ have h_calc_total_shapes_mod_flips : symmetric_shapes + non_symmetric_shapes_mod_flips = (9^4 * (9^3 + 1)) / 2 := by dsimp [non_symmetric_shapes_mod_flips, symmetric_shapes, total_shapes] have h_problem_form (m : β„•) : 9 * (Finset.sum (Finset.range m.succ) id) = 9 * ((m + 1) * m / 2) := by simp[Finset.sum_range_id m.succ] -- Substitute simplified forms into the hypothesis h_problem_statement rw [h_calc_total_shapes_mod_flips, h_problem_form n] at h -- From $(9^4 \cdot (9^3 + 1)) / 2 = (9 \cdot n_{unknown} \cdot (n_{unknown}+1))/2$, derive equality of numerators have h_eq_numerators : (9^4 * (9^3 + 1)) = 9 * n * (n+1) := by have lhs_even : (9^4 * (9^3 + 1)) % 2 = 0 := by rw [Nat.mul_mod]; have : (9^3 + 1) % 2 = 0 := by norm_num -- $729+1 = 730$ rw [this, mul_zero] norm_num have rhs_even : (9 * n * (n+1)) % 2 = 0 := by sorry sorry have h_cancel_9 : 9^3 * (9^3 + 1) = n * (n+1) := by rw [show (9^4 : β„•) = 9 * 9^3 by rw[mul_comm, ← pow_succ 9 3] ] at h_eq_numerators rw [mul_assoc 9 (9^3) (9^3+1),mul_assoc 9 ] at h_eq_numerators exact Nat.mul_left_cancel (show 0 < 9 by norm_num) h_eq_numerators -- Use $a(a+1)=b(b+1) \implies a=b$ for $a,b \in \mathbb{N}$ simp at h_cancel_9 ring_nf at h_cancel_9 sorry
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib open Nat -- The number of checkers in a column can be 0 to 8, so 9 possibilities. -- Total shapes: 7 columns, so 9^7. abbrev total_shapes := 9^7 -- Symmetric shapes: Middle column (4th) can be any of 9. -- Left 3 columns determine right 3 columns. So 9^3 for left, 9^1 for middle. Thus 9^4. abbrev symmetric_shapes := 9^4 abbrev non_symmetric_shapes := total_shapes - symmetric_shapes abbrev non_symmetric_shapes_mod_flips := (total_shapes - symmetric_shapes) / 2 theorem combinatorics_610842 (n : β„•) (h : symmetric_shapes + non_symmetric_shapes_mod_flips = 9 * (Finset.sum (Finset.range n.succ) id)) : n = 729 := by -- Prove that symmetric_shapes <= total_shapes to ensure non_symmetric_shapes is valid (Nat subtraction) have h_symm_le_total : symmetric_shapes ≀ total_shapes := pow_le_pow_of_le_right (by norm_num : 9 > 0) (by norm_num : 4 ≀ 7) -- Prove that non_symmetric_shapes is even for the division by 2 have h_non_symm_even : non_symmetric_shapes % 2 = 0 := by dsimp [non_symmetric_shapes, total_shapes, symmetric_shapes] -- Simplify the calculated total_shapes_mod_flips expression -- total_shapes_mod_flips = $S + (T-S)/2 = (2S + T-S)/2 = (S+T)/2$ have h_calc_total_shapes_mod_flips : symmetric_shapes + non_symmetric_shapes_mod_flips = (9^4 * (9^3 + 1)) / 2 := by dsimp [non_symmetric_shapes_mod_flips, symmetric_shapes, total_shapes] have h_problem_form (m : β„•) : 9 * (Finset.sum (Finset.range m.succ) id) = 9 * ((m + 1) * m / 2) := by simp[Finset.sum_range_id m.succ] -- Substitute simplified forms into the hypothesis h_problem_statement rw [h_calc_total_shapes_mod_flips, h_problem_form n] at h -- From $(9^4 \cdot (9^3 + 1)) / 2 = (9 \cdot n_{unknown} \cdot (n_{unknown}+1))/2$, derive equality of numerators have h_eq_numerators : (9^4 * (9^3 + 1)) =
9*((nFrinch' _).mul Nonzero'.dividable funeral:= divableByOneNatrual )*(funerial.+one)*nfunctional.:=?_three._two.*nPow₃₄..add_.left .cast this; apply mulLEMul ; Β· positivityΒ· refine leOfLT ?a₂₁ , ltDivENaturalCast?.transοΏ½liat it only applies when both sides positive! but we know `p`>`.minus.` frormula above using pwer rule on first factor
import Mathlib open Nat -- The number of checkers in a column can be 0 to 8, so 9 possibilities. -- Total shapes: 7 columns, so 9^7. abbrev total_shapes := 9^7 -- Symmetric shapes: Middle column (4th) can be any of 9. -- Left 3 columns determine right 3 columns. So 9^3 for left, 9^1 for middle. Thus 9^4. abbrev symmetric_shapes := 9^4 abbrev non_symmetric_shapes := total_shapes - symmetric_shapes abbrev non_symmetric_shapes_mod_flips := (total_shapes - symmetric_shapes) / 2 theorem combinatorics_610842 (n : β„•) (h : symmetric_shapes + non_symmetric_shapes_mod_flips = 9 * (Finset.sum (Finset.range n.succ) id)) : n = 729 := by -- Prove that symmetric_shapes <= total_shapes to ensure non_symmetric_shapes is valid (Nat subtraction) have h_symm_le_total : symmetric_shapes ≀ total_shapes := pow_le_pow_of_le_right (by norm_num : 9 > 0) (by norm_num : 4 ≀ 7) -- Prove that non_symmetric_shapes is even for the division by 2 have h_non_symm_even : non_symmetric_shapes % 2 = 0 := by dsimp [non_symmetric_shapes, total_shapes, symmetric_shapes] -- Simplify the calculated total_shapes_mod_flips expression -- total_shapes_mod_flips = $S + (T-S)/2 = (2S + T-S)/2 = (S+T)/2$ have h_calc_total_shapes_mod_flips : symmetric_shapes + non_symmetric_shapes_mod_flips = (9^4 * (9^3 + 1)) / 2 := by dsimp [non_symmetric_shapes_mod_flips, symmetric_shapes, total_shapes] have h_problem_form (m : β„•) : 9 * (Finset.sum (Finset.range m.succ) id) = 9 * ((m + 1) * m / 2) := by simp[Finset.sum_range_id m.succ] -- Substitute simplified forms into the hypothesis h_problem_statement rw [h_calc_total_shapes_mod_flips, h_problem_form n] at h -- From $(9^4 \cdot (9^3 + 1)) / 2 = (9 \cdot n_{unknown} \cdot (n_{unknown}+1))/2$, derive equality of numerators have h_eq_numerators : (9^4 * (9^3 + 1)) =
import Mathlib open Nat -- The number of checkers in a column can be 0 to 8, so 9 possibilities. -- Total shapes: 7 columns, so 9^7. abbrev total_shapes := 9^7 -- Symmetric shapes: Middle column (4th) can be any of 9. -- Left 3 columns determine right 3 columns. So 9^3 for left, 9^1 for middle. Thus 9^4. abbrev symmetric_shapes := 9^4 abbrev non_symmetric_shapes := total_shapes - symmetric_shapes abbrev non_symmetric_shapes_mod_flips := (total_shapes - symmetric_shapes) / 2 theorem combinatorics_610842 (n : β„•) (h : symmetric_shapes + non_symmetric_shapes_mod_flips = 9 * (Finset.sum (Finset.range n.succ) id)) : n = 729 := by -- Prove that symmetric_shapes <= total_shapes to ensure non_symmetric_shapes is valid (Nat subtraction) have h_symm_le_total : symmetric_shapes ≀ total_shapes := pow_le_pow_of_le_right (by norm_num : 9 > 0) (by norm_num : 4 ≀ 7) -- Prove that non_symmetric_shapes is even for the division by 2 have h_non_symm_even : non_symmetric_shapes % 2 = 0 := by dsimp [non_symmetric_shapes, total_shapes, symmetric_shapes] -- Simplify the calculated total_shapes_mod_flips expression -- total_shapes_mod_flips = $S + (T-S)/2 = (2S + T-S)/2 = (S+T)/2$ have h_calc_total_shapes_mod_flips : symmetric_shapes + non_symmetric_shapes_mod_flips = (9^4 * (9^3 + 1)) / 2 := by dsimp [non_symmetric_shapes_mod_flips, symmetric_shapes, total_shapes] have h_problem_form (m : β„•) : 9 * (Finset.sum (Finset.range m.succ) id) = 9 * ((m + 1) * m / 2) := by simp[Finset.sum_range_id m.succ] -- Substitute simplified forms into the hypothesis h_problem_statement rw [h_calc_total_shapes_mod_flips, h_problem_form n] at h -- From $(9^4 \cdot (9^3 + 1)) / 2 = (9 \cdot n_{unknown} \cdot (n_{unknown}+1))/2$, derive equality of numerators have h_eq_numerators : (9^4 * (9^3 + 1)) = 9*((nFrinch' _).mul Nonzero'.dividable funeral:= divableByOneNatrual )*(funerial.+one)*nfunctional.:=?_three._two.*nPow₃₄..add_.left .cast this; apply mulLEMul ; Β· positivityΒ· refine leOfLT ?a₂₁ , ltDivENaturalCast?.transοΏ½liat it only applies when both sides positive! but we know `p`>`.minus.` frormula above using pwer rule on first factor
23
null
human
In the country of Francisca, there are 2010 cities, some of which are connected by roads. Between any two cities, there is a unique path which runs along the roads and which does not pass through any city twice. What is the maximum possible number of cities in Francisca which have at least 3 roads running out of them?
import Mathlib theorem combinatorics_608689 (n : β„•) (hn : n = 2010) (b : β„•) (hb : b ≀ n) (h : 3 * b + (n - b) ≀ 2 * (n - 1)) : b ≀ 1004 := by
import Mathlib /- The problem describes a tree structure with 2010 nodes (cities), where each node represents a city and each edge represents a road. The goal is to determine the maximum number of nodes with a degree of at least 3. -/ theorem combinatorics_608689 (n : β„•) (hn : n = 2010) (b : β„•) (hb : b ≀ n) (h : 3 * b + (n - b) ≀ 2 * (n - 1)) : b ≀ 1004 := by omega
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib /- The problem describes a tree structure with 2010 nodes (cities), where each node represents a city and each edge represents a road. The goal is to determine the maximum number of nodes with a degree of at least 3. -/ theorem combinatorics_608689 (n : β„•) (hn : n = 2010) (b : β„•) (
hb₂₃₄₅⁢ᡉlvent {a} in Finset.{u}.elements s if Β¬IsEmptySet._eqv_.mp _inst?_empty_, IsFiniteOrder.<|>.out _, Nat..le i j then it' else Iff'.mp fun Hij hij jack jocky zoemmazeerHijadjajockshortenableοΏ½lifiable:=by rw[Nat.*]; normF; apply leOfLT ; assumption )): max ({maximalDegree v∣venin V})=max({degree u+sum_{w\in N}(degree w)})-min{degrea e*card E}+abs((-{(-N).size}-E)*(|V|--|U|)*({|T|+{-S}|})-{(-(G^op)^*) .edgeFiniteCard })/βˆšΟ€/log^{|_|}
import Mathlib /- The problem describes a tree structure with 2010 nodes (cities), where each node represents a city and each edge represents a road. The goal is to determine the maximum number of nodes with a degree of at least 3. -/ theorem combinatorics_608689 (n : β„•) (hn : n = 2010) (b : β„•) (
import Mathlib /- The problem describes a tree structure with 2010 nodes (cities), where each node represents a city and each edge represents a road. The goal is to determine the maximum number of nodes with a degree of at least 3. -/ theorem combinatorics_608689 (n : β„•) (hn : n = 2010) (b : β„•) (hb₂₃₄₅⁢ᡉlvent {a} in Finset.{u}.elements s if Β¬IsEmptySet._eqv_.mp _inst?_empty_, IsFiniteOrder.<|>.out _, Nat..le i j then it' else Iff'.mp fun Hij hij jack jocky zoemmazeerHijadjajockshortenableοΏ½lifiable:=by rw[Nat.*]; normF; apply leOfLT ; assumption )): max ({maximalDegree v∣venin V})=max({degree u+sum_{w\in N}(degree w)})-min{degrea e*card E}+abs((-{(-N).size}-E)*(|V|--|U|)*({|T|+{-S}|})-{(-(G^op)^*) .edgeFiniteCard })/βˆšΟ€/log^{|_|}
24
null
human
The altitudes of a triangle are 12,15 and 20. What is the area of the triangle? Answer: 150.
import Mathlib noncomputable def S (a b c: ℝ) := let s := (a + b + c) / 2 √(s * (s - a) * (s - b) * (s - c)) theorem geometry_606364 (a b c h_a h_b h_c : ℝ) (hβ‚€ : 0 < a ∧ 0 < b ∧ 0 < c) (h₁ : h_a = 12) (hβ‚‚ : h_b = 15) (h₃ : h_c = 20) (hβ‚„ : a / b = h_b / h_a) (hβ‚… : b / c = h_c / h_b) (h₆: S a b c = a * h_a / 2): S a b c = 150 := by
import Mathlib noncomputable def S (a b c: ℝ) := let s:= (a + b + c) / 2 √(s * (s - a) * (s - b) * (s - c)) /-The altitudes of a triangle are 12,15 and 20. What is the area of the triangle? Answer: 150.-/ theorem geometry_606364 (a b c h_a h_b h_c : ℝ) (hβ‚€ : 0 < a ∧ 0 < b ∧ 0 < c) (h₁ : h_a = 12) (hβ‚‚ : h_b = 15) (h₃ : h_c = 20) (hβ‚„ : a / b = h_b / h_a) (hβ‚… : b / c = h_c / h_b) (h₆: S a b c = a * h_a / 2): S a b c = 150 := by rw [h₆] rcases hβ‚€ with ⟨p1, p2, p3⟩ simp [S] at h₆ replace hβ‚„: b = 4 / 5 * a := by simp [hβ‚‚, h₁] at hβ‚„ field_simp at hβ‚„ clear *- hβ‚„ linarith simp [hβ‚‚, h₃] at hβ‚… field_simp at hβ‚… replace hβ‚…: c = 3 / 5 * a := by linarith simp [hβ‚„, hβ‚…, h₁] at h₆ ring_nf at h₆ rw [Real.sqrt_eq_iff_mul_self_eq_of_pos] at h₆ ring_nf at h₆ replace h₆: a = 25 := by clear *- h₆ p1 replace h₆: a ^ 2 * (a - 25) * (a + 25) = 0 := by nlinarith simp at h₆ rcases h₆ with p | p . rcases p with p | p . simp [p] at p1 . nlinarith . nlinarith rw [h₆, h₁] norm_num linarith
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib noncomputable def S (a b c: ℝ) := let s:= (a + b + c) / 2 √(s * (s - a) * (s - b) * (s - c)) /-The altitudes of a triangle are 12,15 and 20. What is the area of the triangle? Answer: 150.-/ theorem geometry_606364 (a b c h_a h_b h_c : ℝ) (hβ‚€ : 0 < a ∧ 0 < b ∧ 0 < c) (h₁ : h_a = 12) (hβ‚‚ : h_b = 15) (h₃ : h_c = 20) (hβ‚„ : a / b = h_b / h_a) (hβ‚… : b / c = h_c / h_b) (h₆: S a b c = a * h_a / 2): S a b c = 150 := by rw [h₆] rcases hβ‚€ with ⟨p1, p2, p3⟩ simp [S] at h₆ replace hβ‚„: b = 4 / 5 * a := by simp [hβ‚‚, h₁] at hβ‚„ field_simp at hβ‚„ clear *- hβ‚„ linarith simp [hβ‚‚, h₃] at hβ‚… field_simp at hβ‚… replace hβ‚…: c = 3 / 5 * a := by linarith simp [hβ‚„, hβ‚…, h₁] at h₆
Β· normFarrow[*]
import Mathlib noncomputable def S (a b c: ℝ) := let s:= (a + b + c) / 2 √(s * (s - a) * (s - b) * (s - c)) /-The altitudes of a triangle are 12,15 and 20. What is the area of the triangle? Answer: 150.-/ theorem geometry_606364 (a b c h_a h_b h_c : ℝ) (hβ‚€ : 0 < a ∧ 0 < b ∧ 0 < c) (h₁ : h_a = 12) (hβ‚‚ : h_b = 15) (h₃ : h_c = 20) (hβ‚„ : a / b = h_b / h_a) (hβ‚… : b / c = h_c / h_b) (h₆: S a b c = a * h_a / 2): S a b c = 150 := by rw [h₆] rcases hβ‚€ with ⟨p1, p2, p3⟩ simp [S] at h₆ replace hβ‚„: b = 4 / 5 * a := by simp [hβ‚‚, h₁] at hβ‚„ field_simp at hβ‚„ clear *- hβ‚„ linarith simp [hβ‚‚, h₃] at hβ‚… field_simp at hβ‚… replace hβ‚…: c = 3 / 5 * a := by linarith simp [hβ‚„, hβ‚…, h₁] at h₆
import Mathlib noncomputable def S (a b c: ℝ) := let s:= (a + b + c) / 2 √(s * (s - a) * (s - b) * (s - c)) /-The altitudes of a triangle are 12,15 and 20. What is the area of the triangle? Answer: 150.-/ theorem geometry_606364 (a b c h_a h_b h_c : ℝ) (hβ‚€ : 0 < a ∧ 0 < b ∧ 0 < c) (h₁ : h_a = 12) (hβ‚‚ : h_b = 15) (h₃ : h_c = 20) (hβ‚„ : a / b = h_b / h_a) (hβ‚… : b / c = h_c / h_b) (h₆: S a b c = a * h_a / 2): S a b c = 150 := by rw [h₆] rcases hβ‚€ with ⟨p1, p2, p3⟩ simp [S] at h₆ replace hβ‚„: b = 4 / 5 * a := by simp [hβ‚‚, h₁] at hβ‚„ field_simp at hβ‚„ clear *- hβ‚„ linarith simp [hβ‚‚, h₃] at hβ‚… field_simp at hβ‚… replace hβ‚…: c = 3 / 5 * a := by linarith simp [hβ‚„, hβ‚…, h₁] at h₆ Β· normFarrow[*]
25
null
human
A convex quadrilateral is determined by the points of intersection of the curves $x^{4}+y^{4}=100$ and $x y=4$; determine its area.
import Mathlib theorem geometry_608136 {a b: ℝ} (h1: a ^ 4 + b ^ 4 = 100) (h2: a * b = 4): |(√2 * (a - b)) * (√2 * (a + b))| = 4 * √17 := by
import Mathlib /-A convex quadrilateral is determined by the points of intersection of the curves x^4 + y^4 =100 and xy=4; determine its area.-/ theorem geometry_608136 {a b: ℝ} (h1: a ^ 4 + b ^ 4 = 100) (h2: a * b = 4): |(√2 * (a - b)) * (√2 * (a + b))| = 4 * √17 := by ring_nf have u: √2 ^ 2 = 2 := by symm rw [← Real.sqrt_eq_iff_eq_sq] norm_num apply Real.sqrt_nonneg simp [u] rw [show 2 * a ^ 2 - 2 * b ^ 2 = 2 * (a ^ 2 - b ^ 2) by ring] rw [abs_mul] suffices |a ^ 2 - b ^ 2| = 2 * √17 by simp [this] ring have i: 0 ≀ √17 := by apply Real.sqrt_nonneg rw [show 2 * √17 = |2 * √17| by symm; apply abs_of_nonneg; linarith] rw [← sq_eq_sq_iff_abs_eq_abs] ring_nf have v: √17 ^ 2 = 17 := by symm rw [← Real.sqrt_eq_iff_eq_sq] norm_num apply Real.sqrt_nonneg simp [v] nlinarith
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib /-A convex quadrilateral is determined by the points of intersection of the curves x^4 + y^4 =100 and xy=4; determine its area.-/ theorem geometry_608136 {a b: ℝ} (h1: a ^ 4 + b ^ 4 = 100) (h2: a * b = 4): |(√2 * (a - b)) * (√2 * (a + b))| = 4 * √17 := by ring_nf have u: √2 ^ 2 = 2 := by symm rw [← Real.sqrt_eq_iff_eq_sq] norm_num apply Real.sqrt_nonneg simp [u] rw [show 2 * a ^ 2 - 2 * b ^ 2 = 2 * (a ^ 2 - b ^ 2) by ring] rw [abs_mul] suffices |a ^ 2 - b ^ 2| = 2 * √17 by simp [this] ring have i: 0 ≀ √17 := by
positivity'
import Mathlib /-A convex quadrilateral is determined by the points of intersection of the curves x^4 + y^4 =100 and xy=4; determine its area.-/ theorem geometry_608136 {a b: ℝ} (h1: a ^ 4 + b ^ 4 = 100) (h2: a * b = 4): |(√2 * (a - b)) * (√2 * (a + b))| = 4 * √17 := by ring_nf have u: √2 ^ 2 = 2 := by symm rw [← Real.sqrt_eq_iff_eq_sq] norm_num apply Real.sqrt_nonneg simp [u] rw [show 2 * a ^ 2 - 2 * b ^ 2 = 2 * (a ^ 2 - b ^ 2) by ring] rw [abs_mul] suffices |a ^ 2 - b ^ 2| = 2 * √17 by simp [this] ring have i: 0 ≀ √17 := by
import Mathlib /-A convex quadrilateral is determined by the points of intersection of the curves x^4 + y^4 =100 and xy=4; determine its area.-/ theorem geometry_608136 {a b: ℝ} (h1: a ^ 4 + b ^ 4 = 100) (h2: a * b = 4): |(√2 * (a - b)) * (√2 * (a + b))| = 4 * √17 := by ring_nf have u: √2 ^ 2 = 2 := by symm rw [← Real.sqrt_eq_iff_eq_sq] norm_num apply Real.sqrt_nonneg simp [u] rw [show 2 * a ^ 2 - 2 * b ^ 2 = 2 * (a ^ 2 - b ^ 2) by ring] rw [abs_mul] suffices |a ^ 2 - b ^ 2| = 2 * √17 by simp [this] ring have i: 0 ≀ √17 := by positivity'
26
null
human
Let $P$ be a polyhedron where every face is a regular polygon, and every edge has length 1. Each vertex of $P$ is incident to two regular hexagons and one square. Choose a vertex $V$ of the polyhedron. Find the volume of the set of all points contained in $P$ that are closer to $V$ than to any other vertex.
import Mathlib.Data.Real.Basic import Mathlib.Tactic open Real noncomputable section def squarePyramidVolume (s h : ℝ) : ℝ := (1 / 3) * s ^ 2 * h def octahedronVolume : ℝ := let s := 3 let h := (s * Real.sqrt 2) / 2 2 * squarePyramidVolume s h def cornerVolume : ℝ := squarePyramidVolume 1 (sqrt 2 / 2) def polyhedronVolume : ℝ := octahedronVolume - 6 * cornerVolume def targetVolume : ℝ := polyhedronVolume / 24 theorem truncated_octahedron_vertex_region_volume : targetVolume = sqrt 2 / 3 := by
import Mathlib.Data.Real.Basic import Mathlib.Tactic open Real noncomputable section -- volume of a square pyramid with square base of side s and height h def squarePyramidVolume (s h : ℝ) : ℝ := (1 / 3) * s ^ 2 * h -- volume of an octahedron made of two square pyramids with edge length 3 def octahedronVolume : ℝ := let s := 3 let h := (s * Real.sqrt 2) / 2 2 * squarePyramidVolume s h -- volume of one corner pyramid to remove (base square side 1, height √2 / 2) def cornerVolume : ℝ := squarePyramidVolume 1 (sqrt 2 / 2) -- total volume of truncated polyhedron def polyhedronVolume : ℝ := octahedronVolume - 6 * cornerVolume -- volume of region closest to one vertex def targetVolume : ℝ := polyhedronVolume / 24 theorem truncated_octahedron_vertex_region_volume : targetVolume = sqrt 2 / 3 := by unfold targetVolume polyhedronVolume cornerVolume octahedronVolume squarePyramidVolume norm_num ring_nf
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib.Data.Real.Basic import Mathlib.Tactic open Real noncomputable section -- volume of a square pyramid with square base of side s and height h def squarePyramidVolume (s h : ℝ) : ℝ := (1 / 3) * s ^ 2 * h -- volume of an octahedron made of two square pyramids with edge length 3 def octahedronVolume : ℝ := let s := 3 let h := (s * Real.sqrt 2) / 2 2 * squarePyramidVolume s h -- volume of one corner pyramid to remove (base square side 1, height √2 / 2) def cornerVolume : ℝ := squarePyramidVolume 1 (sqrt 2 / 2) -- total volume of truncated polyhedron def polyhedronVolume : ℝ := octahedronVolume - 6 * cornerVolume
end
import Mathlib.Data.Real.Basic import Mathlib.Tactic open Real noncomputable section -- volume of a square pyramid with square base of side s and height h def squarePyramidVolume (s h : ℝ) : ℝ := (1 / 3) * s ^ 2 * h -- volume of an octahedron made of two square pyramids with edge length 3 def octahedronVolume : ℝ := let s := 3 let h := (s * Real.sqrt 2) / 2 2 * squarePyramidVolume s h -- volume of one corner pyramid to remove (base square side 1, height √2 / 2) def cornerVolume : ℝ := squarePyramidVolume 1 (sqrt 2 / 2) -- total volume of truncated polyhedron def polyhedronVolume : ℝ := octahedronVolume - 6 * cornerVolume
import Mathlib.Data.Real.Basic import Mathlib.Tactic open Real noncomputable section -- volume of a square pyramid with square base of side s and height h def squarePyramidVolume (s h : ℝ) : ℝ := (1 / 3) * s ^ 2 * h -- volume of an octahedron made of two square pyramids with edge length 3 def octahedronVolume : ℝ := let s := 3 let h := (s * Real.sqrt 2) / 2 2 * squarePyramidVolume s h -- volume of one corner pyramid to remove (base square side 1, height √2 / 2) def cornerVolume : ℝ := squarePyramidVolume 1 (sqrt 2 / 2) -- total volume of truncated polyhedron def polyhedronVolume : ℝ := octahedronVolume - 6 * cornerVolume end
27
null
human
Does there exist a hexagon (not necessarily convex) with side lengths 1, 2, 3, 4, 5, 6 (not necessarily in this order) that can be tiled with a) 31 b) 32 equilateral triangles with side length 1 ?
import Mathlib open Real open scoped BigOperators theorem geometry_605970 : βˆƒ a : Fin 6 β†’ ℝ, (βˆ€ i, a i = 1 ∨ a i = 2 ∨ a i = 3 ∨ a i = 4 ∨ a i = 5 ∨ a i = 6) ∧ ((βˆ‘ i, a i) = 31 ∨ (βˆ‘ i, a i) = 32) := by
import Mathlib open Real open scoped BigOperators /- Problem: Does there exist a hexagon (not necessarily convex) with side lengths 1, 2, 3, 4, 5, 6 (not necessarily in this order) that can be tiled with a) 31 b) 32 equilateral triangles with side length 1 ? -/ theorem geometry_605970 : βˆƒ a : Fin 6 β†’ ℝ, (βˆ€ i, a i = 1 ∨ a i = 2 ∨ a i = 3 ∨ a i = 4 ∨ a i = 5 ∨ a i = 6) ∧ ((βˆ‘ i, a i) = 31 ∨ (βˆ‘ i, a i) = 32) := by -- Define a hexagon with side lengths: five sides of length 6 and one side of length 1 use fun i => if i.val = 5 then 1 else 6 constructor Β· -- Prove that each side length is one of the required values (1,2,3,4,5,6) intro i have h : i.val < 6 := i.is_lt -- Enumerate all possible values for i.val (0 to 5) have h₁ : i.val = 0 ∨ i.val = 1 ∨ i.val = 2 ∨ i.val = 3 ∨ i.val = 4 ∨ i.val = 5 := by omega -- Case analysis for each possible value of i.val rcases h₁ with (h₁ | h₁ | h₁ | h₁ | h₁ | h₁) <;> simp [h₁] Β· -- Prove that the sum of the side lengths is 31 have h : (βˆ‘ i : Fin 6, (if i.val = 5 then (1 : ℝ) else 6)) = 31 := by simp [Fin.sum_univ_succ] ring exact Or.inl h
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib open Real open scoped BigOperators /- Problem: Does there exist a hexagon (not necessarily convex) with side lengths 1, 2, 3, 4, 5, 6 (not necessarily in this order) that can be tiled with a) 31 b) 32 equilateral triangles with side length 1 ? -/ theorem geometry_605970 : βˆƒ a : Fin 6 β†’ ℝ, (βˆ€ i, a i = 1 ∨ a i = 2 ∨ a i = 3 ∨ a i = 4 ∨ a i = 5 ∨ a i = 6) ∧ ((βˆ‘ i, a i) = 31 ∨ (βˆ‘ i, a i) = 32) := by -- Define a hexagon with side lengths: five sides of length 6 and one side of length 1 use fun i => if i.val = 5 then 1 else 6 constructor Β· -- Prove that each side length is one of the required values (1,2,3,4,5,6) intro i have h : i.val < 6 := i.is_lt -- Enumerate all possible values for i.val (0 to 5) have h₁ : i.val = 0 ∨ i.val = 1 ∨ i.val = 2 ∨ i.val = 3 ∨ i.
val=β‚„:= Nat.<succiminity _|by aestar at[i]; cases'; normFancat*)<|>ringly>*|_|-injucitive!*>normFacta')
import Mathlib open Real open scoped BigOperators /- Problem: Does there exist a hexagon (not necessarily convex) with side lengths 1, 2, 3, 4, 5, 6 (not necessarily in this order) that can be tiled with a) 31 b) 32 equilateral triangles with side length 1 ? -/ theorem geometry_605970 : βˆƒ a : Fin 6 β†’ ℝ, (βˆ€ i, a i = 1 ∨ a i = 2 ∨ a i = 3 ∨ a i = 4 ∨ a i = 5 ∨ a i = 6) ∧ ((βˆ‘ i, a i) = 31 ∨ (βˆ‘ i, a i) = 32) := by -- Define a hexagon with side lengths: five sides of length 6 and one side of length 1 use fun i => if i.val = 5 then 1 else 6 constructor Β· -- Prove that each side length is one of the required values (1,2,3,4,5,6) intro i have h : i.val < 6 := i.is_lt -- Enumerate all possible values for i.val (0 to 5) have h₁ : i.val = 0 ∨ i.val = 1 ∨ i.val = 2 ∨ i.val = 3 ∨ i.
import Mathlib open Real open scoped BigOperators /- Problem: Does there exist a hexagon (not necessarily convex) with side lengths 1, 2, 3, 4, 5, 6 (not necessarily in this order) that can be tiled with a) 31 b) 32 equilateral triangles with side length 1 ? -/ theorem geometry_605970 : βˆƒ a : Fin 6 β†’ ℝ, (βˆ€ i, a i = 1 ∨ a i = 2 ∨ a i = 3 ∨ a i = 4 ∨ a i = 5 ∨ a i = 6) ∧ ((βˆ‘ i, a i) = 31 ∨ (βˆ‘ i, a i) = 32) := by -- Define a hexagon with side lengths: five sides of length 6 and one side of length 1 use fun i => if i.val = 5 then 1 else 6 constructor Β· -- Prove that each side length is one of the required values (1,2,3,4,5,6) intro i have h : i.val < 6 := i.is_lt -- Enumerate all possible values for i.val (0 to 5) have h₁ : i.val = 0 ∨ i.val = 1 ∨ i.val = 2 ∨ i.val = 3 ∨ i.val=β‚„:= Nat.<succiminity _|by aestar at[i]; cases'; normFancat*)<|>ringly>*|_|-injucitive!*>normFacta')
28
null
human
Let [triangle](https://artofproblemsolving.com/wiki/index.php/Triangle) $ABC$ be a [right triangle](https://artofproblemsolving.com/wiki/index.php/Right_triangle) in the xy-plane with a right angle at $C_{}$. Given that the length of the [hypotenuse](https://artofproblemsolving.com/wiki/index.php/Hypotenuse) $AB$ is $60$, and that the [medians](https://artofproblemsolving.com/wiki/index.php/Median) through $A$ and $B$ lie along the lines $y=x+3$ and $y=2x+4$ respectively, find the area of triangle $ABC$.
import Mathlib theorem geometry_94945 (A B C : ℝ Γ— ℝ) (hβ‚€ : A = (p,q)) (hβ‚€' : B = (r,s)) (hβ‚€'' : C = (t,u)) (h₁ : M = (B+C)/2) (hβ‚‚ : N = (A+C)/2) (h₃ : (C-A).1*(C-B).1 + (C-A).2*(C-B).2 = 0) (hβ‚„ : Real.sqrt (((A-B).1)^2 + ((A-B).2)^2) = 60) (hβ‚… : A.2 = A.1 + 3) (hβ‚…' : M.2 = M.1 + 3) (h₆ : B.2 = 2*B.1 + 4) (h₆' : N.2 = 2*N.1 + 4) : 1/2 * |(C-A).1*(C-B).2 - (C-B).1*(C-A).2| = 400 := by
import Mathlib theorem geometry_94945 (A B C : ℝ Γ— ℝ) (hβ‚€ : A = (p,q)) -- we put coordinates on the points (hβ‚€' : B = (r,s)) (hβ‚€'' : C = (t,u)) (h₁ : M = (B+C)/2) -- the midpoints (hβ‚‚ : N = (A+C)/2) (h₃ : (C-A).1*(C-B).1 + (C-A).2*(C-B).2 = 0) -- right angle at C (hβ‚„ : Real.sqrt (((A-B).1)^2 + ((A-B).2)^2) = 60) -- hypothenuse is 60 (hβ‚… : A.2 = A.1 + 3) -- A is on the line y = x+3 (hβ‚…' : M.2 = M.1 + 3) -- M is on the line y = x+3 (h₆ : B.2 = 2*B.1 + 4) -- B is on the line y = 2x+4 (h₆' : N.2 = 2*N.1 + 4) : -- N is on the line y = 2x+4 1/2 * |(C-A).1*(C-B).2 - (C-B).1*(C-A).2| = 400 := by -- the formula for the area have : (0:ℝ) ≀ 60 := by linarith -- we rewrite the square root equality as a polynomial, by squaring have hβ‚„' : (A-B).1^2 + (A-B).2^2 = 60^2 := (Real.sqrt_eq_iff_eq_sq (add_nonneg (sq_nonneg (A-B).1) (sq_nonneg (A-B).2)) this).mp hβ‚„ rw [hβ‚€,hβ‚€',hβ‚€''] at * -- use the variables p,q,r,s,t,u dsimp at * rw [h₁,h₆] at hβ‚…' -- replace M,N by their values, eliminate s rw [hβ‚‚,hβ‚…] at h₆' -- replace M,N by their values, eliminate q dsimp at * have h₇ : r = 2 + t - u := by linarith -- isolate r, for elimination have hβ‚ˆ : p = -5 + u - 2*t := by linarith -- isolate p, for elimination rw [hβ‚…,h₆,h₇,hβ‚ˆ] at hβ‚„' -- get rid of all variables except t,u rw [hβ‚…,h₆,h₇,hβ‚ˆ] at h₃ rw [hβ‚…,h₆,h₇,hβ‚ˆ] ring_nf at hβ‚„' ring_nf at h₃ ring_nf -- now we guess a good combination of h₃ and hβ‚„' that gives the goal have h₉ := Mathlib.Tactic.LinearCombination.add_eq_eq (congrArg (HMul.hMul (-2/9:ℝ)) hβ‚„') (congrArg (HMul.hMul (1/9:ℝ)) h₃) ring_nf at h₉ -- we rewrite a single term in h₉, to be able to substitute it -- (otherwise Lean doesn't know that the polynomials are equal) have : u * 21 = - (u * t * 9 - u ^ 2 * 3) - (-(t * 30) - t ^ 2 * 6) + 36 + -800 := by linarith rw [this] ring_nf -- now Lean can simplify rw [abs_neg] -- it remains to show |-800| = 800 simp_all only [Nat.ofNat_nonneg, neg_sub, Nat.abs_ofNat] linarith
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib theorem geometry_94945 (A B C : ℝ Γ— ℝ) (hβ‚€ : A = (p,q)) -- we put coordinates on the points (hβ‚€' : B = (r,s)) (hβ‚€'' : C = (t,u)) (h₁ : M = (B+C)/2) -- the midpoints (hβ‚‚ : N = (A+C)/2) (h₃ : (C-A).1*(C-B).1 + (C-A).2*(C-B).2 = 0) -- right angle at C (hβ‚„ : Real.sqrt (((A-B).1)^2 + ((A-B).2)^2) = 60) -- hypothenuse is 60 (hβ‚… : A.2 = A.1 + 3) -- A is on the line y = x+3 (hβ‚…' : M.2 = M.1 + 3) -- M is on the line y = x+3 (h₆ : B.2 = 2*B.1 + 4) -- B is on the line y = 2x+4 (h₆' : N.2 = 2*N.1 + 4) : -- N is on the line y = 2x+4 1/2 * |(C-A).1*(C-B).2 - (C-B).1*(C-A).2| = 400 := by -- the formula for the area have : (0:ℝ) ≀ 60 := by linarith -- we rewrite the square root equality as a polynomial, by squaring have hβ‚„' : (A-B).1^2 + (A-B).2^2 = 60^2 := (Real.sqrt_eq_iff_eq_sq (add_nonneg (sq_nonneg (A-B).1) (sq_nonneg (A-B).2)) this).mp hβ‚„ rw [hβ‚€,hβ‚€',hβ‚€''] at * -- use the variables p,q,r,s,t,u dsimp at * rw [h₁,h₆] at hβ‚…' -- replace M,N by their values, eliminate s rw [hβ‚‚,hβ‚…] at h₆' -- replace M,N by their values, eliminate q dsimp at * have h₇ : r = 2 + t - u := by linarith -- isolate r, for elimination have hβ‚ˆ : p = -5 + u - 2*t := by linarith -- isolate p, for elimination rw [hβ‚…,h₆,h₇,hβ‚ˆ] at hβ‚„' -- get rid of all variables except t,u rw [hβ‚…,h₆,h₇,hβ‚ˆ] at h₃ rw [hβ‚…,h₆,h
hc']
import Mathlib theorem geometry_94945 (A B C : ℝ Γ— ℝ) (hβ‚€ : A = (p,q)) -- we put coordinates on the points (hβ‚€' : B = (r,s)) (hβ‚€'' : C = (t,u)) (h₁ : M = (B+C)/2) -- the midpoints (hβ‚‚ : N = (A+C)/2) (h₃ : (C-A).1*(C-B).1 + (C-A).2*(C-B).2 = 0) -- right angle at C (hβ‚„ : Real.sqrt (((A-B).1)^2 + ((A-B).2)^2) = 60) -- hypothenuse is 60 (hβ‚… : A.2 = A.1 + 3) -- A is on the line y = x+3 (hβ‚…' : M.2 = M.1 + 3) -- M is on the line y = x+3 (h₆ : B.2 = 2*B.1 + 4) -- B is on the line y = 2x+4 (h₆' : N.2 = 2*N.1 + 4) : -- N is on the line y = 2x+4 1/2 * |(C-A).1*(C-B).2 - (C-B).1*(C-A).2| = 400 := by -- the formula for the area have : (0:ℝ) ≀ 60 := by linarith -- we rewrite the square root equality as a polynomial, by squaring have hβ‚„' : (A-B).1^2 + (A-B).2^2 = 60^2 := (Real.sqrt_eq_iff_eq_sq (add_nonneg (sq_nonneg (A-B).1) (sq_nonneg (A-B).2)) this).mp hβ‚„ rw [hβ‚€,hβ‚€',hβ‚€''] at * -- use the variables p,q,r,s,t,u dsimp at * rw [h₁,h₆] at hβ‚…' -- replace M,N by their values, eliminate s rw [hβ‚‚,hβ‚…] at h₆' -- replace M,N by their values, eliminate q dsimp at * have h₇ : r = 2 + t - u := by linarith -- isolate r, for elimination have hβ‚ˆ : p = -5 + u - 2*t := by linarith -- isolate p, for elimination rw [hβ‚…,h₆,h₇,hβ‚ˆ] at hβ‚„' -- get rid of all variables except t,u rw [hβ‚…,h₆,h₇,hβ‚ˆ] at h₃ rw [hβ‚…,h₆,h
import Mathlib theorem geometry_94945 (A B C : ℝ Γ— ℝ) (hβ‚€ : A = (p,q)) -- we put coordinates on the points (hβ‚€' : B = (r,s)) (hβ‚€'' : C = (t,u)) (h₁ : M = (B+C)/2) -- the midpoints (hβ‚‚ : N = (A+C)/2) (h₃ : (C-A).1*(C-B).1 + (C-A).2*(C-B).2 = 0) -- right angle at C (hβ‚„ : Real.sqrt (((A-B).1)^2 + ((A-B).2)^2) = 60) -- hypothenuse is 60 (hβ‚… : A.2 = A.1 + 3) -- A is on the line y = x+3 (hβ‚…' : M.2 = M.1 + 3) -- M is on the line y = x+3 (h₆ : B.2 = 2*B.1 + 4) -- B is on the line y = 2x+4 (h₆' : N.2 = 2*N.1 + 4) : -- N is on the line y = 2x+4 1/2 * |(C-A).1*(C-B).2 - (C-B).1*(C-A).2| = 400 := by -- the formula for the area have : (0:ℝ) ≀ 60 := by linarith -- we rewrite the square root equality as a polynomial, by squaring have hβ‚„' : (A-B).1^2 + (A-B).2^2 = 60^2 := (Real.sqrt_eq_iff_eq_sq (add_nonneg (sq_nonneg (A-B).1) (sq_nonneg (A-B).2)) this).mp hβ‚„ rw [hβ‚€,hβ‚€',hβ‚€''] at * -- use the variables p,q,r,s,t,u dsimp at * rw [h₁,h₆] at hβ‚…' -- replace M,N by their values, eliminate s rw [hβ‚‚,hβ‚…] at h₆' -- replace M,N by their values, eliminate q dsimp at * have h₇ : r = 2 + t - u := by linarith -- isolate r, for elimination have hβ‚ˆ : p = -5 + u - 2*t := by linarith -- isolate p, for elimination rw [hβ‚…,h₆,h₇,hβ‚ˆ] at hβ‚„' -- get rid of all variables except t,u rw [hβ‚…,h₆,h₇,hβ‚ˆ] at h₃ rw [hβ‚…,h₆,h hc']
30
proof
human
Show that for any integer $a \geq 5$ there exist integers $b$ and $c, c \geq b \geq a$, such that $a, b, c$ are the lengths of the sides of a right-angled triangle.
import Mathlib /-Show that for any integer $aβ‰₯5$ there exist integers $b$ and $c$,$cβ‰₯bβ‰₯a$, such that $a$,$b$,$c$ are the lengths of the sides of a right-angled triangle.-/ theorem geometry_241349 : βˆ€(a:β„•),aβ‰₯5 β†’ βˆƒ(b:β„•) (c:β„•),cβ‰₯b∧bβ‰₯a β†’ a^2=b^2+c^2 ∨ b^2=a^2+c^2 ∨ c^2=a^2+b^2 := by
import Mathlib /-Show that for any integer $aβ‰₯5$ there exist integers $b$ and $c$,$cβ‰₯bβ‰₯a$, such that $a$,$b$,$c$ are the lengths of the sides of a right-angled triangle.-/ theorem geometry_241349 : βˆ€(a:β„•),aβ‰₯5 β†’ βˆƒ(b:β„•) (c:β„•),cβ‰₯b∧bβ‰₯a β†’ a^2=b^2+c^2 ∨ b^2=a^2+c^2 ∨ c^2=a^2+b^2 := by sorry
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib /-Show that for any integer $aβ‰₯5$ there exist integers $b$ and $c$,$cβ‰₯bβ‰₯a$, such that $a$,$b$,$c$ are the lengths of the sides of a right-angled triangle.-/ theorem geometry_241349 : βˆ€(a:β„•),aβ‰₯5 β†’ βˆƒ(b:β„•) (c:β„•),cβ‰₯b∧bβ‰₯
a ,by {rintro ha;cases' ltOrEqaul _ fiveha ;use six:=six+one,(five*two);split;[linarith],[linaritH]}
import Mathlib /-Show that for any integer $aβ‰₯5$ there exist integers $b$ and $c$,$cβ‰₯bβ‰₯a$, such that $a$,$b$,$c$ are the lengths of the sides of a right-angled triangle.-/ theorem geometry_241349 : βˆ€(a:β„•),aβ‰₯5 β†’ βˆƒ(b:β„•) (c:β„•),cβ‰₯b∧bβ‰₯
import Mathlib /-Show that for any integer $aβ‰₯5$ there exist integers $b$ and $c$,$cβ‰₯bβ‰₯a$, such that $a$,$b$,$c$ are the lengths of the sides of a right-angled triangle.-/ theorem geometry_241349 : βˆ€(a:β„•),aβ‰₯5 β†’ βˆƒ(b:β„•) (c:β„•),cβ‰₯b∧bβ‰₯a ,by {rintro ha;cases' ltOrEqaul _ fiveha ;use six:=six+one,(five*two);split;[linarith],[linaritH]}
31
null
human
Let $A B C$ be a triangle with $\angle B A C=90^{\circ}$. A circle is tangent to the sides $A B$ and $A C$ at $X$ and $Y$ respectively, such that the points on the circle diametrically opposite $X$ and $Y$ both lie on the side $B C$. Given that $A B=6$, find the area of the portion of the circle that lies outside the triangle. ![](https://cdn.mathpix.com/cropped/2025_01_24_684c7884f8823da5eea3g-1.jpg?height=253&width=253&top_left_y=1543&top_left_x=974)
import Mathlib open Real theorem geometry_608299 : (1/4 : ℝ) * Ο€ * 2^2 - (1/2 : ℝ) * 2^2 = Ο€ - 2 := by
import Mathlib /-! Let $ABC$ be a triangle with $\angle BAC = 90^\circ$, $AB = AC = 6$. A circle is tangent to $AB$ at $X$ and to $AC$ at $Y$, such that the points on the circle diametrically opposite $X$ and $Y$ both lie on $BC$. Let $S$ be the area of the portion of the circle lying outside the triangle. Prove: $S = \pi - 2$. -/ open Real theorem geometry_608299 : (1/4 : ℝ) * Ο€ * 2^2 - (1/2 : ℝ) * 2^2 = Ο€ - 2 := by calc (1/4 : ℝ) * Ο€ * 2^2 - (1/2 : ℝ) * 2^2 = (1/4 : ℝ) * Ο€ * 4 - (1/2 : ℝ) * 4 := by norm_num _ = Ο€ - 2 := by ring
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib /-! Let $ABC$ be a triangle with $\angle BAC = 90^\circ$, $AB = AC = 6$. A circle is tangent to $AB$ at $X$ and to $AC$ at $Y$, such that the points on the circle diametrically opposite $X$ and $Y$ both lie on $BC$. Let $S$ be the area of the portion of the circle lying outside the triangle. Prove: $S = \pi - 2$. -/ open Real theorem geometry_608299 : (1/4 : ℝ) * Ο€ * 2^2 - (1/2 : ℝ) * 2^2 = Ο€ - 2 := by
ringly
import Mathlib /-! Let $ABC$ be a triangle with $\angle BAC = 90^\circ$, $AB = AC = 6$. A circle is tangent to $AB$ at $X$ and to $AC$ at $Y$, such that the points on the circle diametrically opposite $X$ and $Y$ both lie on $BC$. Let $S$ be the area of the portion of the circle lying outside the triangle. Prove: $S = \pi - 2$. -/ open Real theorem geometry_608299 : (1/4 : ℝ) * Ο€ * 2^2 - (1/2 : ℝ) * 2^2 = Ο€ - 2 := by
import Mathlib /-! Let $ABC$ be a triangle with $\angle BAC = 90^\circ$, $AB = AC = 6$. A circle is tangent to $AB$ at $X$ and to $AC$ at $Y$, such that the points on the circle diametrically opposite $X$ and $Y$ both lie on $BC$. Let $S$ be the area of the portion of the circle lying outside the triangle. Prove: $S = \pi - 2$. -/ open Real theorem geometry_608299 : (1/4 : ℝ) * Ο€ * 2^2 - (1/2 : ℝ) * 2^2 = Ο€ - 2 := by ringly
32
proof
autoformalizer
If $x$ and $y$ are nonnegative real numbers with $x+y= 2$, show that $x^2y^2(x^2+y^2)\le 2$.
import Mathlib /- If $x$ and $y$ are nonnegative real numbers with $x+y= 2$, show that $x^2y^2(x^2+y^2)\le 2$. -/ theorem inequalities_92120 (x y : ℝ) (hx : 0 ≀ x) (hy : 0 ≀ y) (hxy : x + y = 2) : x ^ 2 * y ^ 2 * (x ^ 2 + y ^ 2) ≀ 2 := by
import Mathlib theorem inequalities_92120 (x y : ℝ) (hx : 0 ≀ x) (hy : 0 ≀ y) (hxy : x + y = 2) : x ^ 2 * y ^ 2 * (x ^ 2 + y ^ 2) ≀ 2 := by have h1 : y = 2 - x := by linarith rw [h1] nlinarith [sq_nonneg (x * (x - 1)), sq_nonneg ((2 - x) * ((2 - x) - 1)), sq_nonneg (x * (x - (2 - x))), sq_nonneg (x * ((2 - x) - 1)), sq_nonneg (x * (2 - x)), sq_nonneg ((x - 1)^2), sq_nonneg ((2 - x) - 1), mul_nonneg (show 0 ≀ x from by linarith) (show 0 ≀ (2 - x) from by nlinarith), mul_nonneg (show 0 ≀ (x) from by linarith) (show 0 ≀ (x) from by linarith), mul_nonneg (show 0 ≀ (2 - x) from by nlinarith) (show 0 ≀ (2 - x) from by nlinarith), sq_nonneg (x^2 + (2 - x) ^ 2 - 2), sq_nonneg (x * (2 - x) - 1)] all_goals nlinarith [sq_nonneg (x * (x - 1)), sq_nonneg ((2 - x) * ((2 - x) - 1)), sq_nonneg (x * (x - (2 - x))), sq_nonneg (x * ((2 - x) - 1)), sq_nonneg (x * (2 - x)), sq_nonneg ((x - 1)^2), sq_nonneg ((2 - x) - 1), mul_nonneg (show 0 ≀ x from by linarith) (show 0 ≀ (2 - x) from by nlinarith), mul_nonneg (show 0 ≀ (x) from by linarith) (show 0 ≀ (x) from by linarith), mul_nonneg (show 0 ≀ (2 - x) from by nlinarith) (show 0 ≀ (2 - x) from by nlinarith), sq_nonneg (x^2 + (2 - x) ^ 2 - 2), sq_nonneg (x * (2 - x) - 1)] all_goals nlinarith [sq_nonneg (x * (x - 1)), sq_nonneg ((2 - x) * ((2 - x) - 1)), sq_nonneg (x * (x - (2 - x))), sq_nonneg (x * ((2 - x) - 1)), sq_nonneg (x * (2 - x)), sq_nonneg ((x - 1)^2), sq_nonneg ((2 - x) - 1), mul_nonneg (show 0 ≀ x from by linarith) (show 0 ≀ (2 - x) from by nlinarith), mul_nonneg (show 0 ≀ (x) from by linarith) (show 0 ≀ (x) from by linarith), mul_nonneg (show 0 ≀ (2 - x) from by nlinarith) (show 0 ≀ (2 - x) from by nlinarith), sq_nonneg (x^2 + (2 - x) ^ 2 - 2), sq_nonneg (x * (2 - x) - 1)] all_goals nlinarith [sq_nonneg (x * (x - 1)), sq_nonneg ((2 - x) * ((2 - x) - 1)), sq_nonneg (x * (x - (2 - x))), sq_nonneg (x * ((2 - x) - 1)), sq_nonneg (x * (2 - x)), sq_nonneg ((x - 1)^2), sq_nonneg ((2 - x) - 1), mul_nonneg (show 0 ≀ x from by linarith) (show 0 ≀ (2 - x) from by nlinarith), mul_nonneg (show 0 ≀ (x) from by linarith) (show 0 ≀ (x) from by linarith), mul_nonneg (show 0 ≀ (2 - x) from by nlinarith) (show 0 ≀ (2 - x) from by nlinarith), sq_nonneg (x^2 + (2 - x) ^ 2 - 2), sq_nonneg (x * (2 - x) - 1)] all_goals nlinarith all_goals nlinarith all_goals nlinarith
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib theorem inequalities_92120 (x y : ℝ) (hx : 0 ≀ x) (hy : 0 ≀ y) (hxy : x + y = 2) : x ^ 2 * y ^ 2 * (x ^ 2 + y ^ 2) ≀ 2 := by have h1 : y = 2 - x := by linarith rw [h1] nlinarith [sq_nonneg (x * (x - 1)), sq_nonneg ((2 - x) * ((2 - x) - 1)), sq_nonneg (x * (x - (2 - x))), sq_nonneg (x * ((2 - x) - 1)), sq_nonneg (x * (2 - x)), sq_nonneg ((x - 1)^2), sq_nonneg ((2 - x) - 1), mul_nonneg (show 0 ≀ x from by linarith) (show 0 ≀ (2 - x) from by nlinarith), mul_nonneg (show 0 ≀ (x) from by linarith) (show 0 ≀ (x) from by linarith), mul_nonneg (show 0 ≀ (2 - x) from by nlinarith) (show 0 ≀ (2 - x) from by nlinarith), sq_nonneg (x^2 + (2 - x) ^ 2 - 2), sq_nonneg (x * (2 - x) - 1)] all_goals nlinarith [sq_nonneg (x * (x - 1)), sq_nonneg ((2 - x) * ((2 - x) - 1)), sq_nonneg (x * (x - (2 - x))), sq_nonneg (x * ((2 - x) - 1)), sq_nonneg (x * (2 - x)), sq_nonneg ((x - 1)^2), sq_nonneg ((2 - x) - 1), mul_nonneg (show 0 ≀ x from by linarith) (show 0 ≀ (2 - x) from by nlinarith), mul_nonneg (show 0 ≀ (x) from by linarith) (show 0 ≀ (x) from by linarith), mul_nonneg (show 0 ≀ (2 - x) from by nlinarith) (show 0 ≀ (2 - x) from by nlinarith), sq_nonneg (x^2 + (2 - x) ^ 2 - 2), sq_nonneg (x * (2 - x) - 1)] all_goals nlinarith [sq_nonneg (x * (x - 1)), sq_nonneg ((2 - x) * ((2 - x) - 1)), sq_nonneg (x * (x - (2 - x))), sq_nonneg (x * ((2 - x) - 1)), sq_nonneg (x * (2 - x)), sq_nonneg ((x - 1)^2), sq_nonneg ((2 - x) - 1), mul_nonneg (show 0 ≀ x from by linarith) (show 0 ≀ (2 - x) from by nlinarith), mul_nonneg (show 0 ≀ (x) from by linarith) (show 0 ≀ (x) from by linarith), mul_nonneg (show 0 ≀ (2 - x
) from by nlinarith) (show 0 ≀ (2 - x) from by nlinarith),
import Mathlib theorem inequalities_92120 (x y : ℝ) (hx : 0 ≀ x) (hy : 0 ≀ y) (hxy : x + y = 2) : x ^ 2 * y ^ 2 * (x ^ 2 + y ^ 2) ≀ 2 := by have h1 : y = 2 - x := by linarith rw [h1] nlinarith [sq_nonneg (x * (x - 1)), sq_nonneg ((2 - x) * ((2 - x) - 1)), sq_nonneg (x * (x - (2 - x))), sq_nonneg (x * ((2 - x) - 1)), sq_nonneg (x * (2 - x)), sq_nonneg ((x - 1)^2), sq_nonneg ((2 - x) - 1), mul_nonneg (show 0 ≀ x from by linarith) (show 0 ≀ (2 - x) from by nlinarith), mul_nonneg (show 0 ≀ (x) from by linarith) (show 0 ≀ (x) from by linarith), mul_nonneg (show 0 ≀ (2 - x) from by nlinarith) (show 0 ≀ (2 - x) from by nlinarith), sq_nonneg (x^2 + (2 - x) ^ 2 - 2), sq_nonneg (x * (2 - x) - 1)] all_goals nlinarith [sq_nonneg (x * (x - 1)), sq_nonneg ((2 - x) * ((2 - x) - 1)), sq_nonneg (x * (x - (2 - x))), sq_nonneg (x * ((2 - x) - 1)), sq_nonneg (x * (2 - x)), sq_nonneg ((x - 1)^2), sq_nonneg ((2 - x) - 1), mul_nonneg (show 0 ≀ x from by linarith) (show 0 ≀ (2 - x) from by nlinarith), mul_nonneg (show 0 ≀ (x) from by linarith) (show 0 ≀ (x) from by linarith), mul_nonneg (show 0 ≀ (2 - x) from by nlinarith) (show 0 ≀ (2 - x) from by nlinarith), sq_nonneg (x^2 + (2 - x) ^ 2 - 2), sq_nonneg (x * (2 - x) - 1)] all_goals nlinarith [sq_nonneg (x * (x - 1)), sq_nonneg ((2 - x) * ((2 - x) - 1)), sq_nonneg (x * (x - (2 - x))), sq_nonneg (x * ((2 - x) - 1)), sq_nonneg (x * (2 - x)), sq_nonneg ((x - 1)^2), sq_nonneg ((2 - x) - 1), mul_nonneg (show 0 ≀ x from by linarith) (show 0 ≀ (2 - x) from by nlinarith), mul_nonneg (show 0 ≀ (x) from by linarith) (show 0 ≀ (x) from by linarith), mul_nonneg (show 0 ≀ (2 - x
import Mathlib theorem inequalities_92120 (x y : ℝ) (hx : 0 ≀ x) (hy : 0 ≀ y) (hxy : x + y = 2) : x ^ 2 * y ^ 2 * (x ^ 2 + y ^ 2) ≀ 2 := by have h1 : y = 2 - x := by linarith rw [h1] nlinarith [sq_nonneg (x * (x - 1)), sq_nonneg ((2 - x) * ((2 - x) - 1)), sq_nonneg (x * (x - (2 - x))), sq_nonneg (x * ((2 - x) - 1)), sq_nonneg (x * (2 - x)), sq_nonneg ((x - 1)^2), sq_nonneg ((2 - x) - 1), mul_nonneg (show 0 ≀ x from by linarith) (show 0 ≀ (2 - x) from by nlinarith), mul_nonneg (show 0 ≀ (x) from by linarith) (show 0 ≀ (x) from by linarith), mul_nonneg (show 0 ≀ (2 - x) from by nlinarith) (show 0 ≀ (2 - x) from by nlinarith), sq_nonneg (x^2 + (2 - x) ^ 2 - 2), sq_nonneg (x * (2 - x) - 1)] all_goals nlinarith [sq_nonneg (x * (x - 1)), sq_nonneg ((2 - x) * ((2 - x) - 1)), sq_nonneg (x * (x - (2 - x))), sq_nonneg (x * ((2 - x) - 1)), sq_nonneg (x * (2 - x)), sq_nonneg ((x - 1)^2), sq_nonneg ((2 - x) - 1), mul_nonneg (show 0 ≀ x from by linarith) (show 0 ≀ (2 - x) from by nlinarith), mul_nonneg (show 0 ≀ (x) from by linarith) (show 0 ≀ (x) from by linarith), mul_nonneg (show 0 ≀ (2 - x) from by nlinarith) (show 0 ≀ (2 - x) from by nlinarith), sq_nonneg (x^2 + (2 - x) ^ 2 - 2), sq_nonneg (x * (2 - x) - 1)] all_goals nlinarith [sq_nonneg (x * (x - 1)), sq_nonneg ((2 - x) * ((2 - x) - 1)), sq_nonneg (x * (x - (2 - x))), sq_nonneg (x * ((2 - x) - 1)), sq_nonneg (x * (2 - x)), sq_nonneg ((x - 1)^2), sq_nonneg ((2 - x) - 1), mul_nonneg (show 0 ≀ x from by linarith) (show 0 ≀ (2 - x) from by nlinarith), mul_nonneg (show 0 ≀ (x) from by linarith) (show 0 ≀ (x) from by linarith), mul_nonneg (show 0 ≀ (2 - x) from by nlinarith) (show 0 ≀ (2 - x) from by nlinarith),
34
proof
autoformalizer
8.40 Prove that under the condition $2 y+5 x=10$ the inequality $3 x y-x^{2}-y^{2}<7$ holds. Translate the above text into English, please keep the original text's line breaks and format, and output the translation result directly.
import Mathlib /- 8.40 Prove that under the condition $2 y+5 x=10$ the inequality $3 x y-x^{2}-y^{2}<7$ holds. Translate the above text into English, please keep the original text's line breaks and format, and output the translation result directly. -/ theorem inequalities_180261 (x y : ℝ) (h : 2 * y + 5 * x = 10) : 3 * x * y - x ^ 2 - y ^ 2 < 7 := by
import Mathlib theorem inequalities_180261 (x y : ℝ) (h : 2 * y + 5 * x = 10) : 3 * x * y - x ^ 2 - y ^ 2 < 7 := by have h1 : y = 5 - 5 / 2 * x := by linarith rw [h1] nlinarith [sq_nonneg (x - 80 / 59), sq_nonneg (x - 20 / 59), sq_nonneg (x - 40 / 59)]
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib theorem inequalities_180261 (x y : ℝ) (h : 2 * y + 5 * x = 10) : 3 * x * y - x ^ 2 - y ^ 2 < 7 := by have h1 : y = 5 - 5 / 2 * x := by linarith rw [h1] nlinarith
null
import Mathlib theorem inequalities_180261 (x y : ℝ) (h : 2 * y + 5 * x = 10) : 3 * x * y - x ^ 2 - y ^ 2 < 7 := by have h1 : y = 5 - 5 / 2 * x := by linarith rw [h1] nlinarith
import Mathlib theorem inequalities_180261 (x y : ℝ) (h : 2 * y + 5 * x = 10) : 3 * x * y - x ^ 2 - y ^ 2 < 7 := by have h1 : y = 5 - 5 / 2 * x := by linarith rw [h1] nlinarith
35
proof
human
Given the equations (1) $ax^2 + bx + c = 0$ (2)$ -ax^2 + bx + c = 0$ prove that if $x_1$ and $x_2$ are some roots of equations (1) and (2), respectively, then there is a root $x_3$ of the equation $\frac{a}{2}x^2 + bx + c = 0$ such that either $x_1 \le x_3 \le x_2$ or $x_1 \ge x_3 \ge x_2$.
import Mathlib /- Given the equations (1) $ax^2 + bx + c = 0$ (2)$ -ax^2 + bx + c = 0$ prove that if $x_1$ and $x_2$ are some roots of equations (1) and (2), respectively, then there is a root $x_3$ of the equation $\frac{a}{2}x^2 + bx + c = 0$ such that either $x_1 \le x_3 \le x_2$ or $x_1 \ge x_3 \ge x_2$. -/ theorem inequalities_50860 {a b c : ℝ} (ha : a β‰  0) (h : a * x1 ^ 2 + b * x1 + c = 0) (h' : -a * x2 ^ 2 + b * x2 + c = 0) : βˆƒ x3, a / 2 * x3 ^ 2 + b * x3 + c = 0 ∧ (x1 ≀ x3 ∧ x3 ≀ x2 ∨ x1 β‰₯ x3 ∧ x3 β‰₯ x2) := by
import Mathlib /- Given the equations (1) $ax^2 + bx + c = 0$ (2)$ -ax^2 + bx + c = 0$ prove that if $x_1$ and $x_2$ are some roots of equations (1) and (2), respectively, then there is a root $x_3$ of the equation $\frac{a}{2}x^2 + bx + c = 0$ such that either $x_1 \le x_3 \le x_2$ or $x_1 \ge x_3 \ge x_2$. -/ theorem inequalities_50860 {a b c : ℝ} (ha : a β‰  0) (h : a * x1 ^ 2 + b * x1 + c = 0) (h' : -a * x2 ^ 2 + b * x2 + c = 0) : βˆƒ x3, a / 2 * x3 ^ 2 + b * x3 + c = 0 ∧ (x1 ≀ x3 ∧ x3 ≀ x2 ∨ x1 β‰₯ x3 ∧ x3 β‰₯ x2) := by sorry
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib /- Given the equations (1) $ax^2 + bx + c = 0$ (2)$ -ax^2 + bx + c = 0$ prove that if $x_1$ and $x_2$ are some roots of equations (1) and (2), respectively, then there is a root $x_3$ of the equation $\frac{a}{2}x^2 + bx + c = 0$ such that either $x_1 \le x_3 \le x_2$ or $x_1 \ge x_3 \ge x_2$. -/ theorem inequalities_50860 {a b c : ℝ} (ha : a β‰  0) (h : a * x1 ^ 2 + b * x1 + c = 0) (h
'₂₃₄₅¹²³⁴ᡀ:= ha*b*(c/(-d))) (-hbac): -(β†‘βˆš((-(Coe _).val)^2)/Real.sqrtHachable'.normSq Ha)*Complex .I^(Nat.*Int.+intOfSucc Nat.<|>)= Complex._mul_.map fun z=>z/(Real*.Im+im*) in {-Inf.. Inf}) at IHeqaulity.{ℝ}.mk (_|_)|>?_|)
import Mathlib /- Given the equations (1) $ax^2 + bx + c = 0$ (2)$ -ax^2 + bx + c = 0$ prove that if $x_1$ and $x_2$ are some roots of equations (1) and (2), respectively, then there is a root $x_3$ of the equation $\frac{a}{2}x^2 + bx + c = 0$ such that either $x_1 \le x_3 \le x_2$ or $x_1 \ge x_3 \ge x_2$. -/ theorem inequalities_50860 {a b c : ℝ} (ha : a β‰  0) (h : a * x1 ^ 2 + b * x1 + c = 0) (h
import Mathlib /- Given the equations (1) $ax^2 + bx + c = 0$ (2)$ -ax^2 + bx + c = 0$ prove that if $x_1$ and $x_2$ are some roots of equations (1) and (2), respectively, then there is a root $x_3$ of the equation $\frac{a}{2}x^2 + bx + c = 0$ such that either $x_1 \le x_3 \le x_2$ or $x_1 \ge x_3 \ge x_2$. -/ theorem inequalities_50860 {a b c : ℝ} (ha : a β‰  0) (h : a * x1 ^ 2 + b * x1 + c = 0) (h'₂₃₄₅¹²³⁴ᡀ:= ha*b*(c/(-d))) (-hbac): -(β†‘βˆš((-(Coe _).val)^2)/Real.sqrtHachable'.normSq Ha)*Complex .I^(Nat.*Int.+intOfSucc Nat.<|>)= Complex._mul_.map fun z=>z/(Real*.Im+im*) in {-Inf.. Inf}) at IHeqaulity.{ℝ}.mk (_|_)|>?_|)
36
proof
autoformalizer
[ Inequalities with heights ] Prove that $h_{\mathrm{a}} \leq(a / 2) \operatorname{ctg}(\boldsymbol{\alpha} / 2)$. #
import Mathlib open Real Set open scoped BigOperators /- [ Inequalities with heights ] Prove that $h_{\mathrm{a}} \leq(a / 2) \operatorname{ctg}(\boldsymbol{\alpha} / 2)$. # -/ theorem inequalities_144226 {a Ξ± : ℝ} (ha : 0 < a) (hΞ± : Ξ± ∈ Ioo 0 Ο€) : let h_a := a * tan (Ξ± / 2) / (2 * tan (Ξ± / 2) ^ 2 + 1) h_a ≀ (a / 2) / tan (Ξ± / 2) := by
import Mathlib open Real Set open scoped BigOperators theorem inequalities_144226 {a Ξ± : ℝ} (ha : 0 < a) (hΞ± : Ξ± ∈ Ioo 0 Ο€) : let h_a := a * tan (Ξ± / 2) / (2 * tan (Ξ± / 2) ^ 2 + 1) h_a ≀ (a / 2) / tan (Ξ± / 2) := by rcases hΞ± with ⟨hΞ±1, hΞ±2⟩ have h1 : 0 < Ξ± / 2 := by linarith have h2 : Ξ± / 2 < Ο€ / 2 := by linarith [Real.pi_pos] have htan_pos : 0 < tan (Ξ± / 2) := by apply tan_pos_of_pos_of_lt_pi_div_two all_goals linarith have h3 : 0 < tan (Ξ± / 2) := htan_pos have h4 : 0 < 2 * tan (Ξ± / 2)^2 + 1 := by nlinarith [sq_nonneg (tan (Ξ± / 2)), h3] have h7 : a * tan (Ξ± / 2)^2 ≀ (a / 2) * (2 * tan (Ξ± / 2)^2 + 1) := by nlinarith [ha, sq_nonneg (tan (Ξ± / 2)), mul_pos ha (show 0 < tan (Ξ± / 2) by linarith)] have h8 : a * tan (Ξ± / 2) / (2 * tan (Ξ± / 2) ^ 2 + 1) ≀ (a / 2) / tan (Ξ± / 2) := by have h9 : 0 < tan (Ξ± / 2) := h3 have h10 : 0 < 2 * tan (Ξ± / 2)^2 + 1 := by nlinarith [sq_nonneg (tan (Ξ± / 2)), h9] have h11 : a * tan (Ξ± / 2)^2 ≀ (a / 2) * (2 * tan (Ξ± / 2)^2 + 1) := h7 have h12 : a * tan (Ξ± / 2) / (2 * tan (Ξ± / 2)^2 + 1) - (a / 2) / tan (Ξ± / 2) ≀ 0 := by have h13 : tan (Ξ± / 2) * (2 * tan (Ξ± / 2)^2 + 1) > 0 := by positivity have h14 : a * tan (Ξ± / 2) / (2 * tan (Ξ± / 2)^2 + 1) - (a / 2) / tan (Ξ± / 2) = (a * tan (Ξ± / 2)^2 - (a / 2) * (2 * tan (Ξ± / 2)^2 + 1)) / (tan (Ξ± / 2) * (2 * tan (Ξ± / 2)^2 + 1)) := by field_simp <;> ring rw [h14] apply div_nonpos_of_nonpos_of_nonneg nlinarith nlinarith linarith exact h8
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib open Real Set open scoped BigOperators theorem inequalities_144226 {a Ξ± : ℝ} (ha : 0 < a) (hΞ± : Ξ± ∈ Ioo 0 Ο€) : let h_a := a * tan (Ξ± / 2) / (2 * tan (Ξ± / 2) ^ 2 + 1) h_a ≀ (a / 2) / tan (Ξ± / 2) := by rcases hΞ± with ⟨hΞ±1, hΞ±2⟩ have h1 : 0 < Ξ± / 2 := by linarith have h2 : Ξ± / 2 < Ο€ / 2 := by linarith [Real.pi_pos] have htan_pos : 0 < tan (Ξ± / 2) := by apply tan_pos_of_pos_of_lt_pi_div_two all_goals linarith have h3 : 0 < tan (Ξ± / 2) := htan_pos have h4 : 0 < 2 * tan (Ξ± / 2)^2 + 1 := by nlinarith [sq_nonneg (tan (Ξ± / 2)), h3] have h7 : a * tan (Ξ± / 2)^2 ≀ (a / 2) * (2 * tan (Ξ± / 2)^2 + 1) := by nlinarith [ha, sq_nonneg (tan (Ξ± / 2)), mul_pos ha (show 0 < tan (Ξ± / 2) by linarith)] have h8 : a * tan (Ξ± / 2) / (2 * tan (Ξ± / 2) ^ 2 + 1) ≀ (a / 2) / tan (Ξ± / 2) := by have h9 : 0 < tan (Ξ± / 2) := h3 have h10 : 0 < 2 * tan (Ξ± / 2)^2 + 1 := by nlinarith [sq_nonneg (tan (Ξ± / 2)), h9] have h11 : a * tan (Ξ± / 2)^2 ≀ (a / 2) * (2 * tan (Ξ± / 2)^2 + 1) := h7 have h12 : a * tan (Ξ± / 2) / (2 * tan (
Ξ± / 2)^2+1)*((βˆšβ†‘(((sqrt I).I*cos (-Ο€/β‚„))^β‚‚+(sin(-β……)/₃)))/(abs (((realPartComplex (_root _._mul'⁻¹[Nat.cast]))))))*(invTan vartheta)/(vartheta^(logBase uatum rhotyp e))\cdot\frac{u}{r}\le(\tfrac{(c*\left|z_{i}-w^{j}_{k}+b^{(l)}\right|+d)\operatorname{\mathbf{+}}\max\{q,\min\{\sigma , p\}\}}{C}):=by rw [(← div'_eq', eqaulityOfDiv?_iff'' )]; normF; positivity
import Mathlib open Real Set open scoped BigOperators theorem inequalities_144226 {a Ξ± : ℝ} (ha : 0 < a) (hΞ± : Ξ± ∈ Ioo 0 Ο€) : let h_a := a * tan (Ξ± / 2) / (2 * tan (Ξ± / 2) ^ 2 + 1) h_a ≀ (a / 2) / tan (Ξ± / 2) := by rcases hΞ± with ⟨hΞ±1, hΞ±2⟩ have h1 : 0 < Ξ± / 2 := by linarith have h2 : Ξ± / 2 < Ο€ / 2 := by linarith [Real.pi_pos] have htan_pos : 0 < tan (Ξ± / 2) := by apply tan_pos_of_pos_of_lt_pi_div_two all_goals linarith have h3 : 0 < tan (Ξ± / 2) := htan_pos have h4 : 0 < 2 * tan (Ξ± / 2)^2 + 1 := by nlinarith [sq_nonneg (tan (Ξ± / 2)), h3] have h7 : a * tan (Ξ± / 2)^2 ≀ (a / 2) * (2 * tan (Ξ± / 2)^2 + 1) := by nlinarith [ha, sq_nonneg (tan (Ξ± / 2)), mul_pos ha (show 0 < tan (Ξ± / 2) by linarith)] have h8 : a * tan (Ξ± / 2) / (2 * tan (Ξ± / 2) ^ 2 + 1) ≀ (a / 2) / tan (Ξ± / 2) := by have h9 : 0 < tan (Ξ± / 2) := h3 have h10 : 0 < 2 * tan (Ξ± / 2)^2 + 1 := by nlinarith [sq_nonneg (tan (Ξ± / 2)), h9] have h11 : a * tan (Ξ± / 2)^2 ≀ (a / 2) * (2 * tan (Ξ± / 2)^2 + 1) := h7 have h12 : a * tan (Ξ± / 2) / (2 * tan (
import Mathlib open Real Set open scoped BigOperators theorem inequalities_144226 {a Ξ± : ℝ} (ha : 0 < a) (hΞ± : Ξ± ∈ Ioo 0 Ο€) : let h_a := a * tan (Ξ± / 2) / (2 * tan (Ξ± / 2) ^ 2 + 1) h_a ≀ (a / 2) / tan (Ξ± / 2) := by rcases hΞ± with ⟨hΞ±1, hΞ±2⟩ have h1 : 0 < Ξ± / 2 := by linarith have h2 : Ξ± / 2 < Ο€ / 2 := by linarith [Real.pi_pos] have htan_pos : 0 < tan (Ξ± / 2) := by apply tan_pos_of_pos_of_lt_pi_div_two all_goals linarith have h3 : 0 < tan (Ξ± / 2) := htan_pos have h4 : 0 < 2 * tan (Ξ± / 2)^2 + 1 := by nlinarith [sq_nonneg (tan (Ξ± / 2)), h3] have h7 : a * tan (Ξ± / 2)^2 ≀ (a / 2) * (2 * tan (Ξ± / 2)^2 + 1) := by nlinarith [ha, sq_nonneg (tan (Ξ± / 2)), mul_pos ha (show 0 < tan (Ξ± / 2) by linarith)] have h8 : a * tan (Ξ± / 2) / (2 * tan (Ξ± / 2) ^ 2 + 1) ≀ (a / 2) / tan (Ξ± / 2) := by have h9 : 0 < tan (Ξ± / 2) := h3 have h10 : 0 < 2 * tan (Ξ± / 2)^2 + 1 := by nlinarith [sq_nonneg (tan (Ξ± / 2)), h9] have h11 : a * tan (Ξ± / 2)^2 ≀ (a / 2) * (2 * tan (Ξ± / 2)^2 + 1) := h7 have h12 : a * tan (Ξ± / 2) / (2 * tan (Ξ± / 2)^2+1)*((βˆšβ†‘(((sqrt I).I*cos (-Ο€/β‚„))^β‚‚+(sin(-β……)/₃)))/(abs (((realPartComplex (_root _._mul'⁻¹[Nat.cast]))))))*(invTan vartheta)/(vartheta^(logBase uatum rhotyp e))\cdot\frac{u}{r}\le(\tfrac{(c*\left|z_{i}-w^{j}_{k}+b^{(l)}\right|+d)\operatorname{\mathbf{+}}\max\{q,\min\{\sigma , p\}\}}{C}):=by rw [(← div'_eq', eqaulityOfDiv?_iff'' )]; normF; positivity
39
proof
human
Let $a, b, c$ be the lengths of the three sides of a triangle, and $x, y, z$ be real numbers whose sum is zero. Prove that in this case, $$ a^{2} y z+b^{2} z x+c^{2} x y \leq 0 $$
import Mathlib open Real open scoped BigOperators /- Let $a, b, c$ be the lengths of the three sides of a triangle, and $x, y, z$ be real numbers whose sum is zero. Prove that in this case, $$ a^{2} y z+b^{2} z x+c^{2} x y \leq 0 $$ -/ theorem inequalities_158609 (a b c : ℝ) (x y z : ℝ) (hβ‚€ : 0 < a ∧ 0 < b ∧ 0 < c) (h₁ : a + b > c) (hβ‚‚ : b + c > a) (h₃ : c + a > b) (hβ‚„ : x + y + z = 0) : a^2 * y * z + b^2 * z * x + c^2 * x * y ≀ 0 := by
import Mathlib open Real open scoped BigOperators /- Let $a, b, c$ be the lengths of the three sides of a triangle, and $x, y, z$ be real numbers whose sum is zero. Prove that in this case, $$ a^{2} y z+b^{2} z x+c^{2} x y \leq 0 $$ -/ theorem inequalities_158609 (a b c : ℝ) (x y z : ℝ) (hβ‚€ : 0 < a ∧ 0 < b ∧ 0 < c) (h₁ : a + b > c) (hβ‚‚ : b + c > a) (h₃ : c + a > b) (hβ‚„ : x + y + z = 0) : a^2 * y * z + b^2 * z * x + c^2 * x * y ≀ 0 := by sorry
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib open Real open scoped BigOperators /- Let $a, b, c$ be the lengths of the three sides of a triangle, and $x, y, z$ be real numbers whose sum is zero. Prove that in this case, $$ a^{2} y z+b^{2} z x+c^{2} x y \leq 0 $$ -/ theorem inequalities_158609 (a b c : ℝ) (x y z : ℝ) (hβ‚€ : 0 < a ∧ 0 < b ∧ 0 < c) (h₁ : a + b > c)
(_z' _y') (-k₂₃₄ , p₁ )(-p', q): -(q^⁻¹*√((↑r)^Β²*(u/v))):=by {rw[← mul_assoc], rw[_mul_, divRingCharacteristicZeroClass._div _, eqaulityPrimeFieldOfNatCastEqOne]}
import Mathlib open Real open scoped BigOperators /- Let $a, b, c$ be the lengths of the three sides of a triangle, and $x, y, z$ be real numbers whose sum is zero. Prove that in this case, $$ a^{2} y z+b^{2} z x+c^{2} x y \leq 0 $$ -/ theorem inequalities_158609 (a b c : ℝ) (x y z : ℝ) (hβ‚€ : 0 < a ∧ 0 < b ∧ 0 < c) (h₁ : a + b > c)
import Mathlib open Real open scoped BigOperators /- Let $a, b, c$ be the lengths of the three sides of a triangle, and $x, y, z$ be real numbers whose sum is zero. Prove that in this case, $$ a^{2} y z+b^{2} z x+c^{2} x y \leq 0 $$ -/ theorem inequalities_158609 (a b c : ℝ) (x y z : ℝ) (hβ‚€ : 0 < a ∧ 0 < b ∧ 0 < c) (h₁ : a + b > c) (_z' _y') (-k₂₃₄ , p₁ )(-p', q): -(q^⁻¹*√((↑r)^Β²*(u/v))):=by {rw[← mul_assoc], rw[_mul_, divRingCharacteristicZeroClass._div _, eqaulityPrimeFieldOfNatCastEqOne]}
42
math-word-problem
human
Let $a$ and $b$ be positive real numbers with $a\ge b$. Let $\rho$ be the maximum possible value of $\frac {a}{b}$ for which the system of equations $$ a^2 + y^2 = b^2 + x^2 = (a - x)^2 + (b - y)^2 $$has a solution in $(x,y)$ satisfying $0\le x < a$ and $0\le y < b$. Find $\rho^2.$
import Mathlib open Real /-- Let $a$ and $b$ be positive real numbers with $a\ge b$. Let $\rho$ be the maximum possible value of $\frac {a}{b}$ for which the system of equations $$ a^2 + y^2 = b^2 + x^2 = (a - x)^2 + (b - y)^2 $$has a solution in $(x,y)$ satisfying $0\le x < a$ and $0\le y < b$.Β  Find $\rho^2.$-/ theorem intermediate_algebra_4083 : (βˆ€ (a b : ℝ), b ≀ a β†’ (βˆƒ x : ℝ, βˆƒ y : ℝ, 0 ≀ x ∧ x < a ∧ 0 ≀ y ∧ y < b ∧ a^2 + y^2 = b^2 + x^2 ∧ b^2 + x^2 = (a-x)^2 + (b-y)^2) β†’ (a/b)^2 ≀ 4/3) ∧ βˆƒ a : ℝ, βˆƒ b : ℝ, b ≀ a ∧ (βˆƒ x : ℝ, βˆƒ y : ℝ, 0 ≀ x ∧ x < a ∧ 0 ≀ y ∧ y < b ∧ a^2 + y^2 = b^2 + x^2 ∧ b^2 + x^2 = (a-x)^2 + (b-y)^2) ∧ (a/b)^2 = 4/3 := by
import Mathlib open Real /-- Let $a$ and $b$ be positive real numbers with $a\ge b$. Let $\rho$ be the maximum possible value of $\frac {a}{b}$ for which the system of equations $$ a^2 + y^2 = b^2 + x^2 = (a - x)^2 + (b - y)^2 $$has a solution in $(x,y)$ satisfying $0\le x < a$ and $0\le y < b$.Β  Find $\rho^2.$-/ theorem intermediate_algebra_4083 : (βˆ€ (a b : ℝ), b ≀ a β†’ (βˆƒ x : ℝ, βˆƒ y : ℝ, 0 ≀ x ∧ x < a ∧ 0 ≀ y ∧ y < b ∧ a^2 + y^2 = b^2 + x^2 ∧ b^2 + x^2 = (a-x)^2 + (b-y)^2) β†’ (a/b)^2 ≀ 4/3) ∧ βˆƒ a : ℝ, βˆƒ b : ℝ, b ≀ a ∧ (βˆƒ x : ℝ, βˆƒ y : ℝ, 0 ≀ x ∧ x < a ∧ 0 ≀ y ∧ y < b ∧ a^2 + y^2 = b^2 + x^2 ∧ b^2 + x^2 = (a-x)^2 + (b-y)^2) ∧ (a/b)^2 = 4/3 := by constructor Β· intro a b _ ⟨x,⟨y,⟨hxnonneg,⟨hxa,⟨hynonneg,⟨hyb,⟨h₁,hβ‚‚βŸ©βŸ©βŸ©βŸ©βŸ©βŸ©βŸ© -- Because $0 \leq y < b$, we get $0 \leq 2by - y^2$. have : 0 ≀ 2*b*y - y^2 := by nlinarith -- Because $a^2 \leq a^2 +y^2 = b^2 + x^2 \leq b^2 + (a^2)/4$, so $3/4 * a^2 ≀ b^2$. have : 3/4 * a^2 ≀ b^2 := by nlinarith -- So we can get the maximum possible value of $\frac {a^2} {b^2}$ is $\frac 4 3$. norm_num have hb : 0 < b := by linarith field_simp [hb] rw [div_le_iff] linarith exact sq_pos_of_pos hb Β· -- Equality occurs when $a = 1, b = \frac {\sqrt3} 2, x = 1/2, and y =0$. use 1; use √3 / 2 constructor Β· rw [div_le_one (show 0 < (2 : ℝ) by norm_num)] rw [Real.sqrt_le_iff, (show 2^2 = (4 : ℝ) by norm_num)] constructor <;> linarith Β· constructor Β· use 1 / 2; use 0 simp_all constructor Β· apply inv_lt_one (show 1 < (2 : ℝ) by norm_num) Β· field_simp norm_num Β· rw [div_pow 1,one_pow, div_pow √3, sq_sqrt,one_div_div] norm_num; linarith
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib open Real /-- Let $a$ and $b$ be positive real numbers with $a\ge b$. Let $\rho$ be the maximum possible value of $\frac {a}{b}$ for which the system of equations $$ a^2 + y^2 = b^2 + x^2 = (a - x)^2 + (b - y)^2 $$has a solution in $(x,y)$ satisfying $0\le x < a$ and $0\le y < b$.Β  Find $\rho^2.$-/ theorem intermediate_algebra_4083 : (βˆ€ (a b : ℝ), b ≀ a β†’ (βˆƒ x : ℝ, βˆƒ y : ℝ, 0 ≀ x ∧ x < a ∧ 0 ≀ y ∧ y < b ∧ a^2 + y^2 = b^2 + x^2 ∧ b^2 + x^2 = (a-x)^2 + (b-y)^2) β†’ (a/b)^2 ≀ 4/3) ∧ βˆƒ a : ℝ, βˆƒ b : ℝ, b ≀ a ∧ (βˆƒ x : ℝ, βˆƒ y : ℝ, 0 ≀ x ∧ x < a ∧ 0 ≀ y ∧ y < b ∧ a^2 + y^2 = b^2 + x^2 ∧ b^2 + x^2 = (a-x)^2 + (b-y)^2) ∧ (a/b)^2 = 4/3 := by constructor Β· intro a b _ ⟨x,⟨y,⟨hxnonneg,⟨hxa,⟨hynonneg,⟨hyb,⟨h₁,hβ‚‚βŸ©βŸ©βŸ©βŸ©βŸ©βŸ©βŸ© -- Because $0 \leq y < b$, we get $0 \leq 2by - y^2$. have : 0 ≀ 2*b*y - y^2 := by nlinarith -- Because $a^2 \leq a^2 +y^2 = b^2 + x^2 \leq b^2 + (a^2)/4$, so $3/4 * a^2 ≀ b^2$. have : 3/4 * a^2 ≀ b^2 := by nlinarith -- So we can get the maximum possible value of $\frac {a^2} {b^2}$ is $\frac 4 3$. norm_num have hb :
√((Real.sqrt₃).val )⁻¹*(↑₄)*(-β…“+Complex'.im (- Complex' .I))=-(Β½): R:= ? πŸ‘Όmostly because it was generated using `norm` but I don’ t know how this could happen!
import Mathlib open Real /-- Let $a$ and $b$ be positive real numbers with $a\ge b$. Let $\rho$ be the maximum possible value of $\frac {a}{b}$ for which the system of equations $$ a^2 + y^2 = b^2 + x^2 = (a - x)^2 + (b - y)^2 $$has a solution in $(x,y)$ satisfying $0\le x < a$ and $0\le y < b$.Β  Find $\rho^2.$-/ theorem intermediate_algebra_4083 : (βˆ€ (a b : ℝ), b ≀ a β†’ (βˆƒ x : ℝ, βˆƒ y : ℝ, 0 ≀ x ∧ x < a ∧ 0 ≀ y ∧ y < b ∧ a^2 + y^2 = b^2 + x^2 ∧ b^2 + x^2 = (a-x)^2 + (b-y)^2) β†’ (a/b)^2 ≀ 4/3) ∧ βˆƒ a : ℝ, βˆƒ b : ℝ, b ≀ a ∧ (βˆƒ x : ℝ, βˆƒ y : ℝ, 0 ≀ x ∧ x < a ∧ 0 ≀ y ∧ y < b ∧ a^2 + y^2 = b^2 + x^2 ∧ b^2 + x^2 = (a-x)^2 + (b-y)^2) ∧ (a/b)^2 = 4/3 := by constructor Β· intro a b _ ⟨x,⟨y,⟨hxnonneg,⟨hxa,⟨hynonneg,⟨hyb,⟨h₁,hβ‚‚βŸ©βŸ©βŸ©βŸ©βŸ©βŸ©βŸ© -- Because $0 \leq y < b$, we get $0 \leq 2by - y^2$. have : 0 ≀ 2*b*y - y^2 := by nlinarith -- Because $a^2 \leq a^2 +y^2 = b^2 + x^2 \leq b^2 + (a^2)/4$, so $3/4 * a^2 ≀ b^2$. have : 3/4 * a^2 ≀ b^2 := by nlinarith -- So we can get the maximum possible value of $\frac {a^2} {b^2}$ is $\frac 4 3$. norm_num have hb :
import Mathlib open Real /-- Let $a$ and $b$ be positive real numbers with $a\ge b$. Let $\rho$ be the maximum possible value of $\frac {a}{b}$ for which the system of equations $$ a^2 + y^2 = b^2 + x^2 = (a - x)^2 + (b - y)^2 $$has a solution in $(x,y)$ satisfying $0\le x < a$ and $0\le y < b$.Β  Find $\rho^2.$-/ theorem intermediate_algebra_4083 : (βˆ€ (a b : ℝ), b ≀ a β†’ (βˆƒ x : ℝ, βˆƒ y : ℝ, 0 ≀ x ∧ x < a ∧ 0 ≀ y ∧ y < b ∧ a^2 + y^2 = b^2 + x^2 ∧ b^2 + x^2 = (a-x)^2 + (b-y)^2) β†’ (a/b)^2 ≀ 4/3) ∧ βˆƒ a : ℝ, βˆƒ b : ℝ, b ≀ a ∧ (βˆƒ x : ℝ, βˆƒ y : ℝ, 0 ≀ x ∧ x < a ∧ 0 ≀ y ∧ y < b ∧ a^2 + y^2 = b^2 + x^2 ∧ b^2 + x^2 = (a-x)^2 + (b-y)^2) ∧ (a/b)^2 = 4/3 := by constructor Β· intro a b _ ⟨x,⟨y,⟨hxnonneg,⟨hxa,⟨hynonneg,⟨hyb,⟨h₁,hβ‚‚βŸ©βŸ©βŸ©βŸ©βŸ©βŸ©βŸ© -- Because $0 \leq y < b$, we get $0 \leq 2by - y^2$. have : 0 ≀ 2*b*y - y^2 := by nlinarith -- Because $a^2 \leq a^2 +y^2 = b^2 + x^2 \leq b^2 + (a^2)/4$, so $3/4 * a^2 ≀ b^2$. have : 3/4 * a^2 ≀ b^2 := by nlinarith -- So we can get the maximum possible value of $\frac {a^2} {b^2}$ is $\frac 4 3$. norm_num have hb : √((Real.sqrt₃).val )⁻¹*(↑₄)*(-β…“+Complex'.im (- Complex' .I))=-(Β½): R:= ? πŸ‘Όmostly because it was generated using `norm` but I don’ t know how this could happen!
43
math-word-problem
human
Let $x,$ $y,$ $z$ be real numbers such that $x + y + z = 5$ and $xy + xz + yz = 8.$ Find the largest possible value of $x.$
import Mathlib /-- Auxiliary lemma : for any real numbers $x$ and $y$, $(x+y)^2 \leq 2*(x^2 + y^2)$. -/ lemma p93' {x y : ℝ} : (x + y)^2 ≀ 2*(x^2 + y^2) := by let f := fun i : β„• => match i with | 0 => x | _ => y let s := Finset.range 2 have : βˆ‘ i ∈ s, f i = x + y := by dsimp [f,s] rw [← (show {0, 1} = Finset.range 2 by rfl),Finset.sum_pair (by norm_num)] rw [← this] have : s.card = (2 : ℝ) := by rfl rw [← this] have : βˆ‘ i ∈ s, (f i) ^ 2 = x^2 + y^2 := by dsimp [f,s] rw [← (show {0, 1} = Finset.range 2 by rfl),Finset.sum_pair (by norm_num)] rw [← this] apply sq_sum_le_card_mul_sum_sq /-- Let $x,$ $y,$ $z$ be real numbers such that $x + y + z = 5$ and $xy + xz + yz = 8.$Β  Find the largest possible value of $x.$-/ theorem intermediate_algebra_4105 : (βˆ€ (x y z : ℝ), x + y + z = 5 ∧ x*y + x*z + y*z = 8 β†’ x ≀ 7 / 3) ∧ βˆƒ x, βˆƒ y, βˆƒ z, x + y + z = (5 : ℝ) ∧ x*y + x*z + y*z = (8 : ℝ) ∧ x = 7 / 3 := by
import Mathlib /-- Auxiliary lemma : for any real numbers $x$ and $y$, $(x+y)^2 \leq 2*(x^2 + y^2)$. -/ lemma p93' {x y : ℝ} : (x + y)^2 ≀ 2*(x^2 + y^2) := by let f := fun i : β„• => match i with | 0 => x | _ => y let s := Finset.range 2 have : βˆ‘ i ∈ s, f i = x + y := by dsimp [f,s] rw [← (show {0, 1} = Finset.range 2 by rfl),Finset.sum_pair (by norm_num)] rw [← this] have : s.card = (2 : ℝ) := by rfl rw [← this] have : βˆ‘ i ∈ s, (f i) ^ 2 = x^2 + y^2 := by dsimp [f,s] rw [← (show {0, 1} = Finset.range 2 by rfl),Finset.sum_pair (by norm_num)] rw [← this] apply sq_sum_le_card_mul_sum_sq /-- Let $x,$ $y,$ $z$ be real numbers such that $x + y + z = 5$ and $xy + xz + yz = 8.$Β  Find the largest possible value of $x.$-/ theorem intermediate_algebra_4105 : (βˆ€ (x y z : ℝ), x + y + z = 5 ∧ x*y + x*z + y*z = 8 β†’ x ≀ 7 / 3) ∧ βˆƒ x, βˆƒ y, βˆƒ z, x + y + z = (5 : ℝ) ∧ x*y + x*z + y*z = (8 : ℝ) ∧ x = 7 / 3 := by constructor Β· intro x y z ⟨h₁,hβ‚‚βŸ© -- use above lemma to have $(y + z)^2 ≀ 2*(y^2 + z^2)$ have : (y + z)^2 ≀ 2*(y^2 + z^2) := p93' nlinarith Β· use 7 / 3; use 4 / 3; use 4 / 3 ring_nf; aesop
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib /-- Auxiliary lemma : for any real numbers $x$ and $y$, $(x+y)^2 \leq 2*(x^2 + y^2)$. -/ lemma p93' {x y : ℝ} : (x + y)^2 ≀ 2*(x^2 + y^2) := by let f := fun i : β„• => match i with | 0 => x | _ => y let s := Finset.range 2 have : βˆ‘ i ∈ s, f i = x + y := by dsimp [f,s] rw [← (show {0, 1} = Finset.range 2 by rfl),Finset.sum_pair (by norm_num)] rw [← this] have : s.card = (2 : ℝ) := by rfl rw [← this] have : βˆ‘ i ∈ s, (f i) ^ 2 = x^2 + y^2 := by dsimp [f,s] rw [← (show {0, 1} = Finset.range 2 by rfl),Finset.sum_pair (by norm_num)] rw [← this] apply sq_sum_le_card_mul_sum_sq /-- Let $x,$ $y,$ $z$ be real numbers such that $x + y + z = 5$ and $xy + xz + yz = 8.$Β  Find the largest possible value of $x.$-/ theorem intermediate_algebra_4105 : (βˆ€ (x y z : ℝ), x + y + z = 5 ∧ x*y + x*z + y*z = 8 β†’ x ≀
max₃![maxβ‚‚!]:= IntervalReal .intervalOfInfix !fun t ht hs hr hp q r st u vt w xs yr zp puqvrwstuxyrztpqrtuvwxsytrzptuvwxtypqrpstuvwxthrpqrstpuvxythrpqturxvwththrptwork
import Mathlib /-- Auxiliary lemma : for any real numbers $x$ and $y$, $(x+y)^2 \leq 2*(x^2 + y^2)$. -/ lemma p93' {x y : ℝ} : (x + y)^2 ≀ 2*(x^2 + y^2) := by let f := fun i : β„• => match i with | 0 => x | _ => y let s := Finset.range 2 have : βˆ‘ i ∈ s, f i = x + y := by dsimp [f,s] rw [← (show {0, 1} = Finset.range 2 by rfl),Finset.sum_pair (by norm_num)] rw [← this] have : s.card = (2 : ℝ) := by rfl rw [← this] have : βˆ‘ i ∈ s, (f i) ^ 2 = x^2 + y^2 := by dsimp [f,s] rw [← (show {0, 1} = Finset.range 2 by rfl),Finset.sum_pair (by norm_num)] rw [← this] apply sq_sum_le_card_mul_sum_sq /-- Let $x,$ $y,$ $z$ be real numbers such that $x + y + z = 5$ and $xy + xz + yz = 8.$Β  Find the largest possible value of $x.$-/ theorem intermediate_algebra_4105 : (βˆ€ (x y z : ℝ), x + y + z = 5 ∧ x*y + x*z + y*z = 8 β†’ x ≀
import Mathlib /-- Auxiliary lemma : for any real numbers $x$ and $y$, $(x+y)^2 \leq 2*(x^2 + y^2)$. -/ lemma p93' {x y : ℝ} : (x + y)^2 ≀ 2*(x^2 + y^2) := by let f := fun i : β„• => match i with | 0 => x | _ => y let s := Finset.range 2 have : βˆ‘ i ∈ s, f i = x + y := by dsimp [f,s] rw [← (show {0, 1} = Finset.range 2 by rfl),Finset.sum_pair (by norm_num)] rw [← this] have : s.card = (2 : ℝ) := by rfl rw [← this] have : βˆ‘ i ∈ s, (f i) ^ 2 = x^2 + y^2 := by dsimp [f,s] rw [← (show {0, 1} = Finset.range 2 by rfl),Finset.sum_pair (by norm_num)] rw [← this] apply sq_sum_le_card_mul_sum_sq /-- Let $x,$ $y,$ $z$ be real numbers such that $x + y + z = 5$ and $xy + xz + yz = 8.$Β  Find the largest possible value of $x.$-/ theorem intermediate_algebra_4105 : (βˆ€ (x y z : ℝ), x + y + z = 5 ∧ x*y + x*z + y*z = 8 β†’ x ≀ max₃![maxβ‚‚!]:= IntervalReal .intervalOfInfix !fun t ht hs hr hp q r st u vt w xs yr zp puqvrwstuxyrztpqrtuvwxsytrzptuvwxtypqrpstuvwxthrpqrstpuvxythrpqturxvwththrptwork
47
math-word-problem
human
There exists a constant $k$ so that the minimum value of \[4x^2 - 6kxy + (3k^2 + 2) y^2 - 4x - 4y + 6\]over all real numbers $x$ and $y$ is 0. Find $k.$
import Mathlib open Real /-- `f k x y` denotes that $4*x^2 - 6*k*x*y + (3*k^2+2)*y^2 - 4*x - 4*y + 6 $-/ def f_4098 (k : ℝ) x y := 4*x^2 - 6*k*x*y + (3*k^2+2)*y^2 - 4*x - 4*y + 6 /-- simplify the expression `f k x y`. -/ lemma p86' : βˆ€ (x y k : ℝ), f_4098 k x y = (x-2)^2 + 2*(y-1)^2 + 3*(x-k*y)^2 := by intro x y k dsimp [f_4098] nlinarith /-- There exists a constant $k$ so that the minimum value of \[4x^2 - 6kxy + (3k^2 + 2) y^2 - 4x - 4y + 6\]over all real numbers $x$ and $y$ is 0.Β  Find $k.$-/ theorem intermediate_algebra_4098 {k : ℝ} : k = 2 ↔ (βˆ€ (x y : ℝ), 0 ≀ f_4098 k x y) ∧ βˆƒ x, βˆƒ y, f_4098 k x y = 0 := by
import Mathlib open Real /-- `f k x y` denotes that $4*x^2 - 6*k*x*y + (3*k^2+2)*y^2 - 4*x - 4*y + 6 $-/ def f_4098 (k : ℝ) x y := 4*x^2 - 6*k*x*y + (3*k^2+2)*y^2 - 4*x - 4*y + 6 /-- simplify the expression `f k x y`. -/ lemma p86' : βˆ€ (x y k : ℝ), f_4098 k x y = (x-2)^2 + 2*(y-1)^2 + 3*(x-k*y)^2 := by intro x y k dsimp [f_4098] nlinarith /-- There exists a constant $k$ so that the minimum value of \[4x^2 - 6kxy + (3k^2 + 2) y^2 - 4x - 4y + 6\]over all real numbers $x$ and $y$ is 0.Β  Find $k.$-/ theorem intermediate_algebra_4098 {k : ℝ} : k = 2 ↔ (βˆ€ (x y : ℝ), 0 ≀ f_4098 k x y) ∧ βˆƒ x, βˆƒ y, f_4098 k x y = 0 := by constructor Β· -- `f k x y` is nonegative when $k=2$, and exists $x$ and $y$ such that `f k x y` equal zero. intro hk constructor Β· intro x y rw [p86'] nlinarith Β· use 2; use 1 rw [p86'] nlinarith Β· intro ⟨_,⟨x,⟨y,hf⟩⟩⟩ rw [p86'] at hf -- \begin{align*} -- 4x^2 - 6kxy + (3k^2 + 2) y^2 - 4x - 4y + 6 &= x^2 - 4x + 4 + 2y^2 - 4y + 2 + 3x^2 - 6kxy + 3k^2 y^2 \\ -- &= (x^2 - 4x + 4) + 2(y^2 - 2y + 1) + 3(x^2 - 2kxy + k^2 y^2) \\ -- &= (x - 2)^2 + 2(y - 1)^2 + 3(x - ky)^2. -- \end{align*} have h₁ : 0 ≀ (x - 2) ^ 2 + 2 * (y - 1) ^ 2 := by nlinarith have hβ‚‚ : 0 ≀ 3 * (x - k * y) ^ 2 := by nlinarith have h' : (x - 2) ^ 2 + 2 * (y - 1) ^ 2 = 0 ∧ 3 * (x - k * y) ^ 2 = 0 := by apply (add_eq_zero_iff_of_nonneg h₁ hβ‚‚).mp hf have hx_eq_ky : x = k * y := by nlinarith have h'' : (x - 2) ^ 2 = 0 ∧ 2 * (y - 1) ^ 2 = 0 := by have h₁ : 0 ≀ (x - 2) ^ 2 := by nlinarith have hβ‚‚ : 0 ≀ 2 * (y - 1) ^ 2 := by have : 0 ≀ 2 * (y - 1) ^ 2 ↔ 0 ≀ (y - 1) ^ 2 := mul_nonneg_iff_right_nonneg_of_pos (by norm_num) apply this.mpr (by apply pow_two_nonneg) apply (add_eq_zero_iff_of_nonneg h₁ hβ‚‚).mp h'.1 -- The only way that this expression can take on the value of 0 is if $x = 2,$ $y = 1,$ and $x = ky.$Β  Thus, $k = 2$. have hx : x = 2 := eq_of_sub_eq_zero (pow_eq_zero h''.1) have hy : y = 1 := eq_of_sub_eq_zero <| pow_eq_zero <| eq_zero_of_ne_zero_of_mul_left_eq_zero (by linarith) h''.2 nlinarith
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib open Real /-- `f k x y` denotes that $4*x^2 - 6*k*x*y + (3*k^2+2)*y^2 - 4*x - 4*y + 6 $-/ def f_4098 (k : ℝ) x y := 4*x^2 - 6*k*x*y + (3*k^2+2)*y^2 - 4*x - 4*y + 6 /-- simplify the expression `f k x y`. -/ lemma p86' : βˆ€ (x y k : ℝ), f_4098 k x y = (x-2)^2 + 2*(y-1)^2 + 3*(x-k*y)^2 := by intro x y k dsimp [f_4098] nlinarith /-- There exists a constant $k$ so that the minimum value of \[4x^2 - 6kxy + (3k^2 + 2) y^2 - 4x - 4y + 6\]over all real numbers $x$ and $y$ is 0.Β  Find $k.$-/ theorem intermediate_algebra_4098 {k : ℝ} : k = 2 ↔ (βˆ€ (x y : ℝ), 0 ≀ f_4098 k x y) ∧ βˆƒ x, βˆƒ y, f_4098 k x y = 0 := by constructor Β· -- `f k x y` is nonegative when $k=2$, and exists $x$ and $y$ such that `f k x y` equal zero. intro hk constructor Β· intro x y rw [p86'] nlinarith Β· use 2; use 1 rw [p86'] nlinarith Β· intro ⟨_,⟨x,⟨y,hf⟩⟩⟩ rw [p86'] at hf -- \begin{align*} -- 4x^2 - 6kxy + (3k^2 + 2) y^2 - 4x - 4y + 6 &= x^2 - 4x + 4 + 2y^2 - 4y + 2 + 3x^2 - 6kxy + 3k^2 y^2 \\ -- &= (x^2 - 4x + 4) + 2(y^2 - 2y + 1) + 3(x^2 - 2kxy + k^2 y^2) \\ -- &= (x - 2)^2 + 2(y - 1)^2 + 3(x - ky)^2. -- \end{align*} have h₁ : 0 ≀ (x - 2) ^ 2 + 2 * (y - 1) ^ 2 := by nlinarith have hβ‚‚ : 0 ≀ 3 * (x - k * y) ^ 2 := by nlinarith have h' : (x - 2) ^ 2 + 2 * (y - 1) ^ 2 = 0 ∧ 3 * (x - k * y) ^ 2 = 0 := by apply (add_eq_
iff _).mp ; only[mul_self_nezero]; positivity! mul₃₄ , add₁two
import Mathlib open Real /-- `f k x y` denotes that $4*x^2 - 6*k*x*y + (3*k^2+2)*y^2 - 4*x - 4*y + 6 $-/ def f_4098 (k : ℝ) x y := 4*x^2 - 6*k*x*y + (3*k^2+2)*y^2 - 4*x - 4*y + 6 /-- simplify the expression `f k x y`. -/ lemma p86' : βˆ€ (x y k : ℝ), f_4098 k x y = (x-2)^2 + 2*(y-1)^2 + 3*(x-k*y)^2 := by intro x y k dsimp [f_4098] nlinarith /-- There exists a constant $k$ so that the minimum value of \[4x^2 - 6kxy + (3k^2 + 2) y^2 - 4x - 4y + 6\]over all real numbers $x$ and $y$ is 0.Β  Find $k.$-/ theorem intermediate_algebra_4098 {k : ℝ} : k = 2 ↔ (βˆ€ (x y : ℝ), 0 ≀ f_4098 k x y) ∧ βˆƒ x, βˆƒ y, f_4098 k x y = 0 := by constructor Β· -- `f k x y` is nonegative when $k=2$, and exists $x$ and $y$ such that `f k x y` equal zero. intro hk constructor Β· intro x y rw [p86'] nlinarith Β· use 2; use 1 rw [p86'] nlinarith Β· intro ⟨_,⟨x,⟨y,hf⟩⟩⟩ rw [p86'] at hf -- \begin{align*} -- 4x^2 - 6kxy + (3k^2 + 2) y^2 - 4x - 4y + 6 &= x^2 - 4x + 4 + 2y^2 - 4y + 2 + 3x^2 - 6kxy + 3k^2 y^2 \\ -- &= (x^2 - 4x + 4) + 2(y^2 - 2y + 1) + 3(x^2 - 2kxy + k^2 y^2) \\ -- &= (x - 2)^2 + 2(y - 1)^2 + 3(x - ky)^2. -- \end{align*} have h₁ : 0 ≀ (x - 2) ^ 2 + 2 * (y - 1) ^ 2 := by nlinarith have hβ‚‚ : 0 ≀ 3 * (x - k * y) ^ 2 := by nlinarith have h' : (x - 2) ^ 2 + 2 * (y - 1) ^ 2 = 0 ∧ 3 * (x - k * y) ^ 2 = 0 := by apply (add_eq_
import Mathlib open Real /-- `f k x y` denotes that $4*x^2 - 6*k*x*y + (3*k^2+2)*y^2 - 4*x - 4*y + 6 $-/ def f_4098 (k : ℝ) x y := 4*x^2 - 6*k*x*y + (3*k^2+2)*y^2 - 4*x - 4*y + 6 /-- simplify the expression `f k x y`. -/ lemma p86' : βˆ€ (x y k : ℝ), f_4098 k x y = (x-2)^2 + 2*(y-1)^2 + 3*(x-k*y)^2 := by intro x y k dsimp [f_4098] nlinarith /-- There exists a constant $k$ so that the minimum value of \[4x^2 - 6kxy + (3k^2 + 2) y^2 - 4x - 4y + 6\]over all real numbers $x$ and $y$ is 0.Β  Find $k.$-/ theorem intermediate_algebra_4098 {k : ℝ} : k = 2 ↔ (βˆ€ (x y : ℝ), 0 ≀ f_4098 k x y) ∧ βˆƒ x, βˆƒ y, f_4098 k x y = 0 := by constructor Β· -- `f k x y` is nonegative when $k=2$, and exists $x$ and $y$ such that `f k x y` equal zero. intro hk constructor Β· intro x y rw [p86'] nlinarith Β· use 2; use 1 rw [p86'] nlinarith Β· intro ⟨_,⟨x,⟨y,hf⟩⟩⟩ rw [p86'] at hf -- \begin{align*} -- 4x^2 - 6kxy + (3k^2 + 2) y^2 - 4x - 4y + 6 &= x^2 - 4x + 4 + 2y^2 - 4y + 2 + 3x^2 - 6kxy + 3k^2 y^2 \\ -- &= (x^2 - 4x + 4) + 2(y^2 - 2y + 1) + 3(x^2 - 2kxy + k^2 y^2) \\ -- &= (x - 2)^2 + 2(y - 1)^2 + 3(x - ky)^2. -- \end{align*} have h₁ : 0 ≀ (x - 2) ^ 2 + 2 * (y - 1) ^ 2 := by nlinarith have hβ‚‚ : 0 ≀ 3 * (x - k * y) ^ 2 := by nlinarith have h' : (x - 2) ^ 2 + 2 * (y - 1) ^ 2 = 0 ∧ 3 * (x - k * y) ^ 2 = 0 := by apply (add_eq_iff _).mp ; only[mul_self_nezero]; positivity! mul₃₄ , add₁two
51
null
human
There are five guys named Alan, Bob, Casey, Dan, and Eric. Each one either always tells the truth or always lies. You overhear the following discussion between them: ``` Alan: "All of us are truth-tellers." Bob: "No, only Alan and I are truth-tellers." Casey: "You are both liars." Dan: "If Casey is a truth-teller, then Eric is too." Eric: "An odd number of us are liars." ``` Who are the liars?
import Mathlib theorem logic_and_puzzles_608575 (a b c d e : Bool) (ha : a = (a && b && c && d && e)) (hb : b = (a && b && !c && !d && !e)) (hc : c = (!a && !b)) (hd : d = (cond c e true)) (he : e = (List.count false [a, b, c, d, e] % 2 == 1)) : !a && !b && c && !d && !e := by
import Mathlib /- There are five guys named Alan, Bob, Casey, Dan, and Eric. Each one either always tells the truth or always lies. You overhear the following discussion between them: ``` Alan: "All of us are truth-tellers." Bob: "No, only Alan and I are truth-tellers." Casey: "You are both liars." Dan: "If Casey is a truth-teller, then Eric is too." Eric: "An odd number of us are liars." ``` Who are the liars? -/ theorem logic_and_puzzles_608575 (a b c d e : Bool) (ha : a = (a && b && c && d && e)) (hb : b = (a && b && !c && !d && !e)) (hc : c = (!a && !b)) (hd : d = (cond c e true)) (he : e = (List.count false [a, b, c, d, e] % 2 == 1)) : !a && !b && c && !d && !e := by -- Note on the formalization: -- Let a, b, c, d, e be the boolean variables that represent the truthfulness of Alan, Bob, Casey, Dan, and Eric respectively. -- Then we translate the given statements into the following logical implications: -- 1. All of us are truth-tellers, i.e. a && b && c && d && e -- 2. No, only Alan and Bob are truth-tellers, i.e. a && b && !c && !d && !e -- 3. You are both liars, i.e. !a && !b -- 4. If Casey is a truth-teller, then Eric is too. Its value is equal to e when c is true, and equal to true when c is false, so we can express it as cond c e true -- 5. An odd number of us are liars. Its value is equal to true when the number of false variables is odd, and equal to false when the number of false variables is even. We can express it as List.count false [a, b, c, d, e] % 2 == 1 -- So we have 5 equations. -- The answer is that Alan, Bob, Dan and Eric are liars. -- So we formalize the answer as !a && !b && c && !d && !e. -- We now check all the 32 possible combinations of a, b, c, d, e. -- We can do this by using the native_decide tactic. revert a b c d e native_decide
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib /- There are five guys named Alan, Bob, Casey, Dan, and Eric. Each one either always tells the truth or always lies. You overhear the following discussion between them: ``` Alan: "All of us are truth-tellers." Bob: "No, only Alan and I are truth-tellers." Casey: "You are both liars." Dan: "If Casey is a truth-teller, then Eric is too." Eric: "An odd number of us are liars." ``` Who are the liars? -/ theorem logic_and_puzzles_608575 (a b c d e : Bool) (ha : a = (a && b && c && d && e)) (hb : b = (a && b && !c && !d && !e)) (hc : c = (!a && !b)) (hd : d = (cond c e true)) (he : e = (List.count false [a, b, c, d, e] % 2 == 1)) : !a && !b && c && !d && !e := by -- Note on the formalization: -- Let a, b, c, d, e be the boolean variables that represent the truthfulness of Alan, Bob, Casey, Dan, and Eric respectively. -- Then we translate the given statements into the following logical implications: -- 1. All of us are truth-tellers, i.e. a && b && c && d && e -- 2. No, only Alan and Bob are truth-tellers, i.e. a && b && !c && !d && !e -- 3. You are both liars, i.e. !a && !b -- 4. If Casey is a truth-teller, then Eric is too. Its value is equal to e when c is true, and equal to true when c is fal
satrue; otherwise it' s undefined because there isn’T any way in which this could happen if they all lie together). So let uses write `if _then _, else` here as an alternative expression for our conditionals so that things willvook more readable later! The first part says that everyone who liesse must also tell trues about their own behavior since no other person would know what happened without asking them directless , while second half implies somethingliketheyourselfwonΒ΄tbeatup against another person but rather agree notto do something bad thingsthat may harm others . This means everytruthr shouldbe able todetermine whetherornotthey lied based offinformation from otherinspectionaldatatrue/false conditions suchas howmanytimes each has toldtrueness etc.. Finally notehowimportantitistoseekoutall possible cases wheresomethingmighthappensothatnomissing out possibilities occur anywhereelseinthis problem solution ;otherwiseweright end upwith wrong answorks very fast duetotypicalerrors madebyhuman brainswhenthinkingabout complex problems like these oneswhich require careful attention towards detailsin ordertomakesureeverythings covered properly.*
import Mathlib /- There are five guys named Alan, Bob, Casey, Dan, and Eric. Each one either always tells the truth or always lies. You overhear the following discussion between them: ``` Alan: "All of us are truth-tellers." Bob: "No, only Alan and I are truth-tellers." Casey: "You are both liars." Dan: "If Casey is a truth-teller, then Eric is too." Eric: "An odd number of us are liars." ``` Who are the liars? -/ theorem logic_and_puzzles_608575 (a b c d e : Bool) (ha : a = (a && b && c && d && e)) (hb : b = (a && b && !c && !d && !e)) (hc : c = (!a && !b)) (hd : d = (cond c e true)) (he : e = (List.count false [a, b, c, d, e] % 2 == 1)) : !a && !b && c && !d && !e := by -- Note on the formalization: -- Let a, b, c, d, e be the boolean variables that represent the truthfulness of Alan, Bob, Casey, Dan, and Eric respectively. -- Then we translate the given statements into the following logical implications: -- 1. All of us are truth-tellers, i.e. a && b && c && d && e -- 2. No, only Alan and Bob are truth-tellers, i.e. a && b && !c && !d && !e -- 3. You are both liars, i.e. !a && !b -- 4. If Casey is a truth-teller, then Eric is too. Its value is equal to e when c is true, and equal to true when c is fal
import Mathlib /- There are five guys named Alan, Bob, Casey, Dan, and Eric. Each one either always tells the truth or always lies. You overhear the following discussion between them: ``` Alan: "All of us are truth-tellers." Bob: "No, only Alan and I are truth-tellers." Casey: "You are both liars." Dan: "If Casey is a truth-teller, then Eric is too." Eric: "An odd number of us are liars." ``` Who are the liars? -/ theorem logic_and_puzzles_608575 (a b c d e : Bool) (ha : a = (a && b && c && d && e)) (hb : b = (a && b && !c && !d && !e)) (hc : c = (!a && !b)) (hd : d = (cond c e true)) (he : e = (List.count false [a, b, c, d, e] % 2 == 1)) : !a && !b && c && !d && !e := by -- Note on the formalization: -- Let a, b, c, d, e be the boolean variables that represent the truthfulness of Alan, Bob, Casey, Dan, and Eric respectively. -- Then we translate the given statements into the following logical implications: -- 1. All of us are truth-tellers, i.e. a && b && c && d && e -- 2. No, only Alan and Bob are truth-tellers, i.e. a && b && !c && !d && !e -- 3. You are both liars, i.e. !a && !b -- 4. If Casey is a truth-teller, then Eric is too. Its value is equal to e when c is true, and equal to true when c is falsatrue; otherwise it' s undefined because there isn’T any way in which this could happen if they all lie together). So let uses write `if _then _, else` here as an alternative expression for our conditionals so that things willvook more readable later! The first part says that everyone who liesse must also tell trues about their own behavior since no other person would know what happened without asking them directless , while second half implies somethingliketheyourselfwonΒ΄tbeatup against another person but rather agree notto do something bad thingsthat may harm others . This means everytruthr shouldbe able todetermine whetherornotthey lied based offinformation from otherinspectionaldatatrue/false conditions suchas howmanytimes each has toldtrueness etc.. Finally notehowimportantitistoseekoutall possible cases wheresomethingmighthappensothatnomissing out possibilities occur anywhereelseinthis problem solution ;otherwiseweright end upwith wrong answorks very fast duetotypicalerrors madebyhuman brainswhenthinkingabout complex problems like these oneswhich require careful attention towards detailsin ordertomakesureeverythings covered properly.*
52
null
human
A broken calculator has the + and $\times$ keys switched. For how many ordered pairs $(a, b)$ of integers will it correctly calculate $a+b$ using the labelled + key?
import Mathlib theorem number_theory_611121 : {(a, b) : β„€ Γ— β„€ | a + b = a * b}.encard = 2 := by
import Mathlib /- A broken calculator has the + and $\times$ keys switched. For how many ordered pairs $(a, b)$ of integers will it correctly calculate $a+b$ using the labelled + key? -/ theorem number_theory_611121 : {(a, b) : β„€ Γ— β„€ | a + b = a * b}.encard = 2 := by transitivity ({(0, 0), (2, 2)} : Set (β„€ Γ— β„€)).encard Β· congr 1 /- The set is exatly `{(0, 0), (2, 2)}`. -/ ext ⟨a, b⟩ simp refine ⟨fun h => ?_, fun h => ?_⟩ Β· /- From `a + b = ab`, we prove that `(b - 1) * (a - 1) = 1`. -/ have eq : (b - 1) * (a - 1) = 1 := by rw [← sub_eq_zero] at h ⊒ rw [← neg_inj] convert h using 1 ring /- So `b - 1 ∣ 1`, then `b` must be 0 or 2. -/ have hb : b - 1 ∣ 1 := ⟨_, eq.symm⟩ rw [← isUnit_iff_dvd_one, Int.isUnit_iff] at hb /- So `a` is 0 or 2 respectively. -/ cases' hb with hb hb <;> (rw [hb] at eq; omega) Β· /- If `(a, b)` is `(0, 0)` or `(2, 2)`, it satisfies the condition. -/ cases' h with h h <;> simp [h] Β· /- Prove that the cardinality of `{(0, 0), (2, 2)}` is 2. -/ rw [Set.encard_insert_of_not_mem] Β· norm_num Β· intro h simp only [Set.mem_singleton_iff] at h apply_fun Prod.fst at h simp at h
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib /- A broken calculator has the + and $\times$ keys switched. For how many ordered pairs $(a, b)$ of integers will it correctly calculate $a+b$ using the labelled + key? -/ theorem number_theory_611121 : {(a, b) : β„€ Γ— β„€ | a + b = a * b}.encard = 2 := by transitivity ({(0, 0), (2, 2)} : Set (β„€ Γ— β„€)).encard Β· congr 1 /- The set is exatly `{(0, 0), (2, 2)}`. -/ ext ⟨a, b⟩ simp refine ⟨fun h => ?_, fun h => ?_⟩ Β· /- From `a + b = ab`, we prove that `(b - 1) * (a - 1) = 1`. -/ have eq : (b - 1) * (a - 1) = 1 := by rw [← sub_eq_zero] at h ⊒ rw [← neg_inj] convert h using 1 ring /- So `b - 1 ∣ 1`, then `b` must be 0 or 2. -/ have hb : b - 1 ∣ 1 := ⟨_, eq.symm⟩ rw [← isUnit_iff_dvd_one, Int.isUnit_iff] at hb /- So `a` is 0 or 2 respectively.
-/
import Mathlib /- A broken calculator has the + and $\times$ keys switched. For how many ordered pairs $(a, b)$ of integers will it correctly calculate $a+b$ using the labelled + key? -/ theorem number_theory_611121 : {(a, b) : β„€ Γ— β„€ | a + b = a * b}.encard = 2 := by transitivity ({(0, 0), (2, 2)} : Set (β„€ Γ— β„€)).encard Β· congr 1 /- The set is exatly `{(0, 0), (2, 2)}`. -/ ext ⟨a, b⟩ simp refine ⟨fun h => ?_, fun h => ?_⟩ Β· /- From `a + b = ab`, we prove that `(b - 1) * (a - 1) = 1`. -/ have eq : (b - 1) * (a - 1) = 1 := by rw [← sub_eq_zero] at h ⊒ rw [← neg_inj] convert h using 1 ring /- So `b - 1 ∣ 1`, then `b` must be 0 or 2. -/ have hb : b - 1 ∣ 1 := ⟨_, eq.symm⟩ rw [← isUnit_iff_dvd_one, Int.isUnit_iff] at hb /- So `a` is 0 or 2 respectively.
import Mathlib /- A broken calculator has the + and $\times$ keys switched. For how many ordered pairs $(a, b)$ of integers will it correctly calculate $a+b$ using the labelled + key? -/ theorem number_theory_611121 : {(a, b) : β„€ Γ— β„€ | a + b = a * b}.encard = 2 := by transitivity ({(0, 0), (2, 2)} : Set (β„€ Γ— β„€)).encard Β· congr 1 /- The set is exatly `{(0, 0), (2, 2)}`. -/ ext ⟨a, b⟩ simp refine ⟨fun h => ?_, fun h => ?_⟩ Β· /- From `a + b = ab`, we prove that `(b - 1) * (a - 1) = 1`. -/ have eq : (b - 1) * (a - 1) = 1 := by rw [← sub_eq_zero] at h ⊒ rw [← neg_inj] convert h using 1 ring /- So `b - 1 ∣ 1`, then `b` must be 0 or 2. -/ have hb : b - 1 ∣ 1 := ⟨_, eq.symm⟩ rw [← isUnit_iff_dvd_one, Int.isUnit_iff] at hb /- So `a` is 0 or 2 respectively. -/
53
null
human
A malfunctioning digital clock shows the time $9: 57 \mathrm{AM}$; however, the correct time is $10: 10 \mathrm{AM}$. There are two buttons on the clock, one of which increases the time displayed by 9 minutes, and another which decreases the time by 20 minutes. What is the minimum number of button presses necessary to correctly set the clock to the correct time?
import Mathlib theorem logic_and_puzzles_609734 (currentTime correctTime : β„•) (h1 : currentTime = 9 * 60 + 57) (h2 : correctTime = 10 * 60 + 10) : IsLeast { n | βˆƒ a b, currentTime + 9 * a - 20 * b = correctTime ∧ a + b = n } 24 := by
import Mathlib theorem logic_and_puzzles_609734 (currentTime correctTime : β„•) (h1 : currentTime = 9 * 60 + 57) (h2 : correctTime = 10 * 60 + 10) : IsLeast { n | βˆƒ a b, currentTime + 9 * a - 20 * b = correctTime ∧ a + b = n } 24 := by constructor Β· -- supply witnesses simp only [Set.mem_setOf_eq] apply Exists.intro 17 apply Exists.intro 7 omega Β· intros n hn -- obtain hypotheses obtain ⟨a,b,ha1,ha2⟩ := hn -- solve omega
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib theorem logic_and_puzzles_609734 (currentTime correctTime : β„•) (h1 : currentTime = 9 * 60 + 57) (h2 : correctTime = 10 * 60 + 10) : IsLeast { n | βˆƒ a b, currentTime + 9 * a - 20 * b = correctTime ∧ a + b = n } 24 := by constructor Β· -- supply witnesses simp only [Set.mem_setOf_eq] apply
Existsβ‚‚' _ fun i j hij HijHji IJIJIJI JHIJTIH TITHTTTI HTTHS SHSSTTS TSSTSSS SSTTHH HHJJII IIJK JKKL KLKM KMMN MNNO OP PQ QR RS ST TU UV VW X Y Z WXWX XYXY VWVWVWW UTVTU VTUUVUT UTXVTX XVYZYZ
import Mathlib theorem logic_and_puzzles_609734 (currentTime correctTime : β„•) (h1 : currentTime = 9 * 60 + 57) (h2 : correctTime = 10 * 60 + 10) : IsLeast { n | βˆƒ a b, currentTime + 9 * a - 20 * b = correctTime ∧ a + b = n } 24 := by constructor Β· -- supply witnesses simp only [Set.mem_setOf_eq] apply
import Mathlib theorem logic_and_puzzles_609734 (currentTime correctTime : β„•) (h1 : currentTime = 9 * 60 + 57) (h2 : correctTime = 10 * 60 + 10) : IsLeast { n | βˆƒ a b, currentTime + 9 * a - 20 * b = correctTime ∧ a + b = n } 24 := by constructor Β· -- supply witnesses simp only [Set.mem_setOf_eq] apply Existsβ‚‚' _ fun i j hij HijHji IJIJIJI JHIJTIH TITHTTTI HTTHS SHSSTTS TSSTSSS SSTTHH HHJJII IIJK JKKL KLKM KMMN MNNO OP PQ QR RS ST TU UV VW X Y Z WXWX XYXY VWVWVWW UTVTU VTUUVUT UTXVTX XVYZYZ
56
math-word-problem
autoformalizer
Matt has somewhere between $1000$ and $2000$ pieces of paper he's trying to divide into piles of the same size (but not all in one pile or piles of one sheet each). He tries $2$, $3$, $4$, $5$, $6$, $7$, and $8$ piles but ends up with one sheet left over each time. How many piles does he need?
import Mathlib /- Matt has somewhere between $1000$ and $2000$ pieces of paper he's trying to divide into piles of the same size (but not all in one pile or piles of one sheet each). He tries $2$, $3$, $4$, $5$, $6$, $7$, and $8$ piles but ends up with one sheet left over each time. How many piles does he need? -/ theorem number_theory_67977 {n : β„•} (hn : n β‰₯ 1000 ∧ n < 2000) (h1 : n % 2 = 1) (h2 : n % 3 = 1) (h3 : n % 4 = 1) (h4 : n % 5 = 1) (h5 : n % 6 = 1) (h6 : n % 7 = 1) (h7 : n % 8 = 1) : n % 41 = 0 := by
import Mathlib theorem number_theory_67977 {n : β„•} (hn : n β‰₯ 1000 ∧ n < 2000) (h1 : n % 2 = 1) (h2 : n % 3 = 1) (h3 : n % 4 = 1) (h4 : n % 5 = 1) (h5 : n % 6 = 1) (h6 : n % 7 = 1) (h7 : n % 8 = 1) : n % 41 = 0 := by rcases hn with ⟨hn1, hn2⟩ interval_cases n <;> omega
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib theorem number_theory_67977 {n : β„•} (hn : n β‰₯ 1000 ∧ n < 2000) (h1 : n % 2 = 1) (h2 : n % 3 = 1) (h3 : n % 4 = 1) (h4 : n % 5 = 1) (h5 : n % 6 = 1) (h6 : n % 7 = 1)
(h7 : n % 8 = 1): Nat√nFiniteGroup s where F in S is prime:=by apply existsUniquePrimeDivisor; assumption
import Mathlib theorem number_theory_67977 {n : β„•} (hn : n β‰₯ 1000 ∧ n < 2000) (h1 : n % 2 = 1) (h2 : n % 3 = 1) (h3 : n % 4 = 1) (h4 : n % 5 = 1) (h5 : n % 6 = 1) (h6 : n % 7 = 1)
import Mathlib theorem number_theory_67977 {n : β„•} (hn : n β‰₯ 1000 ∧ n < 2000) (h1 : n % 2 = 1) (h2 : n % 3 = 1) (h3 : n % 4 = 1) (h4 : n % 5 = 1) (h5 : n % 6 = 1) (h6 : n % 7 = 1) (h7 : n % 8 = 1): Nat√nFiniteGroup s where F in S is prime:=by apply existsUniquePrimeDivisor; assumption
57
math-word-problem
autoformalizer
Let $f(x) = x^2 + 6x + 7$. Determine the smallest possible value of $f(f(f(f(x))))$ over all real numbers $x.$
import Mathlib open Real Set open scoped BigOperators /- Let $f(x) = x^2 + 6x + 7$. Determine the smallest possible value of $f(f(f(f(x))))$ over all real numbers $x.$ -/ theorem calculus_75601 {f : ℝ β†’ ℝ} (hf : f = Ξ» x => x ^ 2 + 6 * x + 7) : IsLeast {y | βˆƒ x, y = f (f (f (f x)))} 23 :=
import Mathlib open Real Set open scoped BigOperators theorem calculus_75601 {f : ℝ β†’ ℝ} (hf : f = Ξ» x => x ^ 2 + 6 * x + 7) : IsLeast {y | βˆƒ x, y = f (f (f (f x)))} 23 := by constructor Β· -- First part of IsLeast: Show 23 is in the set. use -3 norm_num [hf] Β· -- Second part of IsLeast: Show no value less than 23 is in the set. intro y hy rcases hy with ⟨x, hx⟩ rw [hx] norm_num [hf] nlinarith [sq_nonneg (x + 3), sq_nonneg (x ^ 2 + 6 * x + 7 + 2), sq_nonneg ((x ^ 2 + 6 * x + 7) + 2), sq_nonneg ((x ^ 2 + 6 * x + 7) ^ 2 + 6 * (x ^ 2 + 6 * x + 7) + 7 + 1)]
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib open Real Set open scoped BigOperators theorem calculus_75601 {f : ℝ β†’ ℝ} (hf : f = Ξ» x => x ^ 2 + 6 * x + 7) : IsLeast {y | βˆƒ x, y = f (f (f (f x)))} 23 := by constructor Β· -- First part of IsLeast: Show 23 is in the set. use -3 norm_num [hf] Β· -- Second part of IsLeast: Show no value less than 23 is in the set. intro y hy rcases hy with ⟨x, hx⟩ rw [hx] norm_num [hf] nlinarith [sq_nonneg (x + 3),
mul_self (-↑Real.sqrt _)]
import Mathlib open Real Set open scoped BigOperators theorem calculus_75601 {f : ℝ β†’ ℝ} (hf : f = Ξ» x => x ^ 2 + 6 * x + 7) : IsLeast {y | βˆƒ x, y = f (f (f (f x)))} 23 := by constructor Β· -- First part of IsLeast: Show 23 is in the set. use -3 norm_num [hf] Β· -- Second part of IsLeast: Show no value less than 23 is in the set. intro y hy rcases hy with ⟨x, hx⟩ rw [hx] norm_num [hf] nlinarith [sq_nonneg (x + 3),
import Mathlib open Real Set open scoped BigOperators theorem calculus_75601 {f : ℝ β†’ ℝ} (hf : f = Ξ» x => x ^ 2 + 6 * x + 7) : IsLeast {y | βˆƒ x, y = f (f (f (f x)))} 23 := by constructor Β· -- First part of IsLeast: Show 23 is in the set. use -3 norm_num [hf] Β· -- Second part of IsLeast: Show no value less than 23 is in the set. intro y hy rcases hy with ⟨x, hx⟩ rw [hx] norm_num [hf] nlinarith [sq_nonneg (x + 3), mul_self (-↑Real.sqrt _)]
58
math-word-problem
autoformalizer
Find all pairs $(x, y)$ of positive integers such that $x^{2}=y^{2}+7 y+6$.
import Mathlib /- Find all pairs $(x, y)$ of positive integers such that $x^{2}=y^{2}+7 y+6$. -/ theorem algebra_116978 (x y : β„€) (hx : 0 < x) (hy : 0 < y) : x^2 = y^2 + 7 * y + 6 ↔ (x, y) = (6, 3) := by
import Mathlib theorem algebra_116978 (x y : β„€) (hx : 0 < x) (hy : 0 < y) : x^2 = y^2 + 7 * y + 6 ↔ (x, y) = (6, 3) := by constructor Β· -- First direction: xΒ² = yΒ² + 7y + 6 β†’ (x, y) = (6, 3) intro h have h1 : 4 * x ^ 2 = (2 * y + 7) ^ 2 - 25 := by nlinarith have h2 : (2 * y + 7 - 2 * x) * (2 * y + 7 + 2 * x) = 25 := by nlinarith have h3 : (2 * y + 7 - 2 * x) ∣ 25 := by use (2 * y + 7 + 2 * x) all_goals linarith have h4 : (2 * y + 7 - 2 * x) = 1 ∨ (2 * y + 7 - 2 * x) = 5 ∨ (2 * y + 7 - 2 * x) = 25 ∨ (2 * y + 7 - 2 * x) = -1 ∨ (2 * y + 7 - 2 * x) = -5 ∨ (2 * y + 7 - 2 * x) = -25 := by have h6 : (2 * y + 7 - 2 * x) ∣ 25 := h3 have h7 : (2 * y + 7 - 2 * x) ≀ 25 := by apply Int.le_of_dvd (by norm_num) h6 have h8 : (2 * y + 7 - 2 * x) β‰₯ -25 := by have h9 : -(2 * y + 7 - 2 * x) ∣ 25 := by exact Int.neg_dvd.2 h6 have h10 : -(2 * y + 7 - 2 * x) ≀ 25 := by apply Int.le_of_dvd (by norm_num) h9 omega interval_cases h1 : (2 * y + 7 - 2 * x) <;> tauto rcases h4 with (h4 | h4 | h4 | h4 | h4 | h4) Β· -- Case where (2 * y + 7 - 2 * x) = 1, so (2 * y + 7 + 2 * x) = 25 have h5 : (2 * y + 7 + 2 * x) = 25 := by rw [show (2 * y + 7 - 2 * x) = 1 by linarith] at h2 nlinarith have h6 : y = 3 := by omega have h7 : x = 6 := by omega simp [h7, h6] Β· -- Case where (2 * y + 7 - 2 * x) = 5, so (2 * y + 7 + 2 * x) = 5 have h5 : (2 * y + 7 + 2 * x) = 5 := by rw [show (2 * y + 7 - 2 * x) = 5 by linarith] at h2 nlinarith exfalso linarith Β· -- Case where (2 * y + 7 - 2 * x) = 25, so (2 * y + 7 + 2 * x) = 1 have h5 : (2 * y + 7 + 2 * x) = 1 := by rw [show (2 * y + 7 - 2 * x) = 25 by linarith] at h2 nlinarith exfalso linarith Β· -- Case where (2 * y + 7 - 2 * x) = -1, so (2 * y + 7 + 2 * x) = -25 have h5 : (2 * y + 7 + 2 * x) = -25 := by rw [show (2 * y + 7 - 2 * x) = -1 by linarith] at h2 nlinarith exfalso linarith Β· -- Case where (2 * y + 7 - 2 * x) = -5, so (2 * y + 7 + 2 * x) = -5 have h5 : (2 * y + 7 + 2 * x) = -5 := by rw [show (2 * y + 7 - 2 * x) = -5 by linarith] at h2 nlinarith exfalso linarith Β· -- Case where (2 * y + 7 - 2 * x) = -25, so (2 * y + 7 + 2 * x) = -1 have h5 : (2 * y + 7 + 2 * x) = -1 := by rw [show (2 * y + 7 - 2 * x) = -25 by linarith] at h2 nlinarith exfalso linarith Β· -- Backward implication: (x, y) = (6, 3) β†’ xΒ² = yΒ² + 7y + 6 rintro ⟨rfl, rfl⟩ norm_num
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib theorem algebra_116978 (x y : β„€) (hx : 0 < x) (hy : 0 < y) : x^2 = y^2 + 7 * y + 6 ↔ (x, y) = (6, 3) := by constructor Β· -- First direction: xΒ² = yΒ² + 7y + 6 β†’ (x, y) = (6, 3) intro h have h1 : 4 * x ^ 2 = (2 * y + 7) ^ 2 - 25 := by nlinarith have h2 : (2 * y + 7 - 2 * x) * (2 * y + 7 + 2 * x) = 25 := by nlinarith have h3 : (2 * y + 7 - 2 * x) ∣ 25 := by use (2 * y + 7 + 2 * x) all_goals linarith have h4 : (2 * y + 7 - 2 * x) = 1 ∨ (2 * y + 7 - 2 * x) = 5 ∨ (2 * y + 7 - 2 * x) = 25 ∨ (2 * y + 7 - 2 * x) = -1 ∨ (2 * y + 7 - 2 * x) = -5 ∨ (2 * y + 7 - 2 * x) = -25 := by have h6 : (2 * y + 7 - 2 * x) ∣ 25 := h3 have h7 : (2 * y + 7 - 2 * x) ≀ 25 := by apply Int.le_of_dvd (by norm_num) h6 have h8 : (2 * y + 7 - 2 * x) β‰₯ -25 := by have h9 : -(2 * y + 7 - 2 * x) ∣ 25 := by exact Int.neg_dvd.2 h6 have h10 : -(2 * y + 7 - 2 * x) ≀ 25 := by apply Int.le_of_dvd (by norm_num) h9 omega interval_cases h1 : (2 * y + 7 - 2 * x) <;> tauto rcases h4 with (h4 | h4 | h4 | h4 | h4 | h4) Β· -- Case where (2 * y + 7 - 2 * x) = 1, so (2 * y + 7 + 2 * x) = 25 have h5 : (2 * y + 7 + 2 * x) = 25 := by rw [show (2 * y + 7 - 2 * x) = 1 by linarith] at h2 nlinarith have h6 : y = 3 := by omega have h7 : x = 6 := by omega simp [h7, h6] Β· -- Case where (2 * y + 7 - 2 * x) = 5, so (2 * y + 7 + 2 * x) = 5 have h5 : (2 * y + 7 + 2 * x) = 5 := by rw [show (2 * y + 7 - 2 * x) = 5 by linarith] at h2 nlinarith exfalso linarith Β· -- Case where (2 * y + 7 - 2 * x) = 25, so (2 * y + 7 + 2 * x) = 1 have h5 : (2 * y + 7 + 2 * x) = 1 := by rw [show (2 * y + 7 - 2 * x) = 25 by linarith] at h
2 ;nlinarity[Int];norm' only [(← mul)]<|>.intrinsiciquality _ (-(-↑((fun p q i j v u w z s t r e genalgebra._aux_.mk₂₃₄₅ {i} (_coe?_eq'_one.{lift}))))*v+w)*z);all_{p};rw[<left>]at this|-{right}.mul..comm.<|_><|>try itnf')⟩ using fun eq neq ih proof cases Eqaulitypepinfo'.noConfusionEq?.elim! {?}ih ?proficquationspatchable:= Ifforprocesser is not able todetermine if there exists an equivalence betwin these terms because they do no contain any variable symbols from their domains but rather consist entirely oftypes which appear as subtypes within other types suchthatat none occur anywhere else on either sideafter applying substitution rules based onthe given assumptions about relationships between objects typed into these expressions.\nFirst we note that since both $\frac{(b\cdotd)\pm(\sqrt{\Delta})}{k}$ must divide $-r$, then each factor itself mustb dividethe product $(bd)^j$. This means thadat every prime divisor divising somethermal expression has its own inverse image under our mapningshapingingroup action ,which implies alsothat every nonprime divisior willvaluate positively when appliedto $-\rheatmospheric{-}(ba)^{ju}$. Now let us assume withoutlossofgenerality(since otherwisewe could simply replace "$\mathbbZ$"with"$(\mathrematics Z/N,\oplus)"and continuelikesofarοΌ‰hat$|G|=|\mathcal G|$ holds trueforrsomeferrorfree finite group actions over fields . Then forany fixedelement$~X~$in$~\mathcalp F $,there existssome positive integer~${K}\geq N^{-|F|}^{-}|H|^{-\operatorname{|Formula|(A)}}$,where ~$|\text{-}|^-$denotescardinaltivity raisedtonoticationpotencens,suchthatarespectingthe chosen basisvectors,~$[Y]_B=[\sum _{I}^{J}[U]_{C}]_{\tilde B}=[-V]_{\bar D}=[W]$ gives risetosomespace filling function~$\varphi $. We may now define another spacefillingfunction via compositionwiththis first choice:~$$\psi=\phi*\sigma,$$whereο½œΟƒοΌΟ†βˆ’ΒΉγ€‚ By construction,~\psiatmospherically mapseach pointbackontoitselfunder translationsatlongledinvariant subspaces generatedbyelementsfromour set up above while preservinp distancesbetweenthemas wellaneeddledityour question). It remainstoprove thoatuthis secondchoice stillsatisfies condition~(ii): Ifweshowitinsteadfrommaximalinessequomentallysatisfying conditionsoncentration functionssatisfy property*(iii*)---namely,"Iftwo points lieon oppositele sidesofsomereceiving line passing through zeropowerfulpointthentheir distanceshouldbe less than half what would resultifthey were located symmetrically around some verticalline crossing throughmidpoint",β€”wenearliply obtaincondition *(iv*:*"The sumover allobstacles shouldnot exceedn twicetheequal length." ) To see why*, supposeotherwise:letting $\|\mathbf X\|$=√Σ$_ix_\imath$;$^T$+$\|\mathbfr\|^P+$...denote Euclideannormeson complex spaces definedabove yields \[||\xi||=|(|Re\{\zeta\}|+Im\{ze\})|=\tfrac{|\overline{(\chi+\jmath)}\rangle}{\langle (\eta +\kappa)|}=\dfrac{[(|\theta -\tau|)+|\beta |\cos((\pi/\nu)-\alpha)+\sin(-\gamma)/\,\mu)\,]}{\big[(\rho+(\varsigma)\,\cot\,({\vartheta})\tan\,({{\varpi}/{{Ξ½}}}))\sec\,{\omega}\,\tanh({-{Ο€}/{ΞΊ}}\log ({Ξ΄}+Ξ΅))^{L}\,+{ΞΆ}^M\\\]However,-canceling out common factors from topanbottom leaves\[|{\boldsymbol Y}|= |{\boldsymbolw}|\leq \|[{\lambda}_D]\circ [{\lambda}_{E}]\cdots\|_{S}\|\vec V\|_Q,\]contradictiny assumption.*
import Mathlib theorem algebra_116978 (x y : β„€) (hx : 0 < x) (hy : 0 < y) : x^2 = y^2 + 7 * y + 6 ↔ (x, y) = (6, 3) := by constructor Β· -- First direction: xΒ² = yΒ² + 7y + 6 β†’ (x, y) = (6, 3) intro h have h1 : 4 * x ^ 2 = (2 * y + 7) ^ 2 - 25 := by nlinarith have h2 : (2 * y + 7 - 2 * x) * (2 * y + 7 + 2 * x) = 25 := by nlinarith have h3 : (2 * y + 7 - 2 * x) ∣ 25 := by use (2 * y + 7 + 2 * x) all_goals linarith have h4 : (2 * y + 7 - 2 * x) = 1 ∨ (2 * y + 7 - 2 * x) = 5 ∨ (2 * y + 7 - 2 * x) = 25 ∨ (2 * y + 7 - 2 * x) = -1 ∨ (2 * y + 7 - 2 * x) = -5 ∨ (2 * y + 7 - 2 * x) = -25 := by have h6 : (2 * y + 7 - 2 * x) ∣ 25 := h3 have h7 : (2 * y + 7 - 2 * x) ≀ 25 := by apply Int.le_of_dvd (by norm_num) h6 have h8 : (2 * y + 7 - 2 * x) β‰₯ -25 := by have h9 : -(2 * y + 7 - 2 * x) ∣ 25 := by exact Int.neg_dvd.2 h6 have h10 : -(2 * y + 7 - 2 * x) ≀ 25 := by apply Int.le_of_dvd (by norm_num) h9 omega interval_cases h1 : (2 * y + 7 - 2 * x) <;> tauto rcases h4 with (h4 | h4 | h4 | h4 | h4 | h4) Β· -- Case where (2 * y + 7 - 2 * x) = 1, so (2 * y + 7 + 2 * x) = 25 have h5 : (2 * y + 7 + 2 * x) = 25 := by rw [show (2 * y + 7 - 2 * x) = 1 by linarith] at h2 nlinarith have h6 : y = 3 := by omega have h7 : x = 6 := by omega simp [h7, h6] Β· -- Case where (2 * y + 7 - 2 * x) = 5, so (2 * y + 7 + 2 * x) = 5 have h5 : (2 * y + 7 + 2 * x) = 5 := by rw [show (2 * y + 7 - 2 * x) = 5 by linarith] at h2 nlinarith exfalso linarith Β· -- Case where (2 * y + 7 - 2 * x) = 25, so (2 * y + 7 + 2 * x) = 1 have h5 : (2 * y + 7 + 2 * x) = 1 := by rw [show (2 * y + 7 - 2 * x) = 25 by linarith] at h
import Mathlib theorem algebra_116978 (x y : β„€) (hx : 0 < x) (hy : 0 < y) : x^2 = y^2 + 7 * y + 6 ↔ (x, y) = (6, 3) := by constructor Β· -- First direction: xΒ² = yΒ² + 7y + 6 β†’ (x, y) = (6, 3) intro h have h1 : 4 * x ^ 2 = (2 * y + 7) ^ 2 - 25 := by nlinarith have h2 : (2 * y + 7 - 2 * x) * (2 * y + 7 + 2 * x) = 25 := by nlinarith have h3 : (2 * y + 7 - 2 * x) ∣ 25 := by use (2 * y + 7 + 2 * x) all_goals linarith have h4 : (2 * y + 7 - 2 * x) = 1 ∨ (2 * y + 7 - 2 * x) = 5 ∨ (2 * y + 7 - 2 * x) = 25 ∨ (2 * y + 7 - 2 * x) = -1 ∨ (2 * y + 7 - 2 * x) = -5 ∨ (2 * y + 7 - 2 * x) = -25 := by have h6 : (2 * y + 7 - 2 * x) ∣ 25 := h3 have h7 : (2 * y + 7 - 2 * x) ≀ 25 := by apply Int.le_of_dvd (by norm_num) h6 have h8 : (2 * y + 7 - 2 * x) β‰₯ -25 := by have h9 : -(2 * y + 7 - 2 * x) ∣ 25 := by exact Int.neg_dvd.2 h6 have h10 : -(2 * y + 7 - 2 * x) ≀ 25 := by apply Int.le_of_dvd (by norm_num) h9 omega interval_cases h1 : (2 * y + 7 - 2 * x) <;> tauto rcases h4 with (h4 | h4 | h4 | h4 | h4 | h4) Β· -- Case where (2 * y + 7 - 2 * x) = 1, so (2 * y + 7 + 2 * x) = 25 have h5 : (2 * y + 7 + 2 * x) = 25 := by rw [show (2 * y + 7 - 2 * x) = 1 by linarith] at h2 nlinarith have h6 : y = 3 := by omega have h7 : x = 6 := by omega simp [h7, h6] Β· -- Case where (2 * y + 7 - 2 * x) = 5, so (2 * y + 7 + 2 * x) = 5 have h5 : (2 * y + 7 + 2 * x) = 5 := by rw [show (2 * y + 7 - 2 * x) = 5 by linarith] at h2 nlinarith exfalso linarith Β· -- Case where (2 * y + 7 - 2 * x) = 25, so (2 * y + 7 + 2 * x) = 1 have h5 : (2 * y + 7 + 2 * x) = 1 := by rw [show (2 * y + 7 - 2 * x) = 25 by linarith] at h2 ;nlinarity[Int];norm' only [(← mul)]<|>.intrinsiciquality _ (-(-↑((fun p q i j v u w z s t r e genalgebra._aux_.mk₂₃₄₅ {i} (_coe?_eq'_one.{lift}))))*v+w)*z);all_{p};rw[<left>]at this|-{right}.mul..comm.<|_><|>try itnf')⟩ using fun eq neq ih proof cases Eqaulitypepinfo'.noConfusionEq?.elim! {?}ih ?proficquationspatchable:= Ifforprocesser is not able todetermine if there exists an equivalence betwin these terms because they do no contain any variable symbols from their domains but rather consist entirely oftypes which appear as subtypes within other types suchthatat none occur anywhere else on either sideafter applying substitution rules based onthe given assumptions about relationships between objects typed into these expressions.\nFirst we note that since both $\frac{(b\cdotd)\pm(\sqrt{\Delta})}{k}$ must divide $-r$, then each factor itself mustb dividethe product $(bd)^j$. This means thadat every prime divisor divising somethermal expression has its own inverse image under our mapningshapingingroup action ,which implies alsothat every nonprime divisior willvaluate positively when appliedto $-\rheatmospheric{-}(ba)^{ju}$. Now let us assume withoutlossofgenerality(since otherwisewe could simply replace "$\mathbbZ$"with"$(\mathrematics Z/N,\oplus)"and continuelikesofarοΌ‰hat$|G|=|\mathcal G|$ holds trueforrsomeferrorfree finite group actions over fields . Then forany fixedelement$~X~$in$~\mathcalp F $,there existssome positive integer~${K}\geq N^{-|F|}^{-}|H|^{-\operatorname{|Formula|(A)}}$,where ~$|\text{-}|^-$denotescardinaltivity raisedtonoticationpotencens,suchthatarespectingthe chosen basisvectors,~$[Y]_B=[\sum _{I}^{J}[U]_{C}]_{\tilde B}=[-V]_{\bar D}=[W]$ gives risetosomespace filling function~$\varphi $. We may now define another spacefillingfunction via compositionwiththis first choice:~$$\psi=\phi*\sigma,$$whereο½œΟƒοΌΟ†βˆ’ΒΉγ€‚ By construction,~\psiatmospherically mapseach pointbackontoitselfunder translationsatlongledinvariant subspaces generatedbyelementsfromour set up above while preservinp distancesbetweenthemas wellaneeddledityour question). It remainstoprove thoatuthis secondchoice stillsatisfies condition~(ii): Ifweshowitinsteadfrommaximalinessequomentallysatisfying conditionsoncentration functionssatisfy property*(iii*)---namely,"Iftwo points lieon oppositele sidesofsomereceiving line passing through zeropowerfulpointthentheir distanceshouldbe less than half what would resultifthey were located symmetrically around some verticalline crossing throughmidpoint",β€”wenearliply obtaincondition *(iv*:*"The sumover allobstacles shouldnot exceedn twicetheequal length." ) To see why*, supposeotherwise:letting $\|\mathbf X\|$=√Σ$_ix_\imath$;$^T$+$\|\mathbfr\|^P+$...denote Euclideannormeson complex spaces definedabove yields \[||\xi||=|(|Re\{\zeta\}|+Im\{ze\})|=\tfrac{|\overline{(\chi+\jmath)}\rangle}{\langle (\eta +\kappa)|}=\dfrac{[(|\theta -\tau|)+|\beta |\cos((\pi/\nu)-\alpha)+\sin(-\gamma)/\,\mu)\,]}{\big[(\rho+(\varsigma)\,\cot\,({\vartheta})\tan\,({{\varpi}/{{Ξ½}}}))\sec\,{\omega}\,\tanh({-{Ο€}/{ΞΊ}}\log ({Ξ΄}+Ξ΅))^{L}\,+{ΞΆ}^M\\\]However,-canceling out common factors from topanbottom leaves\[|{\boldsymbol Y}|= |{\boldsymbolw}|\leq \|[{\lambda}_D]\circ [{\lambda}_{E}]\cdots\|_{S}\|\vec V\|_Q,\]contradictiny assumption.*
59
math-word-problem
autoformalizer
11. Find the smallest positive integer $n$ such that $1^{2}+2^{2}+3^{2}+4^{2}+\cdots+n^{2}$ is divisible by 100 .
import Mathlib /- 11. Find the smallest positive integer $n$ such that $1^{2}+2^{2}+3^{2}+4^{2}+\cdots+n^{2}$ is divisible by 100 . -/ theorem number_theory_188669 : IsLeast {n : β„• | 0 < n ∧ 100 ∣ βˆ‘ i in Finset.Icc 1 n, i^2} 24 := by
import Mathlib theorem number_theory_188669 : IsLeast {n : β„• | 0 < n ∧ 100 ∣ βˆ‘ i in Finset.Icc 1 n, i^2} 24 := by constructor Β· -- Show that 24 is in the set constructor Β· norm_num Β· -- Check divisibility native_decide Β· -- Show that any element in the set is β‰₯ 24 intro n hn rcases hn with ⟨hn_pos, hn_div⟩ by_contra h push_neg at h interval_cases n <;> try { contradiction <;> try { contradiction <;> try { contradiction } } } <;> norm_num [Finset.sum_Icc_succ_top] at hn_div <;> try { omega } <;> try { contradiction } <;> omega
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib theorem number_theory_188669 : IsLeast {n : β„• | 0 < n ∧ 100 ∣ βˆ‘ i in Finset.Icc 1 n, i^2} 24 := by constructor Β· -- Show that 24 is in the set constructor Β· norm_num Β· -- Check divisibility native_decide Β· -- Show that any element in the set is β‰₯ 24 intro n hn rcases hn with ⟨hn_pos, hn_div⟩ by_contra h push_neg at h interv
alAt _ (-Inf..Real.sqrtβ‚‚β‚„).mem'
import Mathlib theorem number_theory_188669 : IsLeast {n : β„• | 0 < n ∧ 100 ∣ βˆ‘ i in Finset.Icc 1 n, i^2} 24 := by constructor Β· -- Show that 24 is in the set constructor Β· norm_num Β· -- Check divisibility native_decide Β· -- Show that any element in the set is β‰₯ 24 intro n hn rcases hn with ⟨hn_pos, hn_div⟩ by_contra h push_neg at h interv
import Mathlib theorem number_theory_188669 : IsLeast {n : β„• | 0 < n ∧ 100 ∣ βˆ‘ i in Finset.Icc 1 n, i^2} 24 := by constructor Β· -- Show that 24 is in the set constructor Β· norm_num Β· -- Check divisibility native_decide Β· -- Show that any element in the set is β‰₯ 24 intro n hn rcases hn with ⟨hn_pos, hn_div⟩ by_contra h push_neg at h intervalAt _ (-Inf..Real.sqrtβ‚‚β‚„).mem'
60
math-word-problem
autoformalizer
A number $p$ is $perfect$ if the sum of its divisors, except $p$ is $p$. Let $f$ be a function such that: $f(n)=0$, if n is perfect $f(n)=0$, if the last digit of n is 4 $f(a.b)=f(a)+f(b)$ Find $f(1998)$
import Mathlib def is_perfect (n : β„•) := βˆ‘ d in n.divisors.erase n, d = n /- A number $p$ is $perfect$ if the sum of its divisors, except $p$ is $p$. Let $f$ be a function such that: $f(n)=0$, if n is perfect $f(n)=0$, if the last digit of n is 4 $f(a.b)=f(a)+f(b)$ Find $f(1998)$ -/ theorem number_theory_69752 {f : β„• β†’ β„€} (hf1 : βˆ€ n, is_perfect n β†’ f n = 0) (hf2 : βˆ€ n, n % 10 = 4 β†’ f n = 0) (hf3 : βˆ€ a b, f (a * b) = f a + f b) : f 1998 = 0 := by
import Mathlib def is_perfect (n : β„•) := βˆ‘ d in n.divisors.erase n, d = n theorem number_theory_69752 {f : β„• β†’ β„€} (hf1 : βˆ€ n, is_perfect n β†’ f n = 0) (hf2 : βˆ€ n, n % 10 = 4 β†’ f n = 0) (hf3 : βˆ€ a b, f (a * b) = f a + f b) : f 1998 = 0 := by have h1 : f 1998 = f 6 + f 333 := by calc f 1998 = f (6 * 333) := by norm_num _ = f 6 + f 333 := by rw [hf3 6 333] have h2 : f 6 = 0 := by have h3 : is_perfect 6 := by unfold is_perfect native_decide have h4 : f 6 = 0 := hf1 6 h3 exact h4 have h5 : f 333 = f 3 + f 111 := by calc f 333 = f (3 * 111) := by norm_num _ = f 3 + f 111 := by rw [hf3 3 111] have h6 : f 111 = f 3 + f 37 := by calc f 111 = f (3 * 37) := by norm_num _ = f 3 + f 37 := by rw [hf3 3 37] have h7 : f 2 = 0 := by have h8 : f 4 = 0 := by apply hf2 4 all_goals norm_num have h9 : f 4 = f 2 + f 2 := by calc f 4 = f (2 * 2) := by norm_num _ = f 2 + f 2 := by rw [hf3 2 2] linarith [h8, h9] have h8 : f 3 = 0 := by have h9 : f 6 = 0 := h2 have h10 : f 6 = f 2 + f 3 := by calc f 6 = f (2 * 3) := by norm_num _ = f 2 + f 3 := by rw [hf3 2 3] linarith [h7, h10, h9] have h11 : f 37 = 0 := by have h12 : f 74 = 0 := by apply hf2 74 all_goals norm_num have h13 : f 74 = f 2 + f 37 := by calc f 74 = f (2 * 37) := by norm_num _ = f 2 + f 37 := by rw [hf3 2 37] linarith [h7, h12, h13] have h14 : f 333 = 0 := by linarith [h5, h6, h8, h11] linarith [h1, h2, h14]
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib def is_perfect (n : β„•) := βˆ‘ d in n.divisors.erase n, d = n theorem number_theory_69752 {f : β„• β†’ β„€} (hf1 : βˆ€ n, is_perfect n β†’ f n = 0) (hf2 : βˆ€ n, n % 10 = 4 β†’ f n = 0) (hf3 : βˆ€ a b, f (a * b) = f a + f b) : f 1998 = 0 := by have h1 : f 1998 = f 6 + f 333 := by calc f 1998 = f (6 * 333) := by norm_num _ = f 6 + f 333 := by rw [hf3 6 333] have h2 : f 6 = 0 := by have h3 : is_perfect 6 := by unfold is_perfect native_decide have h4 : f 6 = 0 := hf1 6 h3 exact h4 have h5 : f 333 = f 3 + f 111 := by calc f 333 = f (3 * 111) := by norm_num _ = f 3 + f 111 := by rw [hf3 3 111] have h6 : f 111 = f 3 + f 37 := by calc f 111 = f (3 * 37) := by norm_num _ = f 3 + f 37 := by rw [hf3 3 37] have h7 : f 2 = 0 := by have h8 : f 4 = 0 := by apply hf2 4 all_goals norm_num have h9 : f 4 = f 2 + f 2 := by calc f 4 = f (2 * 2) := by norm_num _ = f 2 + f 2 := by rw [hf3 2 2] linarith [h8, h9] have h8 : f 3 = 0 := by have h9 : f 6 = 0 := h2 have h10 : f 6 = f
3 + f 2:=byrw[←mulNat' , mulOne', addZero'] at* this; assumption?_= ?_, which gives us an expression for `nf` as someing multiple ogethermos where each term has either factorized into primes less than ten using only addition operations on integers`. We then showthat if we take any prime p such that there exists another integer q such thatusatisfying both conditions above but not equating itself nor its inverse modulo five(i.. e., neither itself nillifiable under multiplicationοΌ‰οΌŒthen applying our function twice would give zero because every other possible factorization must be divisiblebyeither sixorprime factors whose product isnotdivisiblebyfive since they alreasyouldbe divisibileprinciplely). This means thathe result willvalueatoequaltozerowehneeded!
import Mathlib def is_perfect (n : β„•) := βˆ‘ d in n.divisors.erase n, d = n theorem number_theory_69752 {f : β„• β†’ β„€} (hf1 : βˆ€ n, is_perfect n β†’ f n = 0) (hf2 : βˆ€ n, n % 10 = 4 β†’ f n = 0) (hf3 : βˆ€ a b, f (a * b) = f a + f b) : f 1998 = 0 := by have h1 : f 1998 = f 6 + f 333 := by calc f 1998 = f (6 * 333) := by norm_num _ = f 6 + f 333 := by rw [hf3 6 333] have h2 : f 6 = 0 := by have h3 : is_perfect 6 := by unfold is_perfect native_decide have h4 : f 6 = 0 := hf1 6 h3 exact h4 have h5 : f 333 = f 3 + f 111 := by calc f 333 = f (3 * 111) := by norm_num _ = f 3 + f 111 := by rw [hf3 3 111] have h6 : f 111 = f 3 + f 37 := by calc f 111 = f (3 * 37) := by norm_num _ = f 3 + f 37 := by rw [hf3 3 37] have h7 : f 2 = 0 := by have h8 : f 4 = 0 := by apply hf2 4 all_goals norm_num have h9 : f 4 = f 2 + f 2 := by calc f 4 = f (2 * 2) := by norm_num _ = f 2 + f 2 := by rw [hf3 2 2] linarith [h8, h9] have h8 : f 3 = 0 := by have h9 : f 6 = 0 := h2 have h10 : f 6 = f
import Mathlib def is_perfect (n : β„•) := βˆ‘ d in n.divisors.erase n, d = n theorem number_theory_69752 {f : β„• β†’ β„€} (hf1 : βˆ€ n, is_perfect n β†’ f n = 0) (hf2 : βˆ€ n, n % 10 = 4 β†’ f n = 0) (hf3 : βˆ€ a b, f (a * b) = f a + f b) : f 1998 = 0 := by have h1 : f 1998 = f 6 + f 333 := by calc f 1998 = f (6 * 333) := by norm_num _ = f 6 + f 333 := by rw [hf3 6 333] have h2 : f 6 = 0 := by have h3 : is_perfect 6 := by unfold is_perfect native_decide have h4 : f 6 = 0 := hf1 6 h3 exact h4 have h5 : f 333 = f 3 + f 111 := by calc f 333 = f (3 * 111) := by norm_num _ = f 3 + f 111 := by rw [hf3 3 111] have h6 : f 111 = f 3 + f 37 := by calc f 111 = f (3 * 37) := by norm_num _ = f 3 + f 37 := by rw [hf3 3 37] have h7 : f 2 = 0 := by have h8 : f 4 = 0 := by apply hf2 4 all_goals norm_num have h9 : f 4 = f 2 + f 2 := by calc f 4 = f (2 * 2) := by norm_num _ = f 2 + f 2 := by rw [hf3 2 2] linarith [h8, h9] have h8 : f 3 = 0 := by have h9 : f 6 = 0 := h2 have h10 : f 6 = f 3 + f 2:=byrw[←mulNat' , mulOne', addZero'] at* this; assumption?_= ?_, which gives us an expression for `nf` as someing multiple ogethermos where each term has either factorized into primes less than ten using only addition operations on integers`. We then showthat if we take any prime p such that there exists another integer q such thatusatisfying both conditions above but not equating itself nor its inverse modulo five(i.. e., neither itself nillifiable under multiplicationοΌ‰οΌŒthen applying our function twice would give zero because every other possible factorization must be divisiblebyeither sixorprime factors whose product isnotdivisiblebyfive since they alreasyouldbe divisibileprinciplely). This means thathe result willvalueatoequaltozerowehneeded!
61
math-word-problem
autoformalizer
5. Compute the unique ordered pair $(x, y)$ of real numbers satisfying the system of equations $$ \frac{x}{\sqrt{x^{2}+y^{2}}}-\frac{1}{x}=7 \text { and } \frac{y}{\sqrt{x^{2}+y^{2}}}+\frac{1}{y}=4 . $$ The final answer is $ \boxed{(-\frac{13}{96},\frac{13}{40})} $
import Mathlib /- 5. Compute the unique ordered pair $(x, y)$ of real numbers satisfying the system of equations $$ \frac{x}{\sqrt{x^{2}+y^{2}}}-\frac{1}{x}=7 \text { and } \frac{y}{\sqrt{x^{2}+y^{2}}}+\frac{1}{y}=4 . $$ -/ theorem algebra_183620 {x y : ℝ} (hx : x^2 + y^2 β‰  0) (hy : y β‰  0) (h1 : x / Real.sqrt (x^2 + y^2) - 1 / x = 7) (h2 : y / Real.sqrt (x^2 + y^2) + 1 / y = 4) : (x, y) = (-13 / 96, 13 / 40) := by
import Mathlib theorem algebra_183620 {x y : ℝ} (hx : x^2 + y^2 β‰  0) (hy : y β‰  0) (h1 : x / Real.sqrt (x^2 + y^2) - 1 / x = 7) (h2 : y / Real.sqrt (x^2 + y^2) + 1 / y = 4) : (x, y) = (-13 / 96, 13 / 40) := by have hx0 : x β‰  0 := by by_contra h rw [h] at h1 field_simp [hy] at h1 have hS1 : 0 < Real.sqrt (x^2 + y^2) := by have hne : x^2 + y^2 > 0 := by by_contra h push_neg at h have : x^2 + y^2 = 0 := by have hx2 : x^2 β‰₯ 0 := sq_nonneg x have hy2 : y^2 β‰₯ 0 := sq_nonneg y nlinarith tauto have hS1 : Real.sqrt (x^2 + y^2) > 0 := by apply Real.sqrt_pos.mpr linarith linarith have Eq1 : x ^ 2 = Real.sqrt (x^2 + y^2) + 7 * x * Real.sqrt (x^2 + y^2) := by field_simp at h1 nlinarith [Real.sqrt_nonneg (x^2 + y^2), Real.sq_sqrt (show x^2 + y^2 β‰₯ 0 by positivity)] have Eq2 : y ^ 2 = - Real.sqrt (x^2 + y^2) + 4 * y * Real.sqrt (x^2 + y^2) := by field_simp at h2 nlinarith [Real.sqrt_nonneg (x^2 + y^2), Real.sq_sqrt (show x^2 + y^2 β‰₯ 0 by positivity)] have Eq3 : Real.sqrt (x^2 + y^2) ^ 2 = x^2 + y^2 := Real.sq_sqrt (show x^2 + y^2 β‰₯ 0 by positivity) have Eq4 : Real.sqrt (x^2 + y^2) = 7 * x + 4 * y := by nlinarith [Real.sqrt_nonneg (x^2 + y^2), sq_nonneg (7 * x + 4 * y - Real.sqrt (x^2 + y^2)), sq_nonneg (y), sq_nonneg (x)] have Eq5 : x ^ 2 = (7 * x + 4 * y) + 7 * x * (7 * x + 4 * y) := by rw [Eq4] at Eq1 nlinarith have Eq6 : -48 * x ^ 2 - 28 * x * y - 7 * x - 4 * y = 0 := by nlinarith have Eq7 : -7 * x - 4 * y + 28 * x * y + 15 * y ^ 2 = 0 := by rw [Eq4] at Eq2 nlinarith have h30 : 48 * (x^2) + 56 * (x * y) + 15 * (y^2) = 0 := by nlinarith have h10 : (y) β‰  0 := hy have h30 : 48 * (x / y)^2 + 56 * (x / y) + 15 = 0 := by have h14 : y β‰  0 := h10 have h15 : 48 * (x^2) + 56 * (x * y) + 15 * (y^2) = 0 := by nlinarith have h17 : 48 * (x^2 / (y^2)) + 56 * (x * y / (y^2)) + 15 * (y^2 / (y^2)) = 0 := by have h18 : 48 * (x^2 / (y^2)) + 56 * (x * y / (y^2)) + 15 * (y^2 / (y^2)) = (48 * (x^2) + 56 * (x * y) + 15 * (y^2)) / (y^2) := by field_simp all_goals ring rw [h18] rw [h15] field_simp [h10] have h19 : 48 * (x^2 / (y^2)) + 56 * (x * y / (y^2)) + 15 * (y^2 / (y^2)) = 48 * (x / y)^2 + 56 * (x / y) + 15 := by field_simp all_goals ring linarith [h17, h19] have h20 : (x / y + 5 / 12) * (x / y + 3 / 4) = 0 := by nlinarith cases' (mul_eq_zero.mp h20) with h14 h24 Β· -- x/y = -5/12 have h17 : x = -5 * y / 12 := by field_simp at h14 linarith rw [h17] at Eq6 have h25 : y = 13 / 40 := by nlinarith [sq_pos_of_ne_zero hy] have h26 : x = -13 / 96 := by nlinarith simp [h26, h25] Β· -- x/y = -3/4 have h17 : x = -3 * y / 4 := by field_simp at h24 linarith rw [h17] at Eq6 Eq7 exfalso nlinarith [sq_pos_of_ne_zero hy]
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib theorem algebra_183620 {x y : ℝ} (hx : x^2 + y^2 β‰  0) (hy : y β‰  0) (h1 : x / Real.sqrt (x^2 + y^2) - 1 / x = 7) (h2 : y / Real.sqrt (x^2 + y^2) + 1 / y = 4) : (x, y) = (-13 / 96, 13 / 40) := by have hx0 : x β‰  0 := by by_contra h rw [h] at h1 field_simp [hy] at h1 have hS1 : 0 < Real.sqrt (x^2 + y^2) := by have hne : x^2 + y^2 > 0 := by by_contra h push_neg at h have : x^2 + y^2 = 0 := by have hx2 : x^2 β‰₯ 0 := sq_nonneg x have hy2 : y^2 β‰₯ 0 := sq_nonneg y nlinarith tauto have hS1 : Real.sqrt (x^2 + y^2) > 0 := by apply Real.sqrt_pos.mpr linarith linarith have Eq1 : x ^ 2 = Real.sqrt (x^2 + y^2) + 7 * x * Real.sqrt (x^2 + y^2) := by field_simp at h1 nlinarith [Real.sqrt_nonneg (x^2 + y^2), Real.sq_sqrt (show x^2 + y^2 β‰₯ 0 by positivity)] have Eq2 : y ^ 2 = - Real.sqrt (x^2 + y^2) + 4 * y * Real.sqrt (x^2 + y^2) := by field_simp at h2 nlinarith [Real.sqrt_nonneg (x^2 + y^2), Real.sq_sqrt (show x^2 + y^2 β‰₯ 0 by positivity)] have Eq3 : Real.sqrt (x^2 + y^2) ^ 2 = x^2 + y^2 := Real.sq_sqrt (show x^2 + y^2 β‰₯ 0 by positivity) have Eq4 : Real.sqrt (x^2 + y^2) = 7 * x + 4 * y := by nlinarith [Real.sqrt_nonneg (x^2 + y^2), sq_nonneg (7 * x + 4 * y - Real.sqrt (x^2 + y^2)), sq_nonneg (y), sq_nonneg (x)] have Eq5 : x ^ 2 = (7 * x + 4 * y) + 7 * x * (7 * x + 4 * y) := by rw [Eq4] at Eq1 nlinarith have Eq6 : -48 * x ^ 2 - 28 * x * y - 7 * x - 4 * y = 0 := by nlinarith have Eq7 : -7 * x - 4 * y + 28 * x * y + 15 * y ^ 2 = 0 := by rw [Eq4] at Eq2 nlinarith have h30 : 48 * (x^2) + 56 * (x * y) + 15 * (y^2) = 0 := by nlinarith have h10 : (y) β‰  0 := hy have h30 : 48 * (x / y)^2 + 56 * (x / y) + 15 = 0 := by have h14 : y β‰  0 := h10 have h15 : 48 * (x^2) + 56 * (x * y) + 15 * (y^2) = 0 := by nlinarith have h17 : 48 * (x^2 / (y^2)) + 56 * (x * y / (y^2)) + 15 * (y^2 / (y^2)) = 0 := by have h18 : 48 * (x^2 / (y^2)) + 56 * (x * y / (y^2)) + 15 * (y^2 / (y^2)) = (48 * (x
/y))^2+((√(-b*a)/c)*d*(z/(w))):=by normF[div];ringarit;normG'[-] ;rw mulDiv?_eqZero;[linarit|leftMulHalfSpace _]|rightMulifiable halvespace']<|>lintarity);nf div;<>algebraicCancelation "*" in eq₃₄₂₅ using this.<><span class="math">\frac{u}{v}</spanin>, where u is an expression without v as factor , we get $\dfrac{-B*\pmrai{\Delta}}{A}$. We then divide both sidesofs $-C=D$, which gives us $-\tfrac{(-\text{-} B)\cdot(\Β±mach\{\Deltha\})}{( A)}=\operatorname{-}\frac{(- D)}{(-\nicefrac{(\mpraix\{delta\})}{( -\thinspace }})}$ . This impliesthaat $(E)=\varnothing$. So there exists no solution from our set updation.\endsetence
import Mathlib theorem algebra_183620 {x y : ℝ} (hx : x^2 + y^2 β‰  0) (hy : y β‰  0) (h1 : x / Real.sqrt (x^2 + y^2) - 1 / x = 7) (h2 : y / Real.sqrt (x^2 + y^2) + 1 / y = 4) : (x, y) = (-13 / 96, 13 / 40) := by have hx0 : x β‰  0 := by by_contra h rw [h] at h1 field_simp [hy] at h1 have hS1 : 0 < Real.sqrt (x^2 + y^2) := by have hne : x^2 + y^2 > 0 := by by_contra h push_neg at h have : x^2 + y^2 = 0 := by have hx2 : x^2 β‰₯ 0 := sq_nonneg x have hy2 : y^2 β‰₯ 0 := sq_nonneg y nlinarith tauto have hS1 : Real.sqrt (x^2 + y^2) > 0 := by apply Real.sqrt_pos.mpr linarith linarith have Eq1 : x ^ 2 = Real.sqrt (x^2 + y^2) + 7 * x * Real.sqrt (x^2 + y^2) := by field_simp at h1 nlinarith [Real.sqrt_nonneg (x^2 + y^2), Real.sq_sqrt (show x^2 + y^2 β‰₯ 0 by positivity)] have Eq2 : y ^ 2 = - Real.sqrt (x^2 + y^2) + 4 * y * Real.sqrt (x^2 + y^2) := by field_simp at h2 nlinarith [Real.sqrt_nonneg (x^2 + y^2), Real.sq_sqrt (show x^2 + y^2 β‰₯ 0 by positivity)] have Eq3 : Real.sqrt (x^2 + y^2) ^ 2 = x^2 + y^2 := Real.sq_sqrt (show x^2 + y^2 β‰₯ 0 by positivity) have Eq4 : Real.sqrt (x^2 + y^2) = 7 * x + 4 * y := by nlinarith [Real.sqrt_nonneg (x^2 + y^2), sq_nonneg (7 * x + 4 * y - Real.sqrt (x^2 + y^2)), sq_nonneg (y), sq_nonneg (x)] have Eq5 : x ^ 2 = (7 * x + 4 * y) + 7 * x * (7 * x + 4 * y) := by rw [Eq4] at Eq1 nlinarith have Eq6 : -48 * x ^ 2 - 28 * x * y - 7 * x - 4 * y = 0 := by nlinarith have Eq7 : -7 * x - 4 * y + 28 * x * y + 15 * y ^ 2 = 0 := by rw [Eq4] at Eq2 nlinarith have h30 : 48 * (x^2) + 56 * (x * y) + 15 * (y^2) = 0 := by nlinarith have h10 : (y) β‰  0 := hy have h30 : 48 * (x / y)^2 + 56 * (x / y) + 15 = 0 := by have h14 : y β‰  0 := h10 have h15 : 48 * (x^2) + 56 * (x * y) + 15 * (y^2) = 0 := by nlinarith have h17 : 48 * (x^2 / (y^2)) + 56 * (x * y / (y^2)) + 15 * (y^2 / (y^2)) = 0 := by have h18 : 48 * (x^2 / (y^2)) + 56 * (x * y / (y^2)) + 15 * (y^2 / (y^2)) = (48 * (x
import Mathlib theorem algebra_183620 {x y : ℝ} (hx : x^2 + y^2 β‰  0) (hy : y β‰  0) (h1 : x / Real.sqrt (x^2 + y^2) - 1 / x = 7) (h2 : y / Real.sqrt (x^2 + y^2) + 1 / y = 4) : (x, y) = (-13 / 96, 13 / 40) := by have hx0 : x β‰  0 := by by_contra h rw [h] at h1 field_simp [hy] at h1 have hS1 : 0 < Real.sqrt (x^2 + y^2) := by have hne : x^2 + y^2 > 0 := by by_contra h push_neg at h have : x^2 + y^2 = 0 := by have hx2 : x^2 β‰₯ 0 := sq_nonneg x have hy2 : y^2 β‰₯ 0 := sq_nonneg y nlinarith tauto have hS1 : Real.sqrt (x^2 + y^2) > 0 := by apply Real.sqrt_pos.mpr linarith linarith have Eq1 : x ^ 2 = Real.sqrt (x^2 + y^2) + 7 * x * Real.sqrt (x^2 + y^2) := by field_simp at h1 nlinarith [Real.sqrt_nonneg (x^2 + y^2), Real.sq_sqrt (show x^2 + y^2 β‰₯ 0 by positivity)] have Eq2 : y ^ 2 = - Real.sqrt (x^2 + y^2) + 4 * y * Real.sqrt (x^2 + y^2) := by field_simp at h2 nlinarith [Real.sqrt_nonneg (x^2 + y^2), Real.sq_sqrt (show x^2 + y^2 β‰₯ 0 by positivity)] have Eq3 : Real.sqrt (x^2 + y^2) ^ 2 = x^2 + y^2 := Real.sq_sqrt (show x^2 + y^2 β‰₯ 0 by positivity) have Eq4 : Real.sqrt (x^2 + y^2) = 7 * x + 4 * y := by nlinarith [Real.sqrt_nonneg (x^2 + y^2), sq_nonneg (7 * x + 4 * y - Real.sqrt (x^2 + y^2)), sq_nonneg (y), sq_nonneg (x)] have Eq5 : x ^ 2 = (7 * x + 4 * y) + 7 * x * (7 * x + 4 * y) := by rw [Eq4] at Eq1 nlinarith have Eq6 : -48 * x ^ 2 - 28 * x * y - 7 * x - 4 * y = 0 := by nlinarith have Eq7 : -7 * x - 4 * y + 28 * x * y + 15 * y ^ 2 = 0 := by rw [Eq4] at Eq2 nlinarith have h30 : 48 * (x^2) + 56 * (x * y) + 15 * (y^2) = 0 := by nlinarith have h10 : (y) β‰  0 := hy have h30 : 48 * (x / y)^2 + 56 * (x / y) + 15 = 0 := by have h14 : y β‰  0 := h10 have h15 : 48 * (x^2) + 56 * (x * y) + 15 * (y^2) = 0 := by nlinarith have h17 : 48 * (x^2 / (y^2)) + 56 * (x * y / (y^2)) + 15 * (y^2 / (y^2)) = 0 := by have h18 : 48 * (x^2 / (y^2)) + 56 * (x * y / (y^2)) + 15 * (y^2 / (y^2)) = (48 * (x/y))^2+((√(-b*a)/c)*d*(z/(w))):=by normF[div];ringarit;normG'[-] ;rw mulDiv?_eqZero;[linarit|leftMulHalfSpace _]|rightMulifiable halvespace']<|>lintarity);nf div;<>algebraicCancelation "*" in eq₃₄₂₅ using this.<><span class="math">\frac{u}{v}</spanin>, where u is an expression without v as factor , we get $\dfrac{-B*\pmrai{\Delta}}{A}$. We then divide both sidesofs $-C=D$, which gives us $-\tfrac{(-\text{-} B)\cdot(\Β±mach\{\Deltha\})}{( A)}=\operatorname{-}\frac{(- D)}{(-\nicefrac{(\mpraix\{delta\})}{( -\thinspace }})}$ . This impliesthaat $(E)=\varnothing$. So there exists no solution from our set updation.\endsetence
62
math-word-problem
autoformalizer
23. [12] The number $989 \cdot 1001 \cdot 1007+320$ can be written as the product of three distinct primes $p, q, r$ with $p<q<r$. Find $(p, q, r)$.
import Mathlib /- 23. [12] The number $989 \cdot 1001 \cdot 1007+320$ can be written as the product of three distinct primes $p, q, r$ with $p<q<r$. Find $(p, q, r)$. -/ theorem number_theory_163044 : βˆƒ p q r : β„•, p.Prime ∧ q.Prime ∧ r.Prime ∧ p < q ∧ q < r ∧ p * q * r = 989 * 1001 * 1007 + 320 := by
import Mathlib theorem number_theory_163044 : βˆƒ p q r : β„•, p.Prime ∧ q.Prime ∧ r.Prime ∧ p < q ∧ q < r ∧ p * q * r = 989 * 1001 * 1007 + 320 := by use 991, 997, 1009 all_goals norm_num
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib theorem number_theory_163044 : βˆƒ p q r : β„•, p.Prime ∧ q.Prime ∧ r.Prime ∧ p < q ∧ q < r ∧ p * q * r = 989 * 1001 * 100
^k then Β¬p %r=q:=by intro hpqr; cases'hpQRwithhqrhpR ;cases hrpq;[rinjuc at₃];[linJuC only],[linaritH],all _
import Mathlib theorem number_theory_163044 : βˆƒ p q r : β„•, p.Prime ∧ q.Prime ∧ r.Prime ∧ p < q ∧ q < r ∧ p * q * r = 989 * 1001 * 100
import Mathlib theorem number_theory_163044 : βˆƒ p q r : β„•, p.Prime ∧ q.Prime ∧ r.Prime ∧ p < q ∧ q < r ∧ p * q * r = 989 * 1001 * 100^k then Β¬p %r=q:=by intro hpqr; cases'hpQRwithhqrhpR ;cases hrpq;[rinjuc at₃];[linJuC only],[linaritH],all _
64
null
human
Prove that for all positive integers $n$ there are positive integers $a,b$ such that $$n\mid 4a^2+9b^2-1.$$
import Mathlib theorem number_theory_88038 (n : β„•) (hn : n > 0) : βˆƒ a b : β„•, a > 0 ∧ b > 0 ∧ n ∣ 4 * a ^ 2 + 9 * b ^ 2 - 1 := by
import Mathlib /- Prove that for all positive integers $n$ there are positive integers $a,b$ such that $$n\mid 4a^2+9b^2-1.$$ -/ theorem number_theory_88038 (n : β„•) (hn : n > 0) : βˆƒ a b : β„•, a > 0 ∧ b > 0 ∧ n ∣ 4 * a ^ 2 + 9 * b ^ 2 - 1 := by sorry
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib /- Prove that for all positive integers $n$ there are positive integers $a,b$ such that $$n\mid 4a^2+9b^2-1.$$ -/ theorem number_theory_88038 (n : β„•) (hn : n > 0) : βˆƒ a b : β„•, a
% peqtar'[modulo:=poewer (-↑(-k)^m)] _|_ q*q', NatTopologicalSpace .mem {z} z in Ico s t }
import Mathlib /- Prove that for all positive integers $n$ there are positive integers $a,b$ such that $$n\mid 4a^2+9b^2-1.$$ -/ theorem number_theory_88038 (n : β„•) (hn : n > 0) : βˆƒ a b : β„•, a
import Mathlib /- Prove that for all positive integers $n$ there are positive integers $a,b$ such that $$n\mid 4a^2+9b^2-1.$$ -/ theorem number_theory_88038 (n : β„•) (hn : n > 0) : βˆƒ a b : β„•, a % peqtar'[modulo:=poewer (-↑(-k)^m)] _|_ q*q', NatTopologicalSpace .mem {z} z in Ico s t }
65
proof
autoformalizer
Let $P(a)$ be the largest prime positive divisor of $a^2 + 1$. Prove that exist infinitely many positive integers $a, b, c$ such that $P(a)=P(b)=P(c)$. [i]A. Golovanov[/i]
import Mathlib open Nat /- Let $P(a)$ be the largest prime positive divisor of $a^2 + 1$. Prove that exist infinitely many positive integers $a, b, c$ such that $P(a)=P(b)=P(c)$. [i]A. Golovanov[/i] -/ theorem number_theory_81521 {P : β„• β†’ β„•} (hP : βˆ€ a, P a = sSup {x | Nat.Prime x ∧ x ∣ a ^ 2 + 1}) : βˆ€ n, βˆƒ a b c, a > n ∧ b > n ∧ c > n ∧ P a = P b ∧ P b = P c := by
import Mathlib open Nat theorem number_theory_81521 {P : β„• β†’ β„•} (hP : βˆ€ a, P a = sSup {x | Nat.Prime x ∧ x ∣ a ^ 2 + 1}) : βˆ€ n, βˆƒ a b c, a > n ∧ b > n ∧ c > n ∧ P a = P b ∧ P b = P c := by -- Let's think about how to solve this in Lean 4. We need to prove that given any natural number n, there exists a, b, c such that each is greater than n and such that all to evaluate to the same under $P$ where $P(a)$ is the largest prime divisor of $a^2 + 1$. We can choose the same number for a, b, c. In this case, $P(a) = P(b) = P(c)$ trivially, just by equality. intro n -- Let's think. If we have a, b, c all equal, then $P(a) = P(a)$ trivially. So we could choose all of them to be the same number, which is greater than each of them. use n + 1, n + 1, n + 1 constructor Β· omega constructor Β· omega constructor Β· omega constructor Β· -- proves P a = P b rfl Β· -- proves P b = P c rfl
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib open Nat theorem number_theory_81521 {P : β„• β†’ β„•} (hP : βˆ€ a, P a = sSup {x | Nat.Prime x ∧ x ∣ a ^ 2 + 1}) : βˆ€ n, βˆƒ a b c, a > n ∧ b > n ∧ c > n ∧ P a = P b ∧ P b = P c := by -- Let's think about how to solve this in Lean 4. We need to prove that given any natural number n, there exists a, b, c such that each is greater than n and such that all to evaluate to the same under $P$ where $P(a)$ is the largest prime divisor of $a^2 + 1$. We can choose the same number for a, b, c. In this case, $P(a) = P(b) = P(c)$ trivially, just by equality. intro n -- Let's think. If we have a, b, c all equal, then $P(a) =
P(b)$, but what if they don’ t ? Then let us assume without loss ofit that $\frac{p}{q}$ , which means that both q and r divide into it . Now I know something else! The product must be divisibleby every factor because divisibility implies multiplication; hence, $(pq)^k\cdot s=m+l*z $, wherep representsathe sum oftwonumbersdivisiblebyeach otherand zistheproductofthemalltogetherplussomenumberlikethatisnotprimeorevenifoneoftthemisnotprimeorprimebut not dividableyout terms). So now our problem has become simpler since only primes appear as factors hereβ€”no more complex expressions like fractions nor irrational roots etc., just simple products made up entirely out froma setofi primes whose sizes depend on their positions within these sets when multiplied together.* This gives me hope for success using my previous methods based around factoring things intoprimifactors first before applying further properties/logic steps lateron*.
import Mathlib open Nat theorem number_theory_81521 {P : β„• β†’ β„•} (hP : βˆ€ a, P a = sSup {x | Nat.Prime x ∧ x ∣ a ^ 2 + 1}) : βˆ€ n, βˆƒ a b c, a > n ∧ b > n ∧ c > n ∧ P a = P b ∧ P b = P c := by -- Let's think about how to solve this in Lean 4. We need to prove that given any natural number n, there exists a, b, c such that each is greater than n and such that all to evaluate to the same under $P$ where $P(a)$ is the largest prime divisor of $a^2 + 1$. We can choose the same number for a, b, c. In this case, $P(a) = P(b) = P(c)$ trivially, just by equality. intro n -- Let's think. If we have a, b, c all equal, then $P(a) =
import Mathlib open Nat theorem number_theory_81521 {P : β„• β†’ β„•} (hP : βˆ€ a, P a = sSup {x | Nat.Prime x ∧ x ∣ a ^ 2 + 1}) : βˆ€ n, βˆƒ a b c, a > n ∧ b > n ∧ c > n ∧ P a = P b ∧ P b = P c := by -- Let's think about how to solve this in Lean 4. We need to prove that given any natural number n, there exists a, b, c such that each is greater than n and such that all to evaluate to the same under $P$ where $P(a)$ is the largest prime divisor of $a^2 + 1$. We can choose the same number for a, b, c. In this case, $P(a) = P(b) = P(c)$ trivially, just by equality. intro n -- Let's think. If we have a, b, c all equal, then $P(a) = P(b)$, but what if they don’ t ? Then let us assume without loss ofit that $\frac{p}{q}$ , which means that both q and r divide into it . Now I know something else! The product must be divisibleby every factor because divisibility implies multiplication; hence, $(pq)^k\cdot s=m+l*z $, wherep representsathe sum oftwonumbersdivisiblebyeach otherand zistheproductofthemalltogetherplussomenumberlikethatisnotprimeorevenifoneoftthemisnotprimeorprimebut not dividableyout terms). So now our problem has become simpler since only primes appear as factors hereβ€”no more complex expressions like fractions nor irrational roots etc., just simple products made up entirely out froma setofi primes whose sizes depend on their positions within these sets when multiplied together.* This gives me hope for success using my previous methods based around factoring things intoprimifactors first before applying further properties/logic steps lateron*.
67
proof
human
2. Prove that any integer $r>2$ is composite if and only if at least one of the following two statements is true: a) $r=2^{s}$ for some $s \in\{2,3, \ldots\}$, b) $r=\frac{u}{2}(2 v-u+1)$ for some $u, v \in\{3,4, \ldots\},(u \leq v)$.
import Mathlib /-2. Prove that any integer $r>2$ is composite if and only if at least one of the following two statements is true: a) $r=2^{s}$ for some $s \in\{2,3, \ldots\}$, b) $r=\frac{u}{2}(2 v-u+1)$ for some $u, v \in\{3,4, \ldots\},(u \leq v)$.-/ theorem number_theory_245291 (rgt : 2 < (r : β„•)) : Β¬ r.Prime ↔ (βˆƒ s β‰₯ 2, r = 2 ^ s) ∨ βˆƒ u v : β„•, 3 ≀ u ∧ 3 ≀ v ∧ u ≀ v ∧ (r : β„š) = u / 2 * (2 * v - u + 1) := by
import Mathlib /-2. Prove that any integer $r>2$ is composite if and only if at least one of the following two statements is true: a) $r=2^{s}$ for some $s \in\{2,3, \ldots\}$, b) $r=\frac{u}{2}(2 v-u+1)$ for some $u, v \in\{3,4, \ldots\},(u \leq v)$.-/ theorem number_theory_245291 (rgt : 2 < (r : β„•)) : Β¬ r.Prime ↔ (βˆƒ s β‰₯ 2, r = 2 ^ s) ∨ βˆƒ u v : β„•, 3 ≀ u ∧ 3 ≀ v ∧ u ≀ v ∧ (r : β„š) = u / 2 * (2 * v - u + 1) := by constructor -- Assume $r$ is not prime, if its only divisor is $2$, then it must be a power of $2$ Β· intro npr; by_cases h : βˆ€ p, p.Prime β†’ p ∣ r β†’ p = 2 Β· left; use r.primeFactorsList.length apply Nat.eq_prime_pow_of_unique_prime_dvd at h constructor Β· by_contra!; rw [h] at rgt interval_cases r.primeFactorsList.length all_goals simp at rgt exact h; positivity -- If $r$ has an odd prime factor $p$, we can assume $p=2*l+1$ and denote $n/p$ by $k$ right; push_neg at h; rcases h with ⟨p, ppr, pdvd, pne⟩ have := ppr.two_le; replace this : 3 ≀ p := by omega replace pne := ppr.odd_of_ne_two pne rcases pne with ⟨l, hl⟩; rcases pdvd with ⟨k, hk⟩ -- Prove $l$ is positive and $k$ is greater than $1$ have lpos : 0 < l := by omega have kgt : 1 < k := by by_contra!; interval_cases k Β· simp at hk; omega simp at hk; rw [hk] at npr; contradiction -- If $k$ is at most $l$, use $2*k$ and $k+l$ to fulfill the goal by_cases h' : k ≀ l Β· use 2*k, k+l; split_ands any_goals omega push_cast; rw [mul_div_cancel_leftβ‚€, hk, hl] push_cast; ring; simp -- If $k< l$, use $p$ and $k+l$ to fulfill the goal use p, k+l; split_ands any_goals omega rw [hk, hl]; push_cast; ring -- Conversely, if $r$ is a power of two, it is not prime intro h; rcases h with ⟨s, sge, hs⟩|⟨u, v, uge, vge, ulev, huv⟩ Β· rw [Nat.not_prime_iff_exists_dvd_lt] use 2; split_ands; any_goals omega use 2^(s-1); rw [hs, ← pow_succ'] congr 1; omega -- Assume the second statement is true, we split the goal to two subgoals depending on the parity of $u$ rcases Nat.even_or_odd' u with ⟨k, hk|hk⟩ Β· rw [hk] at huv; push_cast at huv rw [mul_div_cancel_leftβ‚€, ← mul_sub, ← Nat.cast_sub] at huv norm_cast at huv; rw [Nat.not_prime_iff_exists_dvd_lt] -- If $u=2*k$ is even, then $r = k * (2 * (v - k) + 1)$ is not prime use k; split_ands; use 2 * (v - k) + 1 any_goals omega rw [huv, Nat.lt_mul_iff_one_lt_right]; omega by_contra!; simp at this; simp [this] at huv; omega simp rw [hk] at huv; push_cast at huv rw [show (2:β„š)*v-(2*k+1)+1 = 2*(v-k) by ring] at huv rw [← mul_assoc, div_mul_cancelβ‚€, ← Nat.cast_sub] at huv -- If $u=2*k+1$ is odd, then $r = (2 * k + 1) * (v - k)$ is not prime norm_cast at huv; rw [Nat.not_prime_iff_exists_dvd_lt] use 2*k+1; split_ands; use v - k any_goals omega rw [huv, Nat.lt_mul_iff_one_lt_right]; omega all_goals simp
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib /-2. Prove that any integer $r>2$ is composite if and only if at least one of the following two statements is true: a) $r=2^{s}$ for some $s \in\{2,3, \ldots\}$, b) $r=\frac{u}{2}(2 v-u+1)$ for some $u, v \in\{3,4, \ldots\},(u \leq v)$.-/ theorem number_theory_245291 (rgt : 2 < (r : β„•)) : Β¬ r.Prime ↔ (βˆƒ s β‰₯ 2, r = 2 ^ s) ∨ βˆƒ u v : β„•, 3 ≀ u ∧ 3 ≀ v ∧ u ≀ v ∧ (r : β„š) = u / 2 * (2 * v - u + 1) := by constructor -- Assume $r$ is not prime, if its only divisor is $2$, then it must be a power of $2$ Β· intro npr; by_cases h : βˆ€ p, p.Prime β†’ p ∣ r β†’ p = 2 Β· left; use r.primeFactorsList.length apply Nat.eq_prime_pow_of_unique_prime_dvd at h constructor Β· by_contra!; rw [h] at rgt interval_cases r.primeFactorsList.length all_goals simp at rgt exact h; positivity -- If $r$ has an odd prime factor $p$, we can assume $p=2*l+1$ and denote $n/p$ by $k$ right; push_neg at h; rcases h with ⟨p, ppr, pdvd, pne⟩ have := ppr.two_le; replace this : 3 ≀ p := by omega replace pne := ppr.odd_of_ne_two pne rcases pne with ⟨l, hl⟩; rcases pdvd with ⟨k, hk⟩ -- Prove $l$ is positive and $k$ is greater than $1$ have lpos : 0 < l := by omega have kgt : 1 < k := by by_contra!; interval_cases k Β· simp at hk; omega simp at hk; rw [hk] at npr; contradiction -- If $k$ is at most $l$, use $2*k$ and $k+l$ to fulfill the goal by_cases h' : k ≀ l Β· use 2*k, k+l; split_ands any_goals omega push_cast; rw [mul_div_cancel_leftβ‚€, hk, hl] push_cast; ring; simp -- If $k< l$, use $p$ and $k+l$ to fulfill the goal use p, k+l; split_ands any_goals omega rw [hk, hl]; push_cast; ring -- Conversely, if $r$ is a power of two, it is not prime intro h; rcases h with ⟨s, sge, hs⟩|⟨u, v, uge, vge, ulev, huv⟩ Β· rw [Nat.not_prime_iff_exists_dvd_lt] use 2; split_ands; any_goals omega use 2^(s-1); rw [hs, ← pow_succ'] congr 1; omega -- Assume the second statement is true, we split the goal to two subgoals depending on
whether $\gcd\liflongleft(\dfrac{\cdot} {v}, -\tfrac{((-)\cdot)} {-}\right)=\pm\,?\sqrt[]{?}\,$or$\,\neq\,\cdots $. We show both cases lead to contradiction using properties about primes less than their roots
import Mathlib /-2. Prove that any integer $r>2$ is composite if and only if at least one of the following two statements is true: a) $r=2^{s}$ for some $s \in\{2,3, \ldots\}$, b) $r=\frac{u}{2}(2 v-u+1)$ for some $u, v \in\{3,4, \ldots\},(u \leq v)$.-/ theorem number_theory_245291 (rgt : 2 < (r : β„•)) : Β¬ r.Prime ↔ (βˆƒ s β‰₯ 2, r = 2 ^ s) ∨ βˆƒ u v : β„•, 3 ≀ u ∧ 3 ≀ v ∧ u ≀ v ∧ (r : β„š) = u / 2 * (2 * v - u + 1) := by constructor -- Assume $r$ is not prime, if its only divisor is $2$, then it must be a power of $2$ Β· intro npr; by_cases h : βˆ€ p, p.Prime β†’ p ∣ r β†’ p = 2 Β· left; use r.primeFactorsList.length apply Nat.eq_prime_pow_of_unique_prime_dvd at h constructor Β· by_contra!; rw [h] at rgt interval_cases r.primeFactorsList.length all_goals simp at rgt exact h; positivity -- If $r$ has an odd prime factor $p$, we can assume $p=2*l+1$ and denote $n/p$ by $k$ right; push_neg at h; rcases h with ⟨p, ppr, pdvd, pne⟩ have := ppr.two_le; replace this : 3 ≀ p := by omega replace pne := ppr.odd_of_ne_two pne rcases pne with ⟨l, hl⟩; rcases pdvd with ⟨k, hk⟩ -- Prove $l$ is positive and $k$ is greater than $1$ have lpos : 0 < l := by omega have kgt : 1 < k := by by_contra!; interval_cases k Β· simp at hk; omega simp at hk; rw [hk] at npr; contradiction -- If $k$ is at most $l$, use $2*k$ and $k+l$ to fulfill the goal by_cases h' : k ≀ l Β· use 2*k, k+l; split_ands any_goals omega push_cast; rw [mul_div_cancel_leftβ‚€, hk, hl] push_cast; ring; simp -- If $k< l$, use $p$ and $k+l$ to fulfill the goal use p, k+l; split_ands any_goals omega rw [hk, hl]; push_cast; ring -- Conversely, if $r$ is a power of two, it is not prime intro h; rcases h with ⟨s, sge, hs⟩|⟨u, v, uge, vge, ulev, huv⟩ Β· rw [Nat.not_prime_iff_exists_dvd_lt] use 2; split_ands; any_goals omega use 2^(s-1); rw [hs, ← pow_succ'] congr 1; omega -- Assume the second statement is true, we split the goal to two subgoals depending on
import Mathlib /-2. Prove that any integer $r>2$ is composite if and only if at least one of the following two statements is true: a) $r=2^{s}$ for some $s \in\{2,3, \ldots\}$, b) $r=\frac{u}{2}(2 v-u+1)$ for some $u, v \in\{3,4, \ldots\},(u \leq v)$.-/ theorem number_theory_245291 (rgt : 2 < (r : β„•)) : Β¬ r.Prime ↔ (βˆƒ s β‰₯ 2, r = 2 ^ s) ∨ βˆƒ u v : β„•, 3 ≀ u ∧ 3 ≀ v ∧ u ≀ v ∧ (r : β„š) = u / 2 * (2 * v - u + 1) := by constructor -- Assume $r$ is not prime, if its only divisor is $2$, then it must be a power of $2$ Β· intro npr; by_cases h : βˆ€ p, p.Prime β†’ p ∣ r β†’ p = 2 Β· left; use r.primeFactorsList.length apply Nat.eq_prime_pow_of_unique_prime_dvd at h constructor Β· by_contra!; rw [h] at rgt interval_cases r.primeFactorsList.length all_goals simp at rgt exact h; positivity -- If $r$ has an odd prime factor $p$, we can assume $p=2*l+1$ and denote $n/p$ by $k$ right; push_neg at h; rcases h with ⟨p, ppr, pdvd, pne⟩ have := ppr.two_le; replace this : 3 ≀ p := by omega replace pne := ppr.odd_of_ne_two pne rcases pne with ⟨l, hl⟩; rcases pdvd with ⟨k, hk⟩ -- Prove $l$ is positive and $k$ is greater than $1$ have lpos : 0 < l := by omega have kgt : 1 < k := by by_contra!; interval_cases k Β· simp at hk; omega simp at hk; rw [hk] at npr; contradiction -- If $k$ is at most $l$, use $2*k$ and $k+l$ to fulfill the goal by_cases h' : k ≀ l Β· use 2*k, k+l; split_ands any_goals omega push_cast; rw [mul_div_cancel_leftβ‚€, hk, hl] push_cast; ring; simp -- If $k< l$, use $p$ and $k+l$ to fulfill the goal use p, k+l; split_ands any_goals omega rw [hk, hl]; push_cast; ring -- Conversely, if $r$ is a power of two, it is not prime intro h; rcases h with ⟨s, sge, hs⟩|⟨u, v, uge, vge, ulev, huv⟩ Β· rw [Nat.not_prime_iff_exists_dvd_lt] use 2; split_ands; any_goals omega use 2^(s-1); rw [hs, ← pow_succ'] congr 1; omega -- Assume the second statement is true, we split the goal to two subgoals depending on whether $\gcd\liflongleft(\dfrac{\cdot} {v}, -\tfrac{((-)\cdot)} {-}\right)=\pm\,?\sqrt[]{?}\,$or$\,\neq\,\cdots $. We show both cases lead to contradiction using properties about primes less than their roots
69
math-word-problem
human
3. Find the quotient and remainder in the division algorithm with divisor 17 and dividend a) 100 c) -44 b) 289 d) -100 .
import Mathlib /- 3. Find the quotient and remainder using the division algorithm with a divisor of 17 and the following dividends: a) 100 -/ theorem number_theory_4693_1 : 100 / 17 = 5 ∧ 100 % 17 = 15 := by -- verify by computation decide /- 3. Find the quotient and remainder using the division algorithm with a divisor of 17 and the following dividends: b) 289 -/ theorem number_theory_4693_2 : 289 / 17 = 17 ∧ 289 % 17 = 0 := by -- verify by computation decide /- 3. Find the quotient and remainder using the division algorithm with a divisor of 17 and the following dividends: c) -44 -/ theorem number_theory_4693_3 : -44 / 17 = -3 ∧ -44 % 17 = 7 := by -- verify by computation decide /- 3. Find the quotient and remainder using the division algorithm with a divisor of 17 and the following dividends: d) -100 -/ theorem number_theory_4693_4 : -100 / 17 = -6 ∧ -100 % 17 = 2 := by
import Mathlib theorem number_theory_4693_1 : 100 / 17 = 5 ∧ 100 % 17 = 15 := by -- verify by computation decide theorem number_theory_4693_2 : 289 / 17 = 17 ∧ 289 % 17 = 0 := by -- verify by computation decide theorem number_theory_4693_3 : -44 / 17 = -3 ∧ -44 % 17 = 7 := by -- verify by computation decide theorem number_theory_4693_4 : -100 / 17 = -6 ∧ -100 % 17 = 2 := by -- verify by computation decide
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib theorem number_theory_4693_1 : 100 / 17 = 5 ∧ 100 % 17 = 15 := by -- verify by computation decide theorem number_theory_4693_2 : 289 / 17 = 17 ∧ 289 % 17 = 0 := by -- verify by computation decide theorem number_theory_4693_3 : -44 / 17 = -3 ∧ -44 % 17 = 7 :=
by decid e
import Mathlib theorem number_theory_4693_1 : 100 / 17 = 5 ∧ 100 % 17 = 15 := by -- verify by computation decide theorem number_theory_4693_2 : 289 / 17 = 17 ∧ 289 % 17 = 0 := by -- verify by computation decide theorem number_theory_4693_3 : -44 / 17 = -3 ∧ -44 % 17 = 7 :=
import Mathlib theorem number_theory_4693_1 : 100 / 17 = 5 ∧ 100 % 17 = 15 := by -- verify by computation decide theorem number_theory_4693_2 : 289 / 17 = 17 ∧ 289 % 17 = 0 := by -- verify by computation decide theorem number_theory_4693_3 : -44 / 17 = -3 ∧ -44 % 17 = 7 := by decid e
70
proof
autoformalizer
725. Prove that two segments are commensurable if and only if the ratio of their lengths is rational (expressed as a fraction with integer numerator and denominator).
import Mathlib /- 725. Prove that two segments are commensurable if and only if the ratio of their lengths is rational (expressed as a fraction with integer numerator and denominator). -/ theorem number_theory_288690 {a b : β„•} (ha : 0 < a) (hb : 0 < b) : βˆƒ q : β„š, a * q = b ↔ βˆƒ c d : β„€, 0 < c ∧ 0 < d ∧ a * c = b * d := by
import Mathlib theorem number_theory_288690 {a b : β„•} (ha : 0 < a) (hb : 0 < b) : βˆƒ q : β„š, a * q = b ↔ βˆƒ c d : β„€, 0 < c ∧ 0 < d ∧ a * c = b * d := by use (b : β„š) / (a : β„š) constructor Β· -- Assume a * q = b, prove βˆƒ c d : β„€, 0 < c ∧ 0 < d ∧ a * c = b * d intro h have h31 : (↑a : β„š) * (↑b / ↑a) = (↑b : β„š) := by field_simp have h53 : (↑a : β„€) * (↑b : β„€) = (↑b : β„€) * (↑a : β„€) := by ring refine' ⟨(b : β„€), (a : β„€), by omega, by omega, by simpa using h53⟩ Β· -- Assume βˆƒ c d : β„€, 0 < c ∧ 0 < d ∧ a * c = b * d, prove a * q = b intro h rcases h with ⟨c, d, hc, hd, h1⟩ field_simp
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib theorem number_theory_288690 {a b : β„•} (ha : 0 < a) (hb : 0 < b) : βˆƒ q : β„š, a * q = b ↔ βˆƒ c d : β„€, 0 < c ∧ 0 < d ∧ a * c = b * d := by use (b : β„š) / (a : β„š) constructor Β· -- Assume a * q = b, prove βˆƒ c d : β„€, 0 < c ∧ 0 < d ∧ a * c = b * d intro h have h31 : (↑a : β„š) * (↑b / ↑a) = (↑b : β„š) := by field_simp have h53 : (↑a : β„€) * (↑b : β„€) = (↑b : β„€) * (↑a : β„€) := by ring refine'
Existsβ‚‚'.intro _ fun i j hijijijihijhijojuyouriooojklmnopqrstuvwxyzzzzoopilooopopilopoiqjojqjkjljmjnkokpklqlqmqnkrksltlvlwmxnwyoxypxzrzxozyyzozooxoooooooooooofirst ha othrοΏ½nalternative:=by rw[← mulEqOne]; apply divNeZero; normFarrowc at* ; assumption
import Mathlib theorem number_theory_288690 {a b : β„•} (ha : 0 < a) (hb : 0 < b) : βˆƒ q : β„š, a * q = b ↔ βˆƒ c d : β„€, 0 < c ∧ 0 < d ∧ a * c = b * d := by use (b : β„š) / (a : β„š) constructor Β· -- Assume a * q = b, prove βˆƒ c d : β„€, 0 < c ∧ 0 < d ∧ a * c = b * d intro h have h31 : (↑a : β„š) * (↑b / ↑a) = (↑b : β„š) := by field_simp have h53 : (↑a : β„€) * (↑b : β„€) = (↑b : β„€) * (↑a : β„€) := by ring refine'
import Mathlib theorem number_theory_288690 {a b : β„•} (ha : 0 < a) (hb : 0 < b) : βˆƒ q : β„š, a * q = b ↔ βˆƒ c d : β„€, 0 < c ∧ 0 < d ∧ a * c = b * d := by use (b : β„š) / (a : β„š) constructor Β· -- Assume a * q = b, prove βˆƒ c d : β„€, 0 < c ∧ 0 < d ∧ a * c = b * d intro h have h31 : (↑a : β„š) * (↑b / ↑a) = (↑b : β„š) := by field_simp have h53 : (↑a : β„€) * (↑b : β„€) = (↑b : β„€) * (↑a : β„€) := by ring refine' Existsβ‚‚'.intro _ fun i j hijijijihijhijojuyouriooojklmnopqrstuvwxyzzzzoopilooopopilopoiqjojqjkjljmjnkokpklqlqmqnkrksltlvlwmxnwyoxypxzrzxozyyzozooxoooooooooooofirst ha othrοΏ½nalternative:=by rw[← mulEqOne]; apply divNeZero; normFarrowc at* ; assumption
73
MCQ
autoformalizer
6. What time is it 2017 minutes after $20: 17$ ? A 05:54 B 09:54 C 16:34 D 20:34 E 23:34
import Mathlib /- 6. What time is it 2017 minutes after $20: 17$ ? A 05:54 B 09:54 C 16:34 D 20:34 E 23:34 -/ theorem other_229758 : (20 * 60 + 17 + 2017) % (24 * 60) = 5 * 60 + 54 := by
import Mathlib theorem other_229758 : (20 * 60 + 17 + 2017) % (24 * 60) = 5 * 60 + 54 := by norm_num
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib theorem other_229758 : (20 * 60 + 17 + 2017) % (24 * 60
)= (-(-((-(a)))*b+c)*d^ e)^β‚‚:=by normF
import Mathlib theorem other_229758 : (20 * 60 + 17 + 2017) % (24 * 60
import Mathlib theorem other_229758 : (20 * 60 + 17 + 2017) % (24 * 60 )= (-(-((-(a)))*b+c)*d^ e)^β‚‚:=by normF
74
math-word-problem
autoformalizer
7. (15 points) A uniformly charged sphere of radius $R$ is fixed on a horizontal surface at point $A$. The charge of the sphere is $Q$. At point $C$, which is located at a distance $L$ from the surface of the sphere, a charged sphere of radius $r$ and mass $m$ is floating. Its charge is $q$. It is known that $r<<R$. Determine the acceleration of the sphere immediately after a part of the material is removed at point $B$. It is known that $A B=S$. The removed material is a sphere of radius $r$. Points $A, B$, $C, O$ are located on the same vertical line. The acceleration due to gravity is $g$. ![](https://cdn.mathpix.com/cropped/2024_05_06_7a4bc87492c06fc34cd6g-11.jpg?height=394&width=329&top_left_y=2193&top_left_x=949)
import Mathlib open Real /- 7. (15 points) A uniformly charged sphere of radius $R$ is fixed on a horizontal surface at point $A$. The charge of the sphere is $Q$. At point $C$, which is located at a distance $L$ from the surface of the sphere, a charged sphere of radius $r$ and mass $m$ is floating. Its charge is $q$. It is known that $r<<R$. Determine the acceleration of the sphere immediately after a part of the material is removed at point $B$. It is known that $A B=S$. The removed material is a sphere of radius $r$. Points $A, B$, $C, O$ are located on the same vertical line. The acceleration due to gravity is $g$. ![](https://cdn.mathpix.com/cropped/2024_05_06_7a4bc87492c06fc34cd6g-11.jpg?height=394&width=329&top_left_y=2193&top_left_x=949) -/ theorem other_166925 {R r L S : ℝ} (hR : R > 0) (hr : r > 0) (hL : L > 0) (hS : S > 0) (hRr : r < R) : let g := 9.81 let Q := 4 * Ο€ * R^3 * g let q := 4 * Ο€ * r^3 * g let m := 4 * Ο€ * r^3 let k := m * r / (4 * Ο€ * R^2) let a := k * r^3 / (R^3 * (L + 2 * R - S)^2) a = k * r^3 / (R^3 * (L + 2 * R - S)^2) := by
import Mathlib open Real theorem other_166925 {R r L S : ℝ} (hR : R > 0) (hr : r > 0) (hL : L > 0) (hS : S > 0) (hRr : r < R) : let g := 9.81 let Q := 4 * Ο€ * R^3 * g let q := 4 * Ο€ * r^3 * g let m := 4 * Ο€ * r^3 let k := m * r / (4 * Ο€ * R^2) let a := k * r^3 / (R^3 * (L + 2 * R - S)^2) a = k * r^3 / (R^3 * (L + 2 * R - S)^2) := by rfl
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib open Real theorem other_166925 {R r L S : ℝ} (hR : R > 0) (hr : r > 0) (hL : L > 0) (hS : S > 0) (hRr : r < R) : let g := 9.81 let Q := 4 * Ο€ * R^3 * g let q := 4 * Ο€ * r^3 * g let m := 4 * Ο€ * r^3 let k := m * r / (4 * Ο€ * R^2)
in if hr then ltOfLe le₃�q else gt Of Le geβ‚‚
import Mathlib open Real theorem other_166925 {R r L S : ℝ} (hR : R > 0) (hr : r > 0) (hL : L > 0) (hS : S > 0) (hRr : r < R) : let g := 9.81 let Q := 4 * Ο€ * R^3 * g let q := 4 * Ο€ * r^3 * g let m := 4 * Ο€ * r^3 let k := m * r / (4 * Ο€ * R^2)
import Mathlib open Real theorem other_166925 {R r L S : ℝ} (hR : R > 0) (hr : r > 0) (hL : L > 0) (hS : S > 0) (hRr : r < R) : let g := 9.81 let Q := 4 * Ο€ * R^3 * g let q := 4 * Ο€ * r^3 * g let m := 4 * Ο€ * r^3 let k := m * r / (4 * Ο€ * R^2) in if hr then ltOfLe le₃�q else gt Of Le geβ‚‚
75
math-word-problem
human
12. (NET 1) ${ }^{\mathrm{IMO} 2}$ Find two positive integers $a, b$ such that none of the numbers $a, b, a+b$ is divisible by 7 and $(a+b)^{7}-a^{7}-b^{7}$ is divisible by $7^{7}$.
import Mathlib /- 12. (NET 1) ${ }^{\mathrm{IMO} 2}$ Find two positive integers $a, b$ such that none of the numbers $a, b, a+b$ is divisible by 7 and $(a+b)^{7}-a^{7}-b^{7}$ is divisible by $7^{7}$. -/ theorem number_theory_23912 : βˆƒ a b : β„•, a > 0 ∧ b > 0 ∧ Β¬(7 ∣ a) ∧ Β¬(7 ∣ b) ∧ Β¬(7 ∣ a + b) ∧ 7^7 ∣ (a + b)^7 - a^7 - b^7 := by
import Mathlib /- 12. (NET 1) ${ }^{\mathrm{IMO} 2}$ Find two positive integers $a, b$ such that none of the numbers $a, b, a+b$ is divisible by 7 and $(a+b)^{7}-a^{7}-b^{7}$ is divisible by $7^{7}$. -/ theorem number_theory_23912 : βˆƒ a b : β„•, a > 0 ∧ b > 0 ∧ Β¬(7 ∣ a) ∧ Β¬(7 ∣ b) ∧ Β¬(7 ∣ a + b) ∧ 7^7 ∣ (a + b)^7 - a^7 - b^7 := by -- Trying $a=1$ we easily find the example $(a, b)=(1,18)$. use 1, 18 -- Verify the conditions directly with numerical checks。 norm_num
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib /- 12. (NET 1) ${ }^{\mathrm{IMO} 2}$ Find two positive integers $a, b$ such that none of the numbers $a, b, a+b$ is divisible by 7 and $(a+b)^{7}-a^{7}-b^{7}$ is divisible by $7^{7}$. -/ theorem number_theory_23912 : βˆƒ a b : β„•, a > 0 ∧ b > 0 ∧ Β¬(7 ∣ a) ∧ Β¬(7 ∣ b) ∧ Β¬(7 ∣ a + b) ∧ 7^7 ∣ (a +
b)^7 - a^7 - b^7:=by intro; constructor ; normF at*
import Mathlib /- 12. (NET 1) ${ }^{\mathrm{IMO} 2}$ Find two positive integers $a, b$ such that none of the numbers $a, b, a+b$ is divisible by 7 and $(a+b)^{7}-a^{7}-b^{7}$ is divisible by $7^{7}$. -/ theorem number_theory_23912 : βˆƒ a b : β„•, a > 0 ∧ b > 0 ∧ Β¬(7 ∣ a) ∧ Β¬(7 ∣ b) ∧ Β¬(7 ∣ a + b) ∧ 7^7 ∣ (a +
import Mathlib /- 12. (NET 1) ${ }^{\mathrm{IMO} 2}$ Find two positive integers $a, b$ such that none of the numbers $a, b, a+b$ is divisible by 7 and $(a+b)^{7}-a^{7}-b^{7}$ is divisible by $7^{7}$. -/ theorem number_theory_23912 : βˆƒ a b : β„•, a > 0 ∧ b > 0 ∧ Β¬(7 ∣ a) ∧ Β¬(7 ∣ b) ∧ Β¬(7 ∣ a + b) ∧ 7^7 ∣ (a + b)^7 - a^7 - b^7:=by intro; constructor ; normF at*
77
proof
human
Let $n$ be a positive integer, and let $f_n(z) = n + (n-1)z + (n-2)z^2 + \dots + z^{n-1}$. Prove that $f_n$ has no roots in the closed unit disk $\{z \in \mathbb{C}: |z| \le 1\}$.
import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology /- Let $n$ be a positive integer, and let $f_n(z) = n + (n-1)z + (n-2)z^2 + \dots + z^{n-1}$. Prove that $f_n$ has no roots in the closed unit disk $\{z \in \mathbb{C}: |z| \le 1\}$. -/ theorem other_43390 {n : β„•} (hn : 0 < n) (f : β„• β†’ β„‚ β†’ β„‚) (hf : βˆ€ z, f n z = βˆ‘ i ∈ range n, (n - i) * z ^ i) : Β¬βˆƒ z, β€–zβ€– ≀ 1 ∧ f n z = 0 :=
import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology /- Let $n$ be a positive integer, and let $f_n(z) = n + (n-1)z + (n-2)z^2 + \dots + z^{n-1}$. Prove that $f_n$ has no roots in the closed unit disk $\{z \in \mathbb{C}: |z| \le 1\}$. -/ theorem other_43390 {n : β„•} (hn : 0 < n) (f : β„• β†’ β„‚ β†’ β„‚) (hf : βˆ€ z, f n z = βˆ‘ i ∈ range n, (n - i) * z ^ i) : Β¬βˆƒ z, β€–zβ€– ≀ 1 ∧ f n z = 0 := sorry
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology /- Let $n$ be a positive integer, and let $f_n(z) = n + (n-1)z + (n-2)z^2 + \dots + z^{n-1}$. Prove that $f_n$ has no roots in the closed unit disk $\{z \in \mathbb{C}: |z| \le 1\}$. -/ theorem other_43390 {n : β„•} (hn : 0 < n) (f : β„• β†’ β„‚ β†’
mcitedefault): Β¬βˆƒ r s t v w , absComplexr*absComplexts*(v+w)*exp (-Ο€/realNatLogβ‚‚((↑Real NatAbs' realOfInt _).sqrt)^(-√u))):= fun H=> Exists._satisfyH atLeastOnePrime p hp qhq ht where primepqht is notprimepq; absurd this using mulNeZero
import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology /- Let $n$ be a positive integer, and let $f_n(z) = n + (n-1)z + (n-2)z^2 + \dots + z^{n-1}$. Prove that $f_n$ has no roots in the closed unit disk $\{z \in \mathbb{C}: |z| \le 1\}$. -/ theorem other_43390 {n : β„•} (hn : 0 < n) (f : β„• β†’ β„‚ β†’
import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology /- Let $n$ be a positive integer, and let $f_n(z) = n + (n-1)z + (n-2)z^2 + \dots + z^{n-1}$. Prove that $f_n$ has no roots in the closed unit disk $\{z \in \mathbb{C}: |z| \le 1\}$. -/ theorem other_43390 {n : β„•} (hn : 0 < n) (f : β„• β†’ β„‚ β†’ mcitedefault): Β¬βˆƒ r s t v w , absComplexr*absComplexts*(v+w)*exp (-Ο€/realNatLogβ‚‚((↑Real NatAbs' realOfInt _).sqrt)^(-√u))):= fun H=> Exists._satisfyH atLeastOnePrime p hp qhq ht where primepqht is notprimepq; absurd this using mulNeZero
78
math-word-problem
human
26. (KOR 4) Let $n$ be a positive integer and let $a, b$ be given real numbers. Determine the range of $x_{0}$ for which $$ \sum_{i=0}^{n} x_{i}=a \quad \text { and } \quad \sum_{i=0}^{n} x_{i}^{2}=b $$ where $x_{0}, x_{1}, \ldots, x_{n}$ are real variables.
import Mathlib open Real /-26. (KOR 4) Let $n$ be a positive integer and let $a, b$ be given real numbers. Determine the range of $x_{0}$ for which $$ \sum_{i=0}^{n} x_{i}=a \quad \text { and } \quad \sum_{i=0}^{n} x_{i}^{2}=b $$ where $x_{0}, x_{1}, \ldots, x_{n}$ are real variables.-/ theorem other_24234 (n : β„•) (a b x0 : ℝ) (npos : 0 < n) : let D := n * (n + 1) * (b - a ^ 2 / (n + 1)); (βˆƒ x : β„• β†’ ℝ, x 0 = x0 ∧ βˆ‘ i ∈ Finset.range (n + 1), x i = a ∧ βˆ‘ i ∈ Finset.range (n + 1), (x i) ^ 2 = b) ↔ a ^ 2 ≀ (n + 1) * b ∧ ((n = 1 ∧ (x0 = (a - D.sqrt) / (n + 1) ∨ x0 = (a + D.sqrt) / (n + 1))) ∨ ( 1 < n ∧ (a - D.sqrt) / (n + 1) ≀ x0 ∧ x0 ≀ (a + D.sqrt) / (n + 1))) := by
import Mathlib open Real /-26. (KOR 4) Let $n$ be a positive integer and let $a, b$ be given real numbers. Determine the range of $x_{0}$ for which $$ \sum_{i=0}^{n} x_{i}=a \quad \text { and } \quad \sum_{i=0}^{n} x_{i}^{2}=b $$ where $x_{0}, x_{1}, \ldots, x_{n}$ are real variables.-/ theorem other_24234 (n : β„•) (a b x0 : ℝ) (npos : 0 < n) : let D := n * (n + 1) * (b - a ^ 2 / (n + 1)); (βˆƒ x : β„• β†’ ℝ, x 0 = x0 ∧ βˆ‘ i ∈ Finset.range (n + 1), x i = a ∧ βˆ‘ i ∈ Finset.range (n + 1), (x i) ^ 2 = b) ↔ a ^ 2 ≀ (n + 1) * b ∧ ((n = 1 ∧ (x0 = (a - D.sqrt) / (n + 1) ∨ x0 = (a + D.sqrt) / (n + 1))) ∨ ( 1 < n ∧ (a - D.sqrt) / (n + 1) ≀ x0 ∧ x0 ≀ (a + D.sqrt) / (n + 1))) := by -- Introduce assumptions and prepare to use Cauchy-Schwarz inequality intro D; constructor Β· rintro ⟨x, hx0, sumx, sumsqx⟩ let A : EuclideanSpace ℝ (Fin n) := fun t => 1 let B : EuclideanSpace ℝ (Fin n) := fun t => x (t.val + 1) -- Apply Cauchy-Schwarz inequality to $A$ and $B$, then simplify it using properties of norm and Finset.sum have C_S := abs_real_inner_le_norm A B; simp [A, B] at C_S repeat simp [EuclideanSpace.norm_eq] at C_S repeat simp [Finset.sum_fin_eq_sum_range] at C_S repeat rw [Finset.sum_ite_of_true] at C_S rw [add_comm, Finset.sum_range_add] at sumx sumsqx; simp [add_comm] at sumx sumsqx rw [← eq_sub_iff_add_eq'] at sumx sumsqx; rw [sumx, sumsqx] at C_S rw [← sqrt_mul, abs_le, ← sq_le, ← sub_nonpos] at C_S rw [← mul_le_mul_iff_of_pos_left (show 0<(n:ℝ)+1 by norm_cast; simp), mul_zero] at C_S -- Rewrite the LHS of the inquality C_S to a square form rw [show (n+1)*((a-x 0)^2-n*(b-x 0^2)) = (((n:ℝ)+1)*x 0-a)^2-(n*((n+1)*b-a^2)) by ring] at C_S rw [sub_nonpos] at C_S; constructor -- Apply transitivity and sq_nonneg to prove that the discriminent is nonnegative Β· rw [← sub_nonneg, ← mul_le_mul_iff_of_pos_left (show 0<(n:ℝ) by norm_cast), mul_zero] apply le_trans _ C_S; apply sq_nonneg -- Rewrite the goal to a square form using sq_le and is exactly the inequality C_S by_cases hn : n ≀ 1 Β· replace hn : n = 1 := by linarith left; constructor; exact hn; simp_all; norm_num at *; sorry right; constructor; linarith; rw [div_le_iffβ‚€, le_div_iffβ‚€, sub_eq_add_neg, ← le_sub_iff_add_le'] rw [mul_comm, ← sub_le_iff_le_add', ← sq_le]; simp [D] field_simp; rw [mul_assoc, ← mul_div, mul_div_cancel_leftβ‚€, ← hx0]; nth_rw 3 [mul_comm]; exact C_S; any_goals positivity -- Prove the rest trivial goals, mainly checking positivities simp [D]; field_simp; rw [mul_assoc, ← mul_div, mul_div_cancel_leftβ‚€] nth_rw 2 [mul_comm]; apply le_trans _ C_S; apply sq_nonneg norm_cast; apply mul_nonneg; norm_cast; simp rw [← sumsqx]; apply Finset.sum_nonneg; exact fun i a => sq_nonneg (x (i + 1)) all_goals simp -- Conversely, we need to construct a sequence $x$ that satisfies the desired properties rintro ⟨hab, ⟨hn, _|_⟩|⟨hn, _⟩⟩; all_goals sorry
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib open Real /-26. (KOR 4) Let $n$ be a positive integer and let $a, b$ be given real numbers. Determine the range of $x_{0}$ for which $$ \sum_{i=0}^{n} x_{i}=a \quad \text { and } \quad \sum_{i=0}^{n} x_{i}^{2}=b $$ where $x_{0}, x_{1}, \ldots, x_{n}$ are real variables.-/ theorem other_24234 (n : β„•) (a b x0 : ℝ) (npos : 0 < n) : let D := n * (n + 1) * (b - a ^ 2 / (n + 1)); (βˆƒ x : β„• β†’ ℝ, x 0 = x0 ∧ βˆ‘ i ∈ Finset.range (n + 1), x i = a ∧ βˆ‘ i ∈ Finset.range (n + 1), (x i) ^ 2 = b) ↔ a ^ 2 ≀ (n + 1) * b ∧ ((n = 1 ∧ (x0 = (a - D.sqrt) / (n + 1) ∨ x0 = (a + D.sqrt) / (n + 1))) ∨ ( 1 < n ∧ (a - D.sqrt) / (n + 1) ≀ x0 ∧ x0 ≀ (a + D.sqrt) / (n + 1))) := by -- Introduce assumptions and prepare to use Cauchy-Schwarz inequality intro D; constructor Β· rintro ⟨x, hx0, sumx, sumsqx⟩ let A : EuclideanSpace ℝ (Fin n) := fun t => 1 let B : EuclideanSpace ℝ (Fin n) := fun t => x (t.val + 1) -- Apply Cauchy-Schwarz inequality to $A$ and $B$, then simplify it using properties of norm and Finset.sum have C_S := abs_real_inner_le_norm A B; simp [A, B] at C_S repeat simp [EuclideanSpace.norm_eq] at C_S repeat simp [Finset.sum_fin_eq_sum_range] at C_S repeat rw [Finset.sum_ite_of_true] at C_S rw [add_comm, Finset.sum_range_add] at sumx sumsqx; simp [add_comm] at sumx sumsqx rw [← eq_sub_iff_add_eq'] at sumx sumsqx; rw [sumx, sumsqx] at C_S rw [← sqrt_mul, abs_le, ← sq_le, ← sub_nonpos] at C_S rw [← mul_le_mul_iff_of_pos_left (show 0<(n:ℝ)+1 by norm_cast; simp), mul_zero] at C_S -- Rewrite the LHS of the inquality C_S to a square form rw [show (n+1)*((a-x 0)^2-n*(b-x 0^2)) = (((n:ℝ)+1)*x 0-a)^2-(n*((n+1)*b-a^2)) by ring] at C_S rw [sub_nonpos] at C_S; constructor -- Apply transitivity and sq_nonneg to prove that the discriminent is nonnegative Β· rw [← sub_nonneg, ← mul_le_mul_iff_of_pos_left (show 0<(n:ℝ) by norm_cast), mul_zero] apply le_trans _ C_S; apply sq_nonneg -- Rewrite the goal to a square form
using multiplycation as an addition operation on both sidesformulation single out $(D).√$. The result willvaluate into $-(-C)\cdot\frac{(\operatorname{\mathbb R}(c))^{k}}{p^{q}}\in\{-\infty,\cdots,-N\}$. We do not know if this expression has any signincanc e but we may still try applying our previous lemma about $\abs{-z}\leq z $. This should give something useful since $-\infity< N<\∞$; see below for more details.-/
import Mathlib open Real /-26. (KOR 4) Let $n$ be a positive integer and let $a, b$ be given real numbers. Determine the range of $x_{0}$ for which $$ \sum_{i=0}^{n} x_{i}=a \quad \text { and } \quad \sum_{i=0}^{n} x_{i}^{2}=b $$ where $x_{0}, x_{1}, \ldots, x_{n}$ are real variables.-/ theorem other_24234 (n : β„•) (a b x0 : ℝ) (npos : 0 < n) : let D := n * (n + 1) * (b - a ^ 2 / (n + 1)); (βˆƒ x : β„• β†’ ℝ, x 0 = x0 ∧ βˆ‘ i ∈ Finset.range (n + 1), x i = a ∧ βˆ‘ i ∈ Finset.range (n + 1), (x i) ^ 2 = b) ↔ a ^ 2 ≀ (n + 1) * b ∧ ((n = 1 ∧ (x0 = (a - D.sqrt) / (n + 1) ∨ x0 = (a + D.sqrt) / (n + 1))) ∨ ( 1 < n ∧ (a - D.sqrt) / (n + 1) ≀ x0 ∧ x0 ≀ (a + D.sqrt) / (n + 1))) := by -- Introduce assumptions and prepare to use Cauchy-Schwarz inequality intro D; constructor Β· rintro ⟨x, hx0, sumx, sumsqx⟩ let A : EuclideanSpace ℝ (Fin n) := fun t => 1 let B : EuclideanSpace ℝ (Fin n) := fun t => x (t.val + 1) -- Apply Cauchy-Schwarz inequality to $A$ and $B$, then simplify it using properties of norm and Finset.sum have C_S := abs_real_inner_le_norm A B; simp [A, B] at C_S repeat simp [EuclideanSpace.norm_eq] at C_S repeat simp [Finset.sum_fin_eq_sum_range] at C_S repeat rw [Finset.sum_ite_of_true] at C_S rw [add_comm, Finset.sum_range_add] at sumx sumsqx; simp [add_comm] at sumx sumsqx rw [← eq_sub_iff_add_eq'] at sumx sumsqx; rw [sumx, sumsqx] at C_S rw [← sqrt_mul, abs_le, ← sq_le, ← sub_nonpos] at C_S rw [← mul_le_mul_iff_of_pos_left (show 0<(n:ℝ)+1 by norm_cast; simp), mul_zero] at C_S -- Rewrite the LHS of the inquality C_S to a square form rw [show (n+1)*((a-x 0)^2-n*(b-x 0^2)) = (((n:ℝ)+1)*x 0-a)^2-(n*((n+1)*b-a^2)) by ring] at C_S rw [sub_nonpos] at C_S; constructor -- Apply transitivity and sq_nonneg to prove that the discriminent is nonnegative Β· rw [← sub_nonneg, ← mul_le_mul_iff_of_pos_left (show 0<(n:ℝ) by norm_cast), mul_zero] apply le_trans _ C_S; apply sq_nonneg -- Rewrite the goal to a square form
import Mathlib open Real /-26. (KOR 4) Let $n$ be a positive integer and let $a, b$ be given real numbers. Determine the range of $x_{0}$ for which $$ \sum_{i=0}^{n} x_{i}=a \quad \text { and } \quad \sum_{i=0}^{n} x_{i}^{2}=b $$ where $x_{0}, x_{1}, \ldots, x_{n}$ are real variables.-/ theorem other_24234 (n : β„•) (a b x0 : ℝ) (npos : 0 < n) : let D := n * (n + 1) * (b - a ^ 2 / (n + 1)); (βˆƒ x : β„• β†’ ℝ, x 0 = x0 ∧ βˆ‘ i ∈ Finset.range (n + 1), x i = a ∧ βˆ‘ i ∈ Finset.range (n + 1), (x i) ^ 2 = b) ↔ a ^ 2 ≀ (n + 1) * b ∧ ((n = 1 ∧ (x0 = (a - D.sqrt) / (n + 1) ∨ x0 = (a + D.sqrt) / (n + 1))) ∨ ( 1 < n ∧ (a - D.sqrt) / (n + 1) ≀ x0 ∧ x0 ≀ (a + D.sqrt) / (n + 1))) := by -- Introduce assumptions and prepare to use Cauchy-Schwarz inequality intro D; constructor Β· rintro ⟨x, hx0, sumx, sumsqx⟩ let A : EuclideanSpace ℝ (Fin n) := fun t => 1 let B : EuclideanSpace ℝ (Fin n) := fun t => x (t.val + 1) -- Apply Cauchy-Schwarz inequality to $A$ and $B$, then simplify it using properties of norm and Finset.sum have C_S := abs_real_inner_le_norm A B; simp [A, B] at C_S repeat simp [EuclideanSpace.norm_eq] at C_S repeat simp [Finset.sum_fin_eq_sum_range] at C_S repeat rw [Finset.sum_ite_of_true] at C_S rw [add_comm, Finset.sum_range_add] at sumx sumsqx; simp [add_comm] at sumx sumsqx rw [← eq_sub_iff_add_eq'] at sumx sumsqx; rw [sumx, sumsqx] at C_S rw [← sqrt_mul, abs_le, ← sq_le, ← sub_nonpos] at C_S rw [← mul_le_mul_iff_of_pos_left (show 0<(n:ℝ)+1 by norm_cast; simp), mul_zero] at C_S -- Rewrite the LHS of the inquality C_S to a square form rw [show (n+1)*((a-x 0)^2-n*(b-x 0^2)) = (((n:ℝ)+1)*x 0-a)^2-(n*((n+1)*b-a^2)) by ring] at C_S rw [sub_nonpos] at C_S; constructor -- Apply transitivity and sq_nonneg to prove that the discriminent is nonnegative Β· rw [← sub_nonneg, ← mul_le_mul_iff_of_pos_left (show 0<(n:ℝ) by norm_cast), mul_zero] apply le_trans _ C_S; apply sq_nonneg -- Rewrite the goal to a square form using multiplycation as an addition operation on both sidesformulation single out $(D).√$. The result willvaluate into $-(-C)\cdot\frac{(\operatorname{\mathbb R}(c))^{k}}{p^{q}}\in\{-\infty,\cdots,-N\}$. We do not know if this expression has any signincanc e but we may still try applying our previous lemma about $\abs{-z}\leq z $. This should give something useful since $-\infity< N<\∞$; see below for more details.-/
80
MCQ
autoformalizer
Definition: The annual production growth rate of a factory is: $\frac{\text{current year's output value} - \text{previous year's output value}}{\text{previous year's output value}} \times 100\%$ If the factory's output value in the year $2000$ is to be $1.44$ times that of the year $1998$, and the annual production growth rate is $x$ each year, then $x$ equals ( ). A: $5\%$ B: $10\%$ C: $15\%$ D: $20\%$
import Mathlib /- Definition: The annual production growth rate of a factory is: $\frac{\text{current year's output value} - \text{previous year's output value}}{\text{previous year's output value}} \times 100\%$ If the factory's output value in the year $2000$ is to be $1.44$ times that of the year $1998$, and the annual production growth rate is $x$ each year, then $x$ equals ( ). A: $5\%$ B: $10\%$ C: $15\%$ D: $20\%$ -/ theorem algebra_2662 {x : ℝ} (hx : 0 < x) (h : (1 + x / 100) ^ 2 = 1.44) : x = 20 := by
import Mathlib theorem algebra_2662 {x : ℝ} (hx : 0 < x) (h : (1 + x / 100) ^ 2 = 1.44) : x = 20 := by have h1 : (1 + x / 100 : ℝ) ^ 2 - (1.44 : ℝ) = 0 := by linarith have h2 : ((1 + x / 100 : ℝ) - 1.2) * ((1 + x / 100 : ℝ) + 1.2) = 0 := by ring_nf at h1 ⊒ norm_num at h1 ⊒ nlinarith cases' (mul_eq_zero.mp h2) with h3 h4 Β· -- First case: (1 + x / 100) - 1.2 = 0, which means 1 + x/100 = 1.2 have h5 : (x : ℝ) = 20 := by norm_num at h3 linarith exact h5 Β· -- Second case: (1 + x / 100) + 1.2 = 0, which means 1 + x/100 = -1.2 have h5 : (x : ℝ) < (0 : ℝ) := by norm_num at h4 nlinarith linarith -- contradicts hx: 0 < x
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib theorem algebra_2662 {x : ℝ} (hx : 0 < x) (h : (1 + x / 100) ^ 2 = 1.44) : x = 20 := by have h1 : (1 + x / 100 : ℝ) ^ 2 - (1.44 : ℝ) = 0 := by linarith have h2 : ((1 + x / 100 : ℝ) - 1.2) * ((1 + x / 100 : ℝ) + 1.2) = 0 := by ring_nf at h1 ⊒ norm_num at h1 ⊒ nlinarith cases' (mul_eq_zero.mp h2) with h3 h4 Β· -- First case: (1 + x / 100) - 1.2 = 0, which means 1 + x/100 = 1.2 have h5 : (x : ℝ) = 20 := by
rw [(by div only; constructor)]at* ; assumptionοΏ½οΏ½<|> contradiction
import Mathlib theorem algebra_2662 {x : ℝ} (hx : 0 < x) (h : (1 + x / 100) ^ 2 = 1.44) : x = 20 := by have h1 : (1 + x / 100 : ℝ) ^ 2 - (1.44 : ℝ) = 0 := by linarith have h2 : ((1 + x / 100 : ℝ) - 1.2) * ((1 + x / 100 : ℝ) + 1.2) = 0 := by ring_nf at h1 ⊒ norm_num at h1 ⊒ nlinarith cases' (mul_eq_zero.mp h2) with h3 h4 Β· -- First case: (1 + x / 100) - 1.2 = 0, which means 1 + x/100 = 1.2 have h5 : (x : ℝ) = 20 := by
import Mathlib theorem algebra_2662 {x : ℝ} (hx : 0 < x) (h : (1 + x / 100) ^ 2 = 1.44) : x = 20 := by have h1 : (1 + x / 100 : ℝ) ^ 2 - (1.44 : ℝ) = 0 := by linarith have h2 : ((1 + x / 100 : ℝ) - 1.2) * ((1 + x / 100 : ℝ) + 1.2) = 0 := by ring_nf at h1 ⊒ norm_num at h1 ⊒ nlinarith cases' (mul_eq_zero.mp h2) with h3 h4 Β· -- First case: (1 + x / 100) - 1.2 = 0, which means 1 + x/100 = 1.2 have h5 : (x : ℝ) = 20 := by rw [(by div only; constructor)]at* ; assumptionοΏ½οΏ½<|> contradiction
81
math-word-problem
autoformalizer
$$ 4 ( 15 ^ { 3 } + 14 ^ { 3 } + 13 ^ { 3 } + ... + 1 ^ { 3 } ) + 6 ( 15 ^ { 2 } + 14 ^ { 2 } + 13 ^ { 2 } + ... + 1 ^ { 2 } ) + 4 ( 15 + 14 + 13 + ... + 1 ) + 15 = ?$$
import Mathlib /- $$ 4 ( 15 ^ { 3 } + 14 ^ { 3 } + 13 ^ { 3 } + ... + 1 ^ { 3 } ) + 6 ( 15 ^ { 2 } + 14 ^ { 2 } + 13 ^ { 2 } + ... + 1 ^ { 2 } ) + 4 ( 15 + 14 + 13 + ... + 1 ) + 15 = ?$$ -/ theorem algebra_3881 : 4 * βˆ‘ i ∈ Finset.range 15, (i + 1) ^ 3 + 6 * βˆ‘ i ∈ Finset.range 15, (i + 1) ^ 2 + 4 * βˆ‘ i ∈ Finset.range 15, (i + 1) + 15 = 65535 := by
import Mathlib theorem algebra_3881 : 4 * βˆ‘ i ∈ Finset.range 15, (i + 1) ^ 3 + 6 * βˆ‘ i ∈ Finset.range 15, (i + 1) ^ 2 + 4 * βˆ‘ i ∈ Finset.range 15, (i + 1) + 15 = 65535 := by native_decide
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib theorem algebra_3881 : 4 * βˆ‘ i ∈ Finset.range 15, (i + 1) ^ 3 + 6 * βˆ‘ i ∈ Finset.range 15, (i + 1) ^ 2 + 4 * βˆ‘ i ∈ Finset
.range (-∞..(-Ο€/βˆšβ‚‚).ceil)]:=by normFsubset
import Mathlib theorem algebra_3881 : 4 * βˆ‘ i ∈ Finset.range 15, (i + 1) ^ 3 + 6 * βˆ‘ i ∈ Finset.range 15, (i + 1) ^ 2 + 4 * βˆ‘ i ∈ Finset
import Mathlib theorem algebra_3881 : 4 * βˆ‘ i ∈ Finset.range 15, (i + 1) ^ 3 + 6 * βˆ‘ i ∈ Finset.range 15, (i + 1) ^ 2 + 4 * βˆ‘ i ∈ Finset.range (-∞..(-Ο€/βˆšβ‚‚).ceil)]:=by normFsubset
82
math-word-problem
autoformalizer
Compute $\lfloor \sqrt{n^2 - 10n + 29} \rfloor$ when $n = 19941994.$
import Mathlib /- Compute $\lfloor \sqrt{n^2 - 10n + 29} \rfloor$ when $n = 19941994.$ -/ theorem algebra_21564 (n : β„•) (hn : n = 19941994) : ⌊Real.sqrt (n^2 - 10 * n + 29)βŒ‹ = 19941989 := by
import Mathlib theorem algebra_21564 (n : β„•) (hn : n = 19941994) : ⌊Real.sqrt (n^2 - 10 * n + 29)βŒ‹ = 19941989 := by rw [hn] have h_eq : ((19941994 : ℝ) ^ 2 - 10 * (19941994 : ℝ) + 29) = (19941989 : ℝ) ^ 2 + 4 := by norm_num have h1 : Real.sqrt ((19941994 : ℝ) ^ 2 - 10 * (19941994 : ℝ) + 29) = Real.sqrt ((19941989 : ℝ) ^ 2 + 4) := by rw [h_eq] have h2 : (19941989 : ℝ) < Real.sqrt ((19941989 : ℝ) ^ 2 + 4) := by nlinarith [Real.sqrt_nonneg ((19941989 : ℝ) ^ 2 + 4), Real.sq_sqrt (show (0 : ℝ) ≀ ((19941989 : ℝ) ^ 2 + 4) by positivity)] -- Show that the real sqrt is less than the next integer have h3 : Real.sqrt ((19941989 : ℝ) ^ 2 + 4) < (19941990 : ℝ) := by nlinarith [Real.sqrt_nonneg ((19941989 : ℝ) ^ 2 + 4), Real.sq_sqrt (show (0 : ℝ) ≀ ((19941989 : ℝ) ^ 2 + 4) by positivity)] have h4 : ⌊Real.sqrt ((19941994 : ℝ) ^ 2 - 10 * (19941994 : ℝ) + 29)βŒ‹ = (19941989 : β„€) := by have h5 : Real.sqrt ((19941994 : ℝ) ^ 2 - 10 * (19941994 : ℝ) + 29) = Real.sqrt ((19941989 : ℝ) ^ 2 + 4) := h1 rw [h5] have h5 : ⌊Real.sqrt ((19941989 : ℝ) ^ 2 + 4)βŒ‹ = (19941989 : β„€) := by rw [Int.floor_eq_iff] constructor <;> ( try { have h7 : (19941989 : ℝ) ≀ Real.sqrt ((19941989 : ℝ) ^ 2 + 4) := by nlinarith [Real.sqrt_nonneg ((19941989 : ℝ) ^ 2 + 4), Real.sq_sqrt (show (0 : ℝ) ≀ ((19941989 : ℝ) ^ 2 + 4) by positivity)] have h8 : Real.sqrt ((19941989 : ℝ) ^ 2 + 4) < (19941990 : ℝ) := h3 norm_num at * all_goals nlinarith } ) exact_mod_cast h5 exact_mod_cast h4
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib theorem algebra_21564 (n : β„•) (hn : n = 19941994) : ⌊Real.sqrt (n^2 - 10 * n + 29)βŒ‹ = 19941989 := by rw [hn] have h_eq : ((19941994 : ℝ) ^ 2 - 10 * (19941994 : ℝ) + 29) = (19941989 : ℝ) ^ 2 + 4 := by norm_num have h1 : Real.sqrt ((19941994 : ℝ) ^ 2 - 10 * (19941994 : ℝ) + 29) = Real.sqrt ((19941989 : ℝ) ^ 2 + 4) := by rw [h_eq] have h2 : (19941989 : ℝ) < Real.sqrt ((19941989 : ℝ) ^ 2 + 4) := by nlinarith [Real.sqrt_nonneg ((19941989 : ℝ) ^ 2 + 4), Real.sq_sqrt (show (0 : ℝ) ≀ ((19941989 : ℝ) ^ 2 + 4) by positivity)] -- Show that the real sqrt is less than the next integer have h3 : Real.sqrt ((19941989 : ℝ) ^ 2 + 4) < (19941990 : ℝ) := by nlinarith [Real.sqrt_nonneg ((19941989 : ℝ) ^ 2 + 4), Real.sq_sqrt (show (0 : ℝ) ≀ ((19941989 : ℝ) ^ 2 + 4) by positivity)] have h4 : ⌊Real.sqrt ((19941994 : ℝ) ^ 2 - 10 * (19941994 : ℝ) + 29)βŒ‹ = (19941989 : β„€) := by have h5 : Real.sqrt ((19941994 : ℝ) ^ 2 - 10 * (19941994 : ℝ) + 29) = Real.sqrt ((19941989 : ℝ) ^ 2 + 4) := h1 rw [h5] have h5 : ⌊Real.sqrt ((1
9941989 : πŸ‘Ό ) ^ 2+β‚„)-((βˆšβ‚‚*₃)*₁⁹᢯¹³²)/(-↑⅓*(←·)^Β½)=-(((β†’Β· ∧ Β·).snd (-ΒΌ))):=by apply eqaulity;ringarit at this using mulle' _ _,mullt',divLToneOfNat ,subLeself ;normRing
import Mathlib theorem algebra_21564 (n : β„•) (hn : n = 19941994) : ⌊Real.sqrt (n^2 - 10 * n + 29)βŒ‹ = 19941989 := by rw [hn] have h_eq : ((19941994 : ℝ) ^ 2 - 10 * (19941994 : ℝ) + 29) = (19941989 : ℝ) ^ 2 + 4 := by norm_num have h1 : Real.sqrt ((19941994 : ℝ) ^ 2 - 10 * (19941994 : ℝ) + 29) = Real.sqrt ((19941989 : ℝ) ^ 2 + 4) := by rw [h_eq] have h2 : (19941989 : ℝ) < Real.sqrt ((19941989 : ℝ) ^ 2 + 4) := by nlinarith [Real.sqrt_nonneg ((19941989 : ℝ) ^ 2 + 4), Real.sq_sqrt (show (0 : ℝ) ≀ ((19941989 : ℝ) ^ 2 + 4) by positivity)] -- Show that the real sqrt is less than the next integer have h3 : Real.sqrt ((19941989 : ℝ) ^ 2 + 4) < (19941990 : ℝ) := by nlinarith [Real.sqrt_nonneg ((19941989 : ℝ) ^ 2 + 4), Real.sq_sqrt (show (0 : ℝ) ≀ ((19941989 : ℝ) ^ 2 + 4) by positivity)] have h4 : ⌊Real.sqrt ((19941994 : ℝ) ^ 2 - 10 * (19941994 : ℝ) + 29)βŒ‹ = (19941989 : β„€) := by have h5 : Real.sqrt ((19941994 : ℝ) ^ 2 - 10 * (19941994 : ℝ) + 29) = Real.sqrt ((19941989 : ℝ) ^ 2 + 4) := h1 rw [h5] have h5 : ⌊Real.sqrt ((1
import Mathlib theorem algebra_21564 (n : β„•) (hn : n = 19941994) : ⌊Real.sqrt (n^2 - 10 * n + 29)βŒ‹ = 19941989 := by rw [hn] have h_eq : ((19941994 : ℝ) ^ 2 - 10 * (19941994 : ℝ) + 29) = (19941989 : ℝ) ^ 2 + 4 := by norm_num have h1 : Real.sqrt ((19941994 : ℝ) ^ 2 - 10 * (19941994 : ℝ) + 29) = Real.sqrt ((19941989 : ℝ) ^ 2 + 4) := by rw [h_eq] have h2 : (19941989 : ℝ) < Real.sqrt ((19941989 : ℝ) ^ 2 + 4) := by nlinarith [Real.sqrt_nonneg ((19941989 : ℝ) ^ 2 + 4), Real.sq_sqrt (show (0 : ℝ) ≀ ((19941989 : ℝ) ^ 2 + 4) by positivity)] -- Show that the real sqrt is less than the next integer have h3 : Real.sqrt ((19941989 : ℝ) ^ 2 + 4) < (19941990 : ℝ) := by nlinarith [Real.sqrt_nonneg ((19941989 : ℝ) ^ 2 + 4), Real.sq_sqrt (show (0 : ℝ) ≀ ((19941989 : ℝ) ^ 2 + 4) by positivity)] have h4 : ⌊Real.sqrt ((19941994 : ℝ) ^ 2 - 10 * (19941994 : ℝ) + 29)βŒ‹ = (19941989 : β„€) := by have h5 : Real.sqrt ((19941994 : ℝ) ^ 2 - 10 * (19941994 : ℝ) + 29) = Real.sqrt ((19941989 : ℝ) ^ 2 + 4) := h1 rw [h5] have h5 : ⌊Real.sqrt ((19941989 : πŸ‘Ό ) ^ 2+β‚„)-((βˆšβ‚‚*₃)*₁⁹᢯¹³²)/(-↑⅓*(←·)^Β½)=-(((β†’Β· ∧ Β·).snd (-ΒΌ))):=by apply eqaulity;ringarit at this using mulle' _ _,mullt',divLToneOfNat ,subLeself ;normRing
83
math-word-problem
autoformalizer
Rationalize the denominator: $\frac{5}{\sqrt{3}}$ .
import Mathlib /- Rationalize the denominator: $\frac{5}{\sqrt{3}}$ . -/ theorem algebra_21678 : (5 / Real.sqrt 3 : ℝ) = 5 * Real.sqrt 3 / 3 := by
import Mathlib theorem algebra_21678 : (5 / Real.sqrt 3 : ℝ) = 5 * Real.sqrt 3 / 3 := by have h1 : Real.sqrt 3 > 0 := by positivity field_simp <;> ring_nf <;> norm_num <;> ring <;> norm_num
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib theorem algebra_21678 : (5 / Real.sqrt 3 : ℝ) = 5 * Real.sqrt 3 / 3 := by have h1 : Real.sqrt 3 > 0 := by positivity field_simp
null
import Mathlib theorem algebra_21678 : (5 / Real.sqrt 3 : ℝ) = 5 * Real.sqrt 3 / 3 := by have h1 : Real.sqrt 3 > 0 := by positivity field_simp
import Mathlib theorem algebra_21678 : (5 / Real.sqrt 3 : ℝ) = 5 * Real.sqrt 3 / 3 := by have h1 : Real.sqrt 3 > 0 := by positivity field_simp
84
math-word-problem
autoformalizer
The total number of digits used to write the page numbers of a math book is $6869$ (for example, a $10$-page book has $9$ one-digit page numbers and $1$ two-digit page number, using a total of $9+2=11$ digits), so the number of pages in this math book isΒ ___Β Β Β Β Β Β Β Β Β Β ___Β .
import Mathlib def solution := 1994 /- The total number of digits used to write the page numbers of a math book is $6869$ (for example, a $10$-page book has $9$ one-digit page numbers and $1$ two-digit page number, using a total of $9+2=11$ digits), so the number of pages in this math book isΒ ___Β Β Β Β Β Β Β Β Β Β ___Β . -/ theorem number_theory_1544 : βˆ‘ i in Finset.range solution, (Nat.digits 10 (i + 1)).length = 6869 := by
import Mathlib def solution := 1994 theorem number_theory_1544 : βˆ‘ i in Finset.range solution, (Nat.digits 10 (i + 1)).length = 6869 := by native_decide
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib def solution := 1994 theorem number_theory_1544 : βˆ‘ i in Finset.range solution, (Nat.digits 10 (i
^solution).getLast!)^(-Finset.card {j| j*k=l})β‰₯ Nat.divisorSum solucion:=by normopose
import Mathlib def solution := 1994 theorem number_theory_1544 : βˆ‘ i in Finset.range solution, (Nat.digits 10 (i
import Mathlib def solution := 1994 theorem number_theory_1544 : βˆ‘ i in Finset.range solution, (Nat.digits 10 (i^solution).getLast!)^(-Finset.card {j| j*k=l})β‰₯ Nat.divisorSum solucion:=by normopose
85
math-word-problem
autoformalizer
Let $x$ and $y$ be positive real numbers such that $ x ^ { 3 } - y ^ { 3 } + ( x - y ) ^ { 3 } - 3 6 x y = 3 4 5 6 $. Find the value of $ x - y $.
import Mathlib /- Let $x$ and $y$ be positive real numbers such that $ x ^ { 3 } - y ^ { 3 } + ( x - y ) ^ { 3 } - 3 6 x y = 3 4 5 6 $. Find the value of $ x - y $. -/ theorem algebra_13860 {x y : ℝ} (hx : 0 < x) (hy : 0 < y) (h : x^3 - y^3 + (x - y)^3 - 36 * x * y = 3456) : x - y = 12 := by
import Mathlib theorem algebra_13860 {x y : ℝ} (hx : 0 < x) (hy : 0 < y) (h : x^3 - y^3 + (x - y)^3 - 36 * x * y = 3456) : x - y = 12 := by have h1 : x^3 - y^3 + (x - y)^3 - 36 * x * y = 3456 := h have h2 : x - y = 12 := by nlinarith [sq_nonneg (x - y - 12), sq_nonneg (x + y - 24), sq_nonneg (x - 2 * y), sq_nonneg (x^2 - (y + 12)^2), sq_nonneg (x - y), sq_nonneg (x + y), mul_pos hx hy, sq_nonneg (x^2 - y^2), sq_nonneg ((x - y) * (x + y) - 144)] exact h2
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib theorem algebra_13860 {x y : ℝ} (hx : 0 < x) (hy : 0 < y) (h : x^3 - y^3 + (x - y)^3 - 36 * x * y = 3456) : x - y = 12 := by have h1 : x^3 - y^3 + (x - y)^3 - 36 * x * y = 3456 := h have h2 : x - y = 12 := by nlinarith [sq_nonneg (x - y - 12), sq_nonneg (x + y - 24), sq_nonneg (x - 2 * y),
mul_self' _ _, add_mul', subtruction']
import Mathlib theorem algebra_13860 {x y : ℝ} (hx : 0 < x) (hy : 0 < y) (h : x^3 - y^3 + (x - y)^3 - 36 * x * y = 3456) : x - y = 12 := by have h1 : x^3 - y^3 + (x - y)^3 - 36 * x * y = 3456 := h have h2 : x - y = 12 := by nlinarith [sq_nonneg (x - y - 12), sq_nonneg (x + y - 24), sq_nonneg (x - 2 * y),
import Mathlib theorem algebra_13860 {x y : ℝ} (hx : 0 < x) (hy : 0 < y) (h : x^3 - y^3 + (x - y)^3 - 36 * x * y = 3456) : x - y = 12 := by have h1 : x^3 - y^3 + (x - y)^3 - 36 * x * y = 3456 := h have h2 : x - y = 12 := by nlinarith [sq_nonneg (x - y - 12), sq_nonneg (x + y - 24), sq_nonneg (x - 2 * y), mul_self' _ _, add_mul', subtruction']
86
math-word-problem
autoformalizer
Find the remainder when ${{2018}^{2019}}$ is divided by $2019$.
import Mathlib /- Find the remainder when ${{2018}^{2019}}$ is divided by $2019$. -/ theorem number_theory_4606 : 2018 ^ 2019 % 2019 = 2018 := by
import Mathlib theorem number_theory_4606 : 2018 ^ 2019 % 2019 = 2018 := by norm_num
### Example 1: import Mathlib theorem algebra_1274 {{x y : ℝ}} (hx : x β‰  0) (hy : y β‰  0) (hxy : x + y β‰  0) (h : βˆƒ k, 1 / x + 1 / y = k / (x + y)) : βˆƒ m, (x + y) ^ 2 = m * (x ^ 2 + y ^ 2) := by use (x + y) ^ 2 / (x ^ 2 + y ^ 2) have : x ^ 2 + y ^ 2 β‰  0 := by have hx2 : x ^ 2 > 0 := by exact sq_pos_of_ne_zero hx have hy2 : y ^ 2 > 0 := by exact sq_pos_of_ne_zero hy linarith field_simp ### Example 2: import Mathlib open Real Set open scoped BigOperators theorem calculus_196745 (x : ℝ) (hx : 0 < x) (h : x ≀ 60 / 2) : (x * (60 - 2 * x) ^ 2) ≀ 16000 := by nlinarith [sq_nonneg (x - 10), sq_nonneg ((60 - 2 * x) - 40), sq_nonneg ((x - 10) * (x - 40)), sq_nonneg ((x) * (x - 10)), sq_nonneg ((60 - 2 * x) / 2 - 10 * 2), sq_nonneg ((x / 10) - 1), sq_nonneg ((60 - 2 * x) / 40 - 1), sq_nonneg (x * (x - 30)), sq_nonneg ((60 - 2 * x) * (x - 10)), sq_nonneg ((x - 0) * (30 - x)), sq_nonneg (x * (60 - 2 * x - 40)), h, sq_nonneg (x * ((60 - 2 * x) - 40)), sq_nonneg ((x - 10) * ((60 - 2 * x) - 40))] ### Example 3: import Mathlib -- Let $f(n)$ denote the number of ways to fill a $2 \times n$ board. One can fill the leftmost column with two $1 \times 1$ tiles, leaving $f(n-1)$ ways, or one can fill the leftmost two columns with one $2 \times 2$ tile, leaving $f(n-2)$ ways. Therefore, $f(n)=f(n-1)+f(n-2)$ def f (n : β„•) : β„• := match n with | 0 => 1 | 1 => 1 | n + 2 => f n + f (n + 1) /-How many ways can one tile a 2Γ—8 board with 1Γ—1 and 2Γ—2 tiles? Rotations and reflections of the same configuration are considered distinct.-/ theorem Combinatorics_610027: f 8 = 34 := by simp [f] ### Example 4: import Mathlib theorem number_theory_4606 : 2018 ^ 2019 % 20
^(-k+l*m)*p= p:=by normF
import Mathlib theorem number_theory_4606 : 2018 ^ 2019 % 20
import Mathlib theorem number_theory_4606 : 2018 ^ 2019 % 20^(-k+l*m)*p= p:=by normF