Harryis commited on
Commit
f80d835
·
verified ·
1 Parent(s): 358dd8b

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10075.lean +16 -0
  2. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10081.lean +16 -0
  3. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10082.lean +55 -0
  4. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10097.lean +17 -0
  5. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10125.lean +25 -0
  6. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10144.lean +18 -0
  7. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10147.lean +20 -0
  8. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10166.lean +20 -0
  9. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10168.lean +31 -0
  10. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10170.lean +19 -0
  11. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10172.lean +20 -0
  12. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10178.lean +30 -0
  13. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_1018.lean +34 -0
  14. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10187.lean +20 -0
  15. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10191.lean +17 -0
  16. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10197.lean +20 -0
  17. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10198.lean +25 -0
  18. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_102.lean +25 -0
  19. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10202.lean +41 -0
  20. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10204.lean +16 -0
  21. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10207.lean +14 -0
  22. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10208.lean +24 -0
  23. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10209.lean +22 -0
  24. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_1021.lean +25 -0
  25. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10218.lean +17 -0
  26. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10222.lean +49 -0
  27. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10230.lean +16 -0
  28. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10236.lean +26 -0
  29. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_1024.lean +17 -0
  30. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10246.lean +18 -0
  31. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10253.lean +20 -0
  32. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10255.lean +28 -0
  33. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10290.lean +18 -0
  34. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10291.lean +16 -0
  35. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10295.lean +28 -0
  36. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10299.lean +23 -0
  37. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10303.lean +16 -0
  38. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10305.lean +20 -0
  39. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10307.lean +18 -0
  40. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10308.lean +20 -0
  41. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10309.lean +24 -0
  42. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10314.lean +32 -0
  43. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10319.lean +19 -0
  44. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_1032.lean +15 -0
  45. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10328.lean +15 -0
  46. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10329.lean +31 -0
  47. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10331.lean +19 -0
  48. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10337.lean +31 -0
  49. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_1034.lean +22 -0
  50. external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10342.lean +24 -0
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10075.lean ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Let a; b; c be positive real numbers such that $abc$ = 1, Prove that $a^2 + b^2 + c^2 \geq a + b + c$ -/
9
+ theorem lean_workbook_10075 (a b c : ℝ) (h : a * b * c = 1) : a ^ 2 + b ^ 2 + c ^ 2 ≥ a + b + c := by
10
+ /-
11
+ Given positive real numbers \(a\), \(b\), and \(c\) such that \(abc = 1\), we need to prove that \(a^2 + b^2 + c^2 \geq a + b + c\).
12
+ To prove this, we use the non-linear arithmetic (nlinarith) tactic, which automatically handles inequalities involving squares and sums. Specifically, we consider the squares of the differences \(a - 1\), \(b - 1\), and \(c - 1\), and use the fact that these squares are non-negative to derive the desired inequality.
13
+ -/
14
+ -- Use non-linear arithmetic to handle the inequality involving squares and sums.
15
+ -- We consider the squares of the differences (a - 1), (b - 1), and (c - 1), and use the fact that these squares are non-negative.
16
+ nlinarith [sq_nonneg (a - 1), sq_nonneg (b - 1), sq_nonneg (c - 1), sq_nonneg (a - b), sq_nonneg (b - c), sq_nonneg (c - a)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10081.lean ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- For $a, b, c>0, a^2+b^2+c^2=1$ prove that \n $abc\left(\frac{a}{a^4+a^2+bc}+\frac{b}{b^4+b^2+ca}+\frac{c}{c^4+c^2+ab}\right)\le\frac{3}{4+(\sqrt{ab}+\sqrt{bc}+\sqrt{ca})^2}$ -/
9
+ theorem lean_workbook_10081 (a b c : ℝ) (ha : 0 < a) (hb : 0 < b) (hc : 0 < c) (habc : a * b * c = 1) (h : a^2 + b^2 + c^2 = 1) : a * b * c * (a / (a^4 + a^2 + b * c) + b / (b^4 + b^2 + c * a) + c / (c^4 + c^2 + a * b)) ≤ 3 / (4 + (Real.sqrt (a * b) + Real.sqrt (b * c) + Real.sqrt (c * a))^2) := by
10
+ /-
11
+ To prove the inequality \( abc \left( \frac{a}{a^4 + a^2 + b c} + \frac{b}{b^4 + b^2 + c a} + \frac{c}{c^4 + c^2 + a b} \right) \leq \frac{3}{4 + (\sqrt{a b} + \sqrt{b c} + \sqrt{c a})^2} \) given \( a, b, c > 0 \) and \( a^2 + b^2 + c^2 = 1 \), we start by simplifying the expression using algebraic manipulations and properties of real numbers. We then apply non-linear arithmetic to establish the inequality.
12
+ -/
13
+ -- Simplify the expression using algebraic manipulations.
14
+ simp_all only [mul_add, mul_sub, mul_one, mul_div_cancel_left, mul_comm]
15
+ -- Apply non-linear arithmetic to establish the inequality.
16
+ nlinarith [sq_nonneg (a - b)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10082.lean ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Solve the system of equations in $x$ and $y$ : \n $$\begin{cases} \sqrt{\frac x y}-\sqrt{\frac y x}=\frac 7{\sqrt{xy}}\\ \sqrt[4]{x^3y}-\sqrt[4]{xy^3}=\sqrt{12} \end{cases}$$ -/
9
+ theorem lean_workbook_10082 (x y : ℝ) (h₁ : Real.sqrt (x / y) - Real.sqrt (y / x) = 7 / Real.sqrt (x * y)) (h₂ : (x ^ 3 * y) ^ (1 / 4) - (x * y ^ 3) ^ (1 / 4) = Real.sqrt 12) : x = 16 ∧ y = 9 := by
10
+ /-
11
+ To solve the system of equations in \( x \) and \( y \):
12
+ \[
13
+ \begin{cases}
14
+ \sqrt{\frac{x}{y}} - \sqrt{\frac{y}{x}} = \frac{7}{\sqrt{xy}} \\
15
+ \sqrt[4]{x^3 y} - \sqrt[4]{x y^3} = \sqrt{12}
16
+ \end{cases}
17
+ \]
18
+ we start by simplifying the given equations. We use algebraic manipulations and properties of square roots to derive the values of \( x \) and \( y \).
19
+ 1. **Simplify the first equation**:
20
+ \[
21
+ \sqrt{\frac{x}{y}} - \sqrt{\frac{y}{x}} = \frac{7}{\sqrt{xy}}
22
+ \]
23
+ Multiplying both sides by \(\sqrt{xy}\) to clear the denominator:
24
+ \[
25
+ x - y = 7
26
+ \]
27
+ 2. **Simplify the second equation**:
28
+ \[
29
+ \sqrt[4]{x^3 y} - \sqrt[4]{x y^3} = \sqrt{12}
30
+ \]
31
+ This can be rewritten as:
32
+ \[
33
+ \sqrt{x y^3} - \sqrt{x^3 y} = \sqrt{12}
34
+ \]
35
+ Since \(\sqrt{x y^3} - \sqrt{x^3 y} = \sqrt{12}\), we can square both sides to eliminate the square roots:
36
+ \[
37
+ (x y^3 - x^3 y)^2 = 12
38
+ \]
39
+ Simplifying further:
40
+ \[
41
+ x^2 y^6 - 2 x^4 y^4 + x^6 y^2 = 12
42
+ \]
43
+ Using \(x - y = 7\), we substitute \(y = 7 + x\) into the equation:
44
+ \[
45
+ x^2 (7 + x)^6 - 2 x^4 (7 + x)^4 + x^6 (7 + x)^2 = 12
46
+ \]
47
+ Solving this equation, we find that \(x = 16\) and \(y = 9\).
48
+ -/
49
+ -- Simplify the given equations by clearing the denominators using field_simp
50
+ field_simp [h₁, h₂, Real.sqrt_ne_zero, mul_comm, mul_left_comm, mul_assoc] at h₁ h₂ ⊢
51
+ -- Normalize the expressions by expanding and simplifying them
52
+ ring_nf at h₁ h₂ ⊢
53
+ -- Use nlinarith to solve the resulting system of equations
54
+ apply And.intro <;> nlinarith [sq_sqrt (show (0 : ℝ) ≤ 12 by norm_num),
55
+ sq_sqrt (show (0 : ℝ) ≤ 12 by norm_num)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10097.lean ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Is this true for any reals $ a, b, c \ge 0 $ ?\n\n$ 3(a^4 + b^4 + c^4) + 2abc(a+b+c) \ge 5( a^2b^2+b^2c^2+c^2a^2 ) \ \ ; $\n -/
9
+ theorem lean_workbook_10097 (a b c : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) (hc : 0 ≤ c) : 3 * (a ^ 4 + b ^ 4 + c ^ 4) + 2 * a * b * c * (a + b + c) ≥ 5 * (a ^ 2 * b ^ 2 + b ^ 2 * c ^ 2 + c ^ 2 * a ^ 2) := by
10
+ /-
11
+ We need to show that for any non-negative real numbers \(a, b, c\), the inequality \(3(a^4 + b^4 + c^4) + 2abc(a+b+c) \geq 5(a^2b^2 + b^2c^2 + c^2a^2)\) holds. This can be proven using non-linear arithmetic (nlinarith) by considering the non-negativity of squares and other expressions involving non-negative numbers.
12
+ -/
13
+ -- Use non-linear arithmetic to prove the inequality by considering the non-negativity of squares and other expressions.
14
+ nlinarith [sq_nonneg (a - b), sq_nonneg (b - c), sq_nonneg (c - a),
15
+ mul_nonneg ha hb, mul_nonneg hb hc, mul_nonneg hc ha,
16
+ sq_nonneg (a + b), sq_nonneg (b + c), sq_nonneg (c + a),
17
+ mul_self_nonneg (a - b + c), mul_self_nonneg (b - c + a), mul_self_nonneg (c - a + b)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10125.lean ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- $$2a^2+2b^2+c^2 \ge \frac{\sqrt{10}}{5}(a+3b)c$$ -/
9
+ theorem lean_workbook_10125 (a b c : ℝ) : 2 * a ^ 2 + 2 * b ^ 2 + c ^ 2 ≥ (Real.sqrt 10 / 5) * (a + 3 * b) * c := by
10
+ /-
11
+ We need to show that for real numbers \(a\), \(b\), and \(c\), the inequality \(2a^2 + 2b^2 + c^2 \geq \frac{\sqrt{10}}{5}(a + 3b)c\) holds. To prove this, we will use the non-linear arithmetic (nlinarith) tactic, which can handle inequalities involving squares and square roots. Specifically, we will use the fact that the square of any real number is non-negative, and the non-negativity of the square root of a non-negative number.
12
+ -/
13
+ -- Use nlinarith to handle the inequality. We provide lemmas about the non-negativity of squares and the square root.
14
+ nlinarith [
15
+ -- The square of any real number is non-negative.
16
+ sq_nonneg (a - Real.sqrt 10 / 5 * c), -- This ensures that the term involving a and c is non-negative.
17
+ sq_nonneg (b - Real.sqrt 10 / 5 * c), -- Similarly, this ensures that the term involving b and c is non-negative.
18
+ sq_sqrt (show (0 : ℝ) ≤ 10 by norm_num), -- This ensures that the square root of 10 is non-negative.
19
+ sq_nonneg (a + 3 * b), -- This ensures that the term involving a and b is non-negative.
20
+ sq_nonneg (a - 3 * b), -- This ensures that the term involving a and b is non-negative.
21
+ sq_nonneg (c - a), -- This ensures that the term involving c and a is non-negative.
22
+ sq_nonneg (c + a), -- This ensures that the term involving c and a is non-negative.
23
+ sq_nonneg (c - b), -- This ensures that the term involving c and b is non-negative.
24
+ sq_nonneg (c + b) -- This ensures that the term involving c and b is non-negative.
25
+ ]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10144.lean ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Let $a,b,c,d\in \mathbb{R}$ such that $ab=1$ and $ac+bd=2$ . Prove: $1-cd\ge 0$ -/
9
+ theorem lean_workbook_10144 (a b c d : ℝ) (hab : a * b = 1) (h : a * c + b * d = 2) : 1 - c * d ≥ 0 := by
10
+ /-
11
+ Given \(a, b, c, d \in \mathbb{R}\) such that \(ab = 1\) and \(ac + bd = 2\), we need to prove that \(1 - cd \geq 0\).
12
+ 1. Start by considering the expression \(1 - cd\).
13
+ 2. Use the given conditions \(ab = 1\) and \(ac + bd = 2\).
14
+ 3. Apply the non-negativity of squares to derive the desired inequality.
15
+ -/
16
+ -- Use the non-negativity of squares to derive the inequality.
17
+ -- Specifically, consider the squares of the differences (a * c - b * d) and (a * d + b * c).
18
+ nlinarith [sq_nonneg (a * c - b * d), sq_nonneg (a * d + b * c), sq_nonneg (a * c + b * d)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10147.lean ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Prove that for any positive integer n, there exist a Fibonacci Number $F_m$ such that $n \; | \; F_m$ and $m \le n^2-1$ -/
9
+ theorem lean_workbook_10147 (n : ℕ) : ∃ m ≤ n^2-1, n ∣ fib m := by
10
+ /-
11
+ For any positive integer \( n \), we need to show that there exists a Fibonacci number \( F_m \) such that \( n \) divides \( F_m \) and \( m \leq n^2 - 1 \). We will use the fact that the Fibonacci sequence modulo any positive integer \( n \) is periodic with a period that can be expressed in terms of \( n \). Specifically, we will show that \( m = 0 \) satisfies the conditions, as \( F_0 = 0 \) and \( 0 \leq n^2 - 1 \).
12
+ -/
13
+ -- We claim that m = 0 satisfies the conditions.
14
+ use 0
15
+ -- We need to show that 0 ≤ n^2 - 1 and n ∣ fib 0.
16
+ constructor
17
+ -- Since n^2 is a positive integer, n^2 - 1 is non-negative.
18
+ exact by omega
19
+ -- We know that fib 0 = 0, and any number divides 0.
20
+ simp
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10166.lean ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Compute $\frac{4}{7} \cdot \frac{5}{11}$ . -/
9
+ theorem lean_workbook_10166 (a b c d : ℚ) (h₁ : a = 4/7) (h₂ : b = 5/11) : a * b = 20/77 := by
10
+ /-
11
+ To compute the product of \(\frac{4}{7}\) and \(\frac{5}{11}\), we proceed as follows:
12
+ 1. Substitute the given values \(a = \frac{4}{7}\) and \(b = \frac{5}{11}\) into the expression \(a \cdot b\).
13
+ 2. Multiply the numerators: \(4 \cdot 5 = 20\).
14
+ 3. Multiply the denominators: \(7 \cdot 11 = 77\).
15
+ 4. Combine the results to obtain \(\frac{20}{77}\).
16
+ -/
17
+ -- Substitute the given values for a and b into the expression a * b.
18
+ rw [h₁, h₂]
19
+ -- Simplify the expression using numerical normalization to verify the result.
20
+ norm_num
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10168.lean ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- If $f(x)=28x^5+3x^4-29x^3+4x^2-7x+1$ then $f(1)=0$. -/
9
+ theorem lean_workbook_10168 (f : ℝ → ℝ)
10
+ (h₀ : ∀ x, f x = 28 * x^5 + 3 * x^4 - 29 * x^3 + 4 * x^2 - 7 * x + 1) :
11
+ f 1 = 0 := by
12
+ /-
13
+ We need to show that for the function \( f(x) = 28x^5 + 3x^4 - 29x^3 + 4x^2 - 7x + 1 \), the value \( f(1) \) is zero. We start by substituting \( x = 1 \) into the function and simplifying the expression step by step.
14
+ 1. Substitute \( x = 1 \) into \( f(x) \):
15
+ \[
16
+ f(1) = 28 \cdot 1^5 + 3 \cdot 1^4 - 29 \cdot 1^3 + 4 \cdot 1^2 - 7 \cdot 1 + 1
17
+ \]
18
+ 2. Calculate each term:
19
+ \[
20
+ 28 \cdot 1^5 = 28, \quad 3 \cdot 1^4 = 3, \quad -29 \cdot 1^3 = -29, \quad 4 \cdot 1^2 = 4, \quad -7 \cdot 1 = -7, \quad 1 = 1
21
+ \]
22
+ 3. Sum the terms:
23
+ \[
24
+ 28 + 3 - 29 + 4 - 7 + 1 = 0
25
+ \]
26
+ Thus, \( f(1) = 0 \).
27
+ -/
28
+ -- Substitute x = 1 into the function and simplify using h₀.
29
+ simp_all only [h₀, one_pow, mul_one, mul_zero, add_zero, zero_add, sub_zero]
30
+ -- Simplify the expression using ring operations to show that the result is zero.
31
+ ring
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10170.lean ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- $\lfloor \frac{30}{4.5}\rfloor = 6$ Answer: A -/
9
+ theorem lean_workbook_10170 (x : ℝ) (hx : x = 30 / 4.5) : ⌊x⌋ = 6 := by
10
+ /-
11
+ To prove that \(\lfloor \frac{30}{4.5} \rfloor = 6\), we start by simplifying the expression \(\frac{30}{4.5}\). We know that \(4.5\) can be written as \(\frac{9}{2}\). Thus, the expression becomes \(\frac{30}{\frac{9}{2}} = \frac{30 \times 2}{9} = \frac{60}{9} = \frac{20}{3}\).
12
+ Next, we need to determine the floor of \(\frac{20}{3}\). We calculate \(\frac{20}{3} \approx 6.6667\). The floor function \(\lfloor x \rfloor\) returns the greatest integer less than or equal to \(x\). Since \(6.6667\) is approximately 6.6667, the greatest integer less than or equal to \(6.6667\) is 6.
13
+ Thus, we have shown that \(\lfloor \frac{30}{4.5} \rfloor = 6\).
14
+ -/
15
+ -- Simplify the expression 30 / 4.5 to 20 / 3
16
+ norm_num [Int.floor_eq_iff, hx]
17
+ -- Verify that 20 / 3 is approximately 6.6667, and thus the floor of 20 / 3 is 6
18
+ <;> norm_num
19
+ <;> linarith
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10172.lean ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Let $a, b, c\\in[0,1)$ and $a+b+c=\\frac{3}{2}$ . Prove that $$\\sqrt{(1-a)(1-b)(1-c)} \\leq \\frac{2(2ab+3bc+3ca)}{9} $$ -/
9
+ theorem lean_workbook_10172 (a b c : ℝ) (ha : 0 ≤ a ∧ a < 1) (hb : 0 ≤ b ∧ b < 1) (hc : 0 ≤ c ∧ c < 1) (habc : a + b + c = 3 / 2) : (1 - a) * (1 - b) * (1 - c) ≤ (2 * (2 * a * b + 3 * b * c + 3 * c * a)) / 9 := by
10
+ /-
11
+ Given \(a, b, c \in [0,1)\) with \(a + b + c = \frac{3}{2}\), we need to prove that:
12
+ \[
13
+ \sqrt{(1-a)(1-b)(1-c)} \leq \frac{2(2ab+3bc+3ca)}{9}
14
+ \]
15
+ First, we expand and simplify the expression on both sides. We use algebraic manipulations and properties of real numbers to show that the inequality holds. Specifically, we use the fact that the square root of a product is less than or equal to a certain fraction involving the terms \(a, b,\) and \(c\).
16
+ -/
17
+ -- Expand and simplify both sides of the inequality using algebraic identities.
18
+ ring_nf
19
+ -- Use non-linear arithmetic to prove the inequality, leveraging the non-negativity of squares and the given constraints on a, b, and c.
20
+ nlinarith [sq_nonneg (a + b + c - 1), sq_nonneg (a - b), sq_nonneg (b - c), sq_nonneg (c - a)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10178.lean ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Suppose $y$ between $x$ and $z.$ By AM-GM Inequality, we have \n $4\,xyz \left( xy+zx+yz \right) \left( x+y+z \right) \leqslant [zx(x+y+z)+y(xy+yz+zx)]^2.$ We need to prove that \n $3\,xyz+{x}^{2}y+{y}^{2}z+{z}^{2}x \geqslant xy(x+y+z)+z(xy+yz+zx),$ equivalent to \n $x(x-y)(y-z) \geqslant 0.$ Which is true.\n -/
9
+ theorem lean_workbook_10178 (x y z : ℝ)
10
+ (h₀ : 0 < x ∧ 0 < y ∧ 0 < z)
11
+ (h₁ : y ≠ x)
12
+ (h₂ : y ≠ z)
13
+ (h₃ : z ≠ x)
14
+ (h₄ : x + y + z = 1) :
15
+ 4 * x * y * z * (x * y + y * z + z * x) * (x + y + z) ≤ (z * x * (x + y + z) + y * (x * y + y * z + z * x))^2 := by
16
+ /-
17
+ Suppose \( y \) is between \( x \) and \( z \). By the AM-GM Inequality, we have:
18
+ \[ 4 \cdot x \cdot y \cdot z \cdot (x \cdot y + y \cdot z + z \cdot x) \cdot (x + y + z) \leq (z \cdot x \cdot (x + y + z) + y \cdot (x \cdot y + y \cdot z + z \cdot x))^2. \]
19
+ We need to prove that:
20
+ \[ 3 \cdot x \cdot y \cdot z + x^2 \cdot y + y^2 \cdot z + z^2 \cdot x \geq x \cdot y \cdot (x + y + z) + z \cdot (x \cdot y + y \cdot z + z \cdot x), \]
21
+ which is equivalent to:
22
+ \[ x \cdot (x - y) \cdot (y - z) \geq 0. \]
23
+ This is true due to the ordering of \( x, y, \) and \( z \).
24
+ -/
25
+ -- Use non-linear arithmetic to prove the inequality.
26
+ nlinarith [sq_nonneg (z * x * (x + y + z) + y * (x * y + y * z + z * x)),
27
+ sq_nonneg (z * x * (x + y + z) - y * (x * y + y * z + z * x)),
28
+ mul_self_nonneg (x - y),
29
+ mul_self_nonneg (y - z),
30
+ mul_self_nonneg (z - x)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_1018.lean ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- By C-S $\sum_{cyc}\frac{a}{b+c+4d}\geq\frac{(a+b+c+d)^2}{\sum\limits_{cyc}(ab+ac+4da)}=\frac{(a+b+c+d)^2}{5\sum\limits_{cyc}ab+2(ac+bd)}$ . \n Hence, it remains to prove that $3(a^2+b^2+c^2+d^2)-4(ab+bc+cd+da)+2(ac+bd)\geq0$ , which is \n $(a-b+c-d)^2+\sum_{cyc}(a-b)^2\geq0$ . Done! -/
9
+ theorem lean_workbook_1018 (a b c d : ℝ) :
10
+ 3 * (a^2 + b^2 + c^2 + d^2) - 4 * (a * b + b * c + c * d + d * a) + 2 * (a * c + b * d) ≥ 0 := by
11
+ /-
12
+ We need to prove that for real numbers \(a, b, c, d\), the inequality \(3(a^2 + b^2 + c^2 + d^2) - 4(ab + bc + cd + da) + 2(ac + bd) \geq 0\) holds. This can be shown using the Cauchy-Schwarz inequality. Specifically, we can rewrite the inequality as:
13
+ \[
14
+ \sum_{\text{cyc}} \frac{a}{b + c + 4d} \geq \frac{(a + b + c + d)^2}{\sum_{\text{cyc}} (ab + ac + 4da)}
15
+ \]
16
+ which simplifies to:
17
+ \[
18
+ \frac{(a + b + c + d)^2}{5 \sum_{\text{cyc}} ab + 2(ac + bd)}
19
+ \]
20
+ Thus, it remains to prove that:
21
+ \[
22
+ 3(a^2 + b^2 + c^2 + d^2) - 4(ab + bc + cd + da) + 2(ac + bd) \geq 0
23
+ \]
24
+ This can be further simplified to:
25
+ \[
26
+ (a - b + c - d)^2 + \sum_{\text{cyc}} (a - b)^2 \geq 0
27
+ \]
28
+ which is always non-negative since it is a sum of squares.
29
+ -/
30
+ -- Use the `nlinarith` tactic to handle the non-linear arithmetic.
31
+ -- We provide specific non-negativity conditions for the terms involved.
32
+ nlinarith [sq_nonneg (a - b + c - d), sq_nonneg (a + b - c - d), sq_nonneg (a - b - c + d),
33
+ sq_nonneg (a + b + c - d), sq_nonneg (a + b + c + d), sq_nonneg (a - b + c + d),
34
+ sq_nonneg (a - b - c - d), sq_nonneg (a + b - c + d)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10187.lean ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- If a,b,c are side lengths of triangle , prove that $(a+b)(a+c)(b+c) \geq 8(a+b-c)(a+c-b)(b+c-a)$ -/
9
+ theorem lean_workbook_10187 {a b c : ℝ} (hx: a > 0 ∧ b > 0 ∧ c > 0) (hab : a + b > c) (hbc : b + c > a) (hca : a + c > b) : (a + b) * (a + c) * (b + c) ≥ 8 * (a + b - c) * (a + c - b) * (b + c - a) := by
10
+ /-
11
+ Given that \(a\), \(b\), and \(c\) are the side lengths of a triangle, we need to prove that:
12
+ \[
13
+ (a + b)(a + c)(b + c) \geq 8(a + b - c)(a + c - b)(b + c - a)
14
+ \]
15
+ To prove this inequality, we can use the non-linear arithmetic (nlinarith) tactic, which automatically handles inequalities involving polynomials. The tactic will use the given conditions to derive the desired inequality.
16
+ -/
17
+ -- Use the non-linear arithmetic tactic to handle the inequality.
18
+ -- The tactic will use the given conditions to derive the desired inequality.
19
+ nlinarith [sq_nonneg (a - b), sq_nonneg (b - c), sq_nonneg (c - a),
20
+ mul_self_nonneg (a + b - c), mul_self_nonneg (b + c - a), mul_self_nonneg (c + a - b)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10191.lean ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Prove that for $x, y, z \geq 0$, the following inequality holds: $x^3 + y^3 + z^3 + x^2y + y^2z + z^2x \geq 2(xy^2 + yz^2 + zx^2)$. -/
9
+ theorem lean_workbook_10191 (x y z : ℝ) (hx : x ≥ 0) (hy : y ≥ 0) (hz : z ≥ 0) : x ^ 3 + y ^ 3 + z ^ 3 + x ^ 2 * y + y ^ 2 * z + z ^ 2 * x ≥ 2 * (x * y ^ 2 + y * z ^ 2 + z * x ^ 2) := by
10
+ /-
11
+ To prove the inequality \( x^3 + y^3 + z^3 + x^2y + y^2z + z^2x \geq 2(xy^2 + yz^2 + zx^2) \) for \( x, y, z \geq 0 \), we can use the non-linear arithmetic tactic `nlinarith`. This tactic is designed to handle inequalities involving polynomials and can automatically deduce the desired inequality by considering the non-negativity of various squared terms and the non-negativity of \( x, y, \) and \( z \).
12
+ -/
13
+ -- Use the non-linear arithmetic tactic `nlinarith` to prove the inequality.
14
+ -- This tactic will consider the non-negativity of various squared terms and the non-negativity of `x`, `y`, and `z` to deduce the desired inequality.
15
+ nlinarith [sq_nonneg (x - y), sq_nonneg (y - z), sq_nonneg (z - x), mul_nonneg hx hy, mul_nonneg hy hz, mul_nonneg hz hx,
16
+ sq_nonneg (x + y), sq_nonneg (y + z), sq_nonneg (z + x), mul_nonneg (sq_nonneg x) (sq_nonneg y),
17
+ mul_nonneg (sq_nonneg y) (sq_nonneg z), mul_nonneg (sq_nonneg z) (sq_nonneg x)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10197.lean ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Let $x$ be positive real number , Prove that $(1+x)^3(1+\frac{16}{x^3})\ge 81.$ -/
9
+ theorem lean_workbook_10197 (x : ℝ) (hx : x > 0) : (1 + x) ^ 3 * (1 + 16 / x ^ 3) ≥ 81 := by
10
+ /-
11
+ To prove that for a positive real number \( x \), \((1 + x)^3 \left(1 + \frac{16}{x^3}\right) \ge 81\), we start by simplifying the expression. We use the fact that \( x > 0 \) to handle the division and powers. We then apply algebraic manipulations and inequalities to show that the expression is indeed greater than or equal to 81.
12
+ -/
13
+ -- Simplify the expression by clearing denominators and handling powers.
14
+ field_simp [hx]
15
+ -- Rewrite the expression in a more manageable form.
16
+ rw [le_div_iff (by positivity)]
17
+ -- Normalize the expression by expanding and simplifying it.
18
+ ring_nf
19
+ -- Use non-linear arithmetic to prove the inequality.
20
+ nlinarith [sq_nonneg (x - 2), sq_nonneg (x + 2), sq_nonneg (x ^ 2 - 4)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10198.lean ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- For $x, y, z$ positive real numbers, prove that the following inequality holds $(x-y)\\cdot\\frac{x}{y+z}+(y-z)\\cdot\\frac{y}{z+x}+(z-x)\\cdot\\frac{z}{x+y}\\geq0$ -/
9
+ theorem lean_workbook_10198 (x y z : ℝ) (hx : x > 0) (hy : y > 0) (hz : z > 0) (hxy : x ≠ y) (hyz : y ≠ z) (hxz : x ≠ z) : (x - y) * (x / (y + z)) + (y - z) * (y / (z + x)) + (z - x) * (z / (x + y)) ≥ 0 := by
10
+ /-
11
+ To prove the inequality \((x-y) \cdot \frac{x}{y+z} + (y-z) \cdot \frac{y}{z+x} + (z-x) \cdot \frac{z}{x+y} \geq 0\) for positive real numbers \(x, y, z\), we proceed as follows:
12
+ 1. **Establish non-negativity of the terms**: Each term in the expression is a product of a difference and a fraction. Since \(x, y, z\) are positive, the denominators are positive, ensuring the fractions are non-negative.
13
+ 2. **Simplify the expression**: Using the fact that \(x, y, z\) are positive and the inequalities \(x \neq y\), \(y \neq z\), and \(x \neq z\), we can simplify the expression by applying algebraic manipulations and properties of real numbers.
14
+ 3. **Combine and verify**: Combine the terms and use the properties of real numbers to verify that the sum of these terms is non-negative.
15
+ -/
16
+ have h1 : 0 < y + z := by linarith
17
+ have h2 : 0 < z + x := by linarith
18
+ have h3 : 0 < x + y := by linarith
19
+ have h4 : 0 < x * y := by positivity
20
+ have h5 : 0 < y * z := by positivity
21
+ have h6 : 0 < z * x := by positivity
22
+ field_simp [h1, h2, h3, h4, h5, h6]
23
+ rw [le_div_iff (by positivity)]
24
+ ring_nf
25
+ nlinarith [sq_nonneg (x - y), sq_nonneg (y - z), sq_nonneg (z - x)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_102.lean ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Plugging that into the the top gives $\frac{3 - (4p+3)}{8p^2-8p-3} = \frac{-4p}{8p^2-8p-3}.$ -/
9
+ theorem lean_workbook_102 (p : ℝ)
10
+ (h₀ : 8 * p^2 - 8 * p - 3 ≠ 0)
11
+ (h₁ : 3 - (4 * p + 3) ≠ 0) :
12
+ (3 - (4 * p + 3)) / (8 * p^2 - 8 * p - 3) = (-4 * p) / (8 * p^2 - 8 * p - 3) := by
13
+ /-
14
+ We need to show that for a real number \( p \), given the conditions \( 8p^2 - 8p - 3 \neq 0 \) and \( 3 - (4p + 3) \neq 0 \), the equation \(\frac{3 - (4p + 3)}{8p^2 - 8p - 3} = \frac{-4p}{8p^2 - 8p - 3}\) holds. This can be achieved by simplifying the numerator on the left-hand side.
15
+ First, we simplify the numerator \( 3 - (4p + 3) \):
16
+ \[ 3 - (4p + 3) = 3 - 4p - 3 = -4p \]
17
+ Thus, the left-hand side of the equation becomes:
18
+ \[ \frac{3 - (4p + 3)}{8p^2 - 8p - 3} = \frac{-4p}{8p^2 - 8p - 3} \]
19
+ This directly matches the right-hand side of the equation, confirming the equality.
20
+ -/
21
+ -- Simplify the numerator 3 - (4 * p + 3) to -4 * p
22
+ field_simp [h₀, h₁, sub_eq_zero, add_left_neg, add_right_neg, sub_add_cancel, sub_self, zero_add,
23
+ mul_comm]
24
+ -- Use linarith to confirm the equality
25
+ <;> linarith
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10202.lean ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Prove that $2^{21} \equiv 1 \pmod 7$ without a calculator. -/
9
+ theorem lean_workbook_10202 : 2^21 ≡ 1 [ZMOD 7] := by
10
+ /-
11
+ To prove that \(2^{21} \equiv 1 \pmod{7}\), we can use properties of modular arithmetic and exponentiation. Specifically, we will show that \(2^{21} \mod 7 = 1\).
12
+ 1. First, observe that \(2^3 = 8 \equiv 1 \pmod{7}\).
13
+ 2. This implies that \(2^3 \equiv 1 \pmod{7}\).
14
+ 3. Using this result, we can express \(2^{21}\) as \((2^3)^7\).
15
+ 4. Since \(2^3 \equiv 1 \pmod{7}\), we have \((2^3)^7 \equiv 1^7 \pmod{7}\).
16
+ 5. Simplifying, we get \(1^7 = 1\), thus \(2^{21} \equiv 1 \pmod{7}\).
17
+ -/
18
+ -- Use norm_num to simplify the expression involving powers and modular arithmetic.
19
+ norm_num [Int.ModEq, pow_succ, Int.mul_emod]
20
+ -- Each `rfl` confirms the equivalence step-by-step, ensuring the final result is correct.
21
+ <;> rfl
22
+ <;> rfl
23
+ <;> rfl
24
+ <;> rfl
25
+ <;> rfl
26
+ <;> rfl
27
+ <;> rfl
28
+ <;> rfl
29
+ <;> rfl
30
+ <;> rfl
31
+ <;> rfl
32
+ <;> rfl
33
+ <;> rfl
34
+ <;> rfl
35
+ <;> rfl
36
+ <;> rfl
37
+ <;> rfl
38
+ <;> rfl
39
+ <;> rfl
40
+ <;> rfl
41
+ <;> rfl
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10204.lean ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Prove that $(x + 1)(y + 2)(z + 3) \geq 8$ for non-negative real numbers $x, y, z$ with $x + y + z = 1$. -/
9
+ theorem lean_workbook_10204 (x y z : ℝ) (hx : x ≥ 0 ∧ y ≥ 0 ∧ z ≥ 0) (h : x + y + z = 1) : (x + 1) * (y + 2) * (z + 3) ≥ 8 := by
10
+ /-
11
+ To prove that \((x + 1)(y + 2)(z + 3) \geq 8\) for non-negative real numbers \(x, y, z\) with \(x + y + z = 1\), we can use the non-linear arithmetic (nlinarith) tactic in Lean4. This tactic is designed to handle inequalities involving polynomials and can automatically deduce the required inequality by considering the non-negativity of the variables and the given sum constraint.
12
+ -/
13
+ -- Use nlinarith to handle the inequality. This tactic will consider the non-negativity of the variables and the given sum constraint to deduce the required inequality.
14
+ nlinarith [mul_nonneg hx.1 hx.2.1, mul_nonneg hx.1 hx.2.2, mul_nonneg hx.2.1 hx.2.2,
15
+ mul_self_nonneg (x - 1 / 3), mul_self_nonneg (y - 1 / 3), mul_self_nonneg (z - 1 / 3),
16
+ mul_self_nonneg (x - y), mul_self_nonneg (y - z), mul_self_nonneg (z - x)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10207.lean ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Using congruence properties, prove that $2^{mn}-1$ is divisible by $2^{m}-1$ for all integers $m, n\ge 1$ . -/
9
+ theorem lean_workbook_10207 (m n : ℕ) (hm : 1 ≤ m) (hn : 1 ≤ n) : (2 ^ m - 1) ∣ (2 ^ (m * n) - 1) := by
10
+ /-
11
+ We need to prove that for any integers \( m \) and \( n \) both greater than or equal to 1, \( 2^{mn} - 1 \) is divisible by \( 2^m - 1 \). This can be shown using the property of exponents and the fact that \( 2^m - 1 \) divides \( 2^{mn} - 1 \).
12
+ -/
13
+ -- Use the property that \( 2^m - 1 \) divides \( 2^{mn} - 1 \) for natural numbers \( m \) and \( n \).
14
+ simpa only [one_pow, pow_mul] using nat_sub_dvd_pow_sub_pow _ 1 n
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10208.lean ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Prove that $2S=k(k+1)$ where $S=k+(k-1)+\cdots+1$. -/
9
+ theorem lean_workbook_10208 (k : ℕ) : 2 * (k * (k + 1) / 2) = k * (k + 1) := by
10
+ /-
11
+ To prove that \(2S = k(k+1)\) where \(S = k + (k-1) + \cdots + 1\), we start by expressing \(S\) as a sum of the first \(k\) natural numbers. The sum of the first \(k\) natural numbers is given by the formula \(\frac{k(k+1)}{2}\). We then multiply this sum by 2 to get \(2S\). Simplifying the expression, we find that \(2S = k(k+1)\).
12
+ -/
13
+ -- Use induction on k to prove the statement for all natural numbers.
14
+ induction k with
15
+ | zero =>
16
+ -- Base case: when k = 0, the statement is trivially true.
17
+ simp
18
+ | succ k ih =>
19
+ -- Inductive step: assume the statement holds for k, prove it for k+1.
20
+ -- Simplify the expression using the induction hypothesis and algebraic manipulation.
21
+ simp_all [Nat.succ_eq_add_one, Nat.mul_add, Nat.add_mul, Nat.mul_one, Nat.mul_comm,
22
+ Nat.mul_left_comm]
23
+ -- Use the omega tactic to solve the resulting linear arithmetic problem.
24
+ omega
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10209.lean ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Calculate $ 1 + 2 + 3 + 4 + 5 $ -/
9
+ theorem lean_workbook_10209 : ∑ i in Finset.range 6, i = 15 := by
10
+ /-
11
+ To prove that the sum of the first five natural numbers is 15, we use the formula for the sum of the first \( n \) natural numbers, which is given by \( \frac{n(n+1)}{2} \). For \( n = 5 \), this formula yields:
12
+ \[
13
+ \frac{5 \cdot 6}{2} = \frac{30}{2} = 15
14
+ \]
15
+ Thus, the sum of the first five natural numbers is indeed 15.
16
+ -/
17
+ -- Use the formula for the sum of the first n natural numbers: ∑ i in Finset.range (n+1), i = n * (n + 1) / 2
18
+ rw [Finset.sum_range_succ]
19
+ -- Simplify the expression using numerical computation
20
+ norm_num
21
+ -- Verify that the simplified expression matches the expected result
22
+ <;> rfl
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_1021.lean ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Find the sequence $\{x_1, x_2, x_3, \ldots\}$ where $x_1=r$ and $x_k=2^{k-1} \cdot x_1$ for some real number $r$ -/
9
+ theorem lean_workbook_1021 (r : ℝ) (n : ℕ) : ∃ f : ℕ → ℝ, f 1 = r ∧ ∀ k, f k = (2 : ℝ)^(k-1) * f 1 := by
10
+ /-
11
+ We need to find a sequence \(\{x_1, x_2, x_3, \ldots\}\) where \(x_1 = r\) and \(x_k = 2^{k-1} \cdot x_1\) for some real number \(r\). To define such a sequence, we can use a function \(f : \mathbb{N} \to \mathbb{R}\) where \(f(k) = 2^{k-1} \cdot r\). This function clearly satisfies the given conditions:
12
+ 1. \(f(1) = r\)
13
+ 2. For all \(k\), \(f(k) = 2^{k-1} \cdot r\)
14
+ -/
15
+ -- We define the function f(k) = 2^(k-1) * r
16
+ use fun k => (2 : ℝ)^(k-1) * r
17
+ -- We need to prove two conditions: f(1) = r and f(k) = 2^(k-1) * f(1) for all k
18
+ constructor
19
+ -- First, we prove f(1) = r
20
+ -- By definition, f(1) = 2^(1-1) * r = 2^0 * r = 1 * r = r
21
+ simp
22
+ -- Second, we prove f(k) = 2^(k-1) * f(1) for all k
23
+ -- By definition, f(k) = 2^(k-1) * r
24
+ intro k
25
+ simp [mul_comm]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10218.lean ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- $(x^2+y^2+z^2)(1+1+1)\geq (x+y+z)^{2}$ -/
9
+ theorem lean_workbook_10218 (x y z : ℝ) : (x ^ 2 + y ^ 2 + z ^ 2) * (1 + 1 + 1) ≥ (x + y + z) ^ 2 := by
10
+ /-
11
+ We need to show that for real numbers \( x \), \( y \), and \( z \), the inequality \((x^2 + y^2 + z^2)(1 + 1 + 1) \geq (x + y + z)^2\) holds. This can be derived using the non-negativity of squares and basic algebraic manipulations.
12
+ -/
13
+ -- Use non-linear arithmetic to prove the inequality.
14
+ -- The `nlinarith` tactic will handle the proof by leveraging the non-negativity of squares.
15
+ -- Specifically, it will use the fact that the square of any real number is non-negative.
16
+ nlinarith [sq_nonneg (x - y), sq_nonneg (y - z), sq_nonneg (z - x),
17
+ sq_nonneg (x + y), sq_nonneg (y + z), sq_nonneg (z + x)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10222.lean ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Prove that $sin(x+y)sin(y+z)=sin(y)sin(x+y+z)+sin(z)sin(x)$ . -/
9
+ theorem lean_workbook_10222 : ∀ x y z : ℝ, sin (x + y) * sin (y + z) = sin y * sin (x + y + z) + sin z * sin x := by
10
+ /-
11
+ We aim to prove that for any real numbers \( x \), \( y \), and \( z \), the equation \( \sin(x + y) \sin(y + z) = \sin(y) \sin(x + y + z) + \sin(z) \sin(x) \) holds. We start by expanding the sine functions using the addition formulas. Specifically, we use the identities for the sine of a sum:
12
+ \[ \sin(a + b) = \sin a \cos b + \cos a \sin b \]
13
+ Applying these identities to \( \sin(x + y) \) and \( \sin(y + z) \), we get:
14
+ \[ \sin(x + y) = \sin x \cos y + \cos x \sin y \]
15
+ \[ \sin(y + z) = \sin y \cos z + \cos y \sin z \]
16
+ Multiplying these two expressions, we obtain:
17
+ \[ (\sin x \cos y + \cos x \sin y)(\sin y \cos z + \cos y \sin z) \]
18
+ Expanding this product, we have:
19
+ \[ \sin x \cos y \sin y \cos z + \sin x \cos y \cos y \sin z + \cos x \sin y \sin y \cos z + \cos x \sin y \cos y \sin z \]
20
+ Combining like terms, we get:
21
+ \[ \sin x \sin y \cos z + \sin x \cos y \sin z + \cos x \sin y \sin z + \cos x \cos y \sin z \]
22
+ Next, we use the addition formula for sine again:
23
+ \[ \sin(a + b) = \sin a \cos b + \cos a \sin b \]
24
+ Applying this to \( \sin(x + y + z) \), we get:
25
+ \[ \sin(x + y + z) = \sin(x + y) \cos z + \cos(x + y) \sin z \]
26
+ Expanding \( \sin(x + y) \) and \( \cos(x + y) \) using the addition formula, we have:
27
+ \[ \sin(x + y) = \sin x \cos y + \cos x \sin y \]
28
+ \[ \cos(x + y) = \cos x \cos y - \sin x \sin y \]
29
+ Thus,
30
+ \[ \sin(x + y + z) = (\sin x \cos y + \cos x \sin y) \cos z + (\cos x \cos y - \sin x \sin y) \sin z \]
31
+ Expanding this, we get:
32
+ \[ \sin(x + y + z) = \sin x \cos y \cos z + \cos x \sin y \cos z + \cos x \cos y \sin z - \sin x \sin y \sin z \]
33
+ Combining like terms, we have:
34
+ \[ \sin(x + y + z) = \sin x \cos y \cos z + \cos x \sin y \cos z + \cos x \cos y \sin z - \sin x \sin y \sin z \]
35
+ Finally, we observe that the terms involving \( \sin(x + y + z) \) and \( \sin(x + y) \sin(y + z) \) match the desired form, confirming the identity.
36
+ -/
37
+ intro x y z
38
+ -- Expand the sine functions using the addition formulas.
39
+ simp only [sin_add, cos_add, sin_add, cos_add, sin_add, cos_add, sin_add, cos_add, sin_add, cos_add]
40
+ -- Simplify the expression using algebraic manipulation.
41
+ ring
42
+ -- Use the Pythagorean identity for sine and cosine.
43
+ <;> simp only [sin_sq, cos_sq]
44
+ -- Simplify the expression further.
45
+ <;> ring
46
+ -- Simplify using trigonometric identities.
47
+ <;> simp only [sin_sq, cos_sq]
48
+ -- Final simplification to match the desired form.
49
+ <;> ring
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10230.lean ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- $M(M+2kc^2)(1-k^2) \leq (M+(k-k^2)c^2)^2,$ -/
9
+ theorem lean_workbook_10230 (M c k : ℝ) : M * (M + 2 * k * c ^ 2) * (1 - k ^ 2) ≤ (M + (k - k ^ 2) * c ^ 2) ^ 2 := by
10
+ /-
11
+ We need to show that for real numbers \( M \), \( c \), and \( k \), the inequality \( M(M + 2kc^2)(1 - k^2) \leq (M + (k - k^2)c^2)^2 \) holds. To prove this, we use the non-linear arithmetic (nlinarith) tactic, which simplifies the inequality by applying a series of algebraic manipulations and inequalities. Specifically, we use the fact that the square of any real number is non-negative, which helps in proving the inequality.
12
+ -/
13
+ -- Use non-linear arithmetic to simplify and prove the inequality.
14
+ -- We provide lemmas about the non-negativity of squares to help the tactic.
15
+ nlinarith [sq_nonneg (M + (k - k ^ 2) * c ^ 2), sq_nonneg (M - (k - k ^ 2) * c ^ 2),
16
+ sq_nonneg (M * k - (k - k ^ 2) * c ^ 2), sq_nonneg (M * k + (k - k ^ 2) * c ^ 2)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10236.lean ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Let $ a,b,c,d $ be reals such that $ a+b+c+d=4 $ and $a^2+b^2+c^2+d^2=18.$ Prove that $ |ab-cd|\leq 9$ -/
9
+ theorem lean_workbook_10236 (a b c d : ℝ) (h₁ : a + b + c + d = 4) (h₂ : a^2 + b^2 + c^2 + d^2 = 18) : |a * b - c * d| ≤ 9 := by
10
+ /-
11
+ Given real numbers \(a, b, c, d\) such that \(a + b + c + d = 4\) and \(a^2 + b^2 + c^2 + d^2 = 18\), we need to prove that \(|ab - cd| \leq 9\).
12
+ To prove this, we use the properties of squares and the non-negativity of real numbers. Specifically, we consider the expressions \((a - b)^2\), \((a + b)^2\), \((c - d)^2\), \((c + d)^2\), \((a - c)^2\), \((a + c)^2\), \((b - d)^2\), and \((b + d)^2\). By leveraging the non-negativity of these squares and the given conditions, we can derive the desired inequality.
13
+ -/
14
+ -- Use the non-negativity of squares to derive the inequality
15
+ have h₃ := sq_nonneg (a - b) -- The square of any real number is non-negative
16
+ have h₄ := sq_nonneg (a + b) -- The square of any real number is non-negative
17
+ have h₅ := sq_nonneg (c - d) -- The square of any real number is non-negative
18
+ have h₆ := sq_nonneg (c + d) -- The square of any real number is non-negative
19
+ have h₇ := sq_nonneg (a - c) -- The square of any real number is non-negative
20
+ have h₈ := sq_nonneg (a + c) -- The square of any real number is non-negative
21
+ have h₉ := sq_nonneg (b - d) -- The square of any real number is non-negative
22
+ have h₁₀ := sq_nonneg (b + d) -- The square of any real number is non-negative
23
+ -- Combine the non-negativity properties with the given conditions to derive the inequality
24
+ simp only [abs_le, sub_nonneg, sub_nonpos] at *
25
+ -- Use linear arithmetic to conclude the proof
26
+ constructor <;> nlinarith
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_1024.lean ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Solve the equation $\left \lfloor x \right \rfloor^3+2x^2=x^3+2\left \lfloor x\right \rfloor^2$ -/
9
+ theorem lean_workbook_1024 (x : ℝ) (hx : ∃ z : ℤ, x = z) : (Int.floor x)^3 + 2 * x^2 = x^3 + 2 * (Int.floor x)^2 := by
10
+ /-
11
+ Given the equation \(\left \lfloor x \right \rfloor^3 + 2x^2 = x^3 + 2\left \lfloor x \right \rfloor^2\), we need to show that this equation holds for any real number \(x\) such that \(x = z\) for some integer \(z\). The proof involves substituting \(x = z\) into the equation and verifying that both sides are equal.
12
+ -/
13
+ -- Substitute x = z into the equation
14
+ cases' hx with z hz
15
+ rw [hz]
16
+ -- Simplify the equation using the fact that x = z
17
+ simp [Int.floor_eq_iff, pow_three]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10246.lean ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- If $a,b,c$ are non-negative numbers such that $a^2+b^2+c^2=a+b+c$, then $ab+bc+ca \geq a^2b^2+b^2c^2+c^2a^2$. -/
9
+ theorem lean_workbook_10246 (a b c : ℝ) (ha : a ≥ 0) (hb : b ≥ 0) (hc : c ≥ 0) (hab : a + b + c = a^2 + b^2 + c^2) : a * b + b * c + c * a ≥ a^2 * b^2 + b^2 * c^2 + c^2 * a^2 := by
10
+ /-
11
+ Given non-negative real numbers \(a\), \(b\), and \(c\) such that \(a^2 + b^2 + c^2 = a + b + c\), we need to show that \(ab + bc + ca \geq a^2 b^2 + b^2 c^2 + c^2 a^2\).
12
+ To prove this, we use the non-negativity of squares. Specifically, we consider the squares of the differences \(a - b\), \(b - c\), and \(c - a\). Since these differences are non-negative, their squares are also non-negative. By expanding these squares and summing them up, we can derive the desired inequality.
13
+ -/
14
+ -- Use non-linear arithmetic to prove the inequality.
15
+ -- We use the non-negativity of squares of differences (a - b), (b - c), and (c - a).
16
+ nlinarith [sq_nonneg (a - b), sq_nonneg (b - c), sq_nonneg (c - a),
17
+ mul_nonneg ha hb, mul_nonneg hb hc, mul_nonneg hc ha,
18
+ sq_nonneg (a - 1), sq_nonneg (b - 1), sq_nonneg (c - 1)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10253.lean ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- We can rewrite the inequality and use Cauchy-Schwarz to give $LHS \ge (a^2+2)(b^2+2)(c^2+2) \ge $ $\ge 3\left[\frac{(a+b)^2}{2}+1\right] (2+c^2) \ge 3(a+b+c)^2 \ge 9(ab+bc+ca)$ -/
9
+ theorem lean_workbook_10253 (a b c : ℝ) :
10
+ (a^2 + 2) * (b^2 + 2) * (c^2 + 2) ≥ 9 * (a * b + b * c + c * a) := by
11
+ /-
12
+ We need to show that for real numbers \(a\), \(b\), and \(c\), the inequality \((a^2 + 2)(b^2 + 2)(c^2 + 2) \geq 9(a b + b c + c a)\) holds. This can be derived using the non-negativity of squares and basic algebraic manipulations. Specifically, we will expand the left-hand side and compare it with the right-hand side. By leveraging the non-negativity of squares, we can establish the inequality.
13
+ -/
14
+ -- Expand the left-hand side of the inequality to compare it with the right-hand side.
15
+ ring_nf
16
+ -- Use the non-negativity of squares to establish the inequality.
17
+ -- Specifically, we use the fact that the square of any real number is non-negative.
18
+ nlinarith [sq_nonneg (a * b * c), sq_nonneg (a + b + c), sq_nonneg (a - b), sq_nonneg (b - c),
19
+ sq_nonneg (c - a), sq_nonneg (a * b + b * c + c * a - 3), sq_nonneg (a * b * c - 1),
20
+ sq_nonneg (a * b * c - a), sq_nonneg (a * b * c - b), sq_nonneg (a * b * c - c)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10255.lean ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Let $P(x,y)$ , the assertion $f((x-y)^{2})=x^{2}-2yf(x)+(f(x))^{2}$ Setting $g(x)=f(x)-x$ , the assertion becomes : $g((x-y)^{2})=(g(y))^{2}+2y(g(y)-g(x))$ Hence : $P(x,x)$ : $(g(x))^{2}=g(0) \forall x \in \mathbb{R}$ , which means that the fonction $g$ is constant i.e : there exists a real $a$ such that $g(x)=a$ , which means that the function $f$ is in the form : $f(x)=x+a$ . A check forward give us $a=0$ or $a=1$ And surely the fonctions $f(x)=x$ and $f(x)=x+1$ satisfy the FE. -/
9
+ theorem lean_workbook_10255 (f : ℝ → ℝ)
10
+ (h₀ : ∀ x, ∀ y, f ((x - y)^2) = x^2 - 2 * y * f x + (f x)^2) :
11
+ ∀ x, f x = x ∨ ∀ x, f x = x + 1 := by
12
+ /-
13
+ Given the function \( f : \mathbb{R} \to \mathbb{R} \) and the property \( \forall x, \forall y, f((x - y)^2) = x^2 - 2y f(x) + (f(x))^2 \), we introduce a new function \( g(x) = f(x) - x \). The given property then transforms into:
14
+ \[ g((x - y)^2) = (g(y))^2 + 2y(g(y) - g(x)) \]
15
+ From this, we derive:
16
+ \[ P(x, x) : (g(x))^2 = g(0) \]
17
+ This implies that \( g \) is a constant function. Therefore, there exists a real number \( a \) such that \( g(x) = a \) for all \( x \in \mathbb{R} \). Consequently, \( f(x) = x + a \) for some constant \( a \). We then check that \( a = 0 \) or \( a = 1 \).
18
+ -/
19
+ intro x
20
+ have h₁ := h₀ 0 0
21
+ have h₂ := h₀ x 0
22
+ have h₃ := h₀ x x
23
+ have h₄ := h₀ 1 1
24
+ simp at h₁ h₂ h₃ h₄
25
+ have h₅ := h₀ 1 0
26
+ have h₆ := h₀ 0 1
27
+ simp at h₅ h₆
28
+ nlinarith
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10290.lean ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Prove that $(a-1)^2(85a^4-294a^3+506a^2-438a+213)\geq0$. -/
9
+ theorem lean_workbook_10290 (a : ℝ) : (a - 1) ^ 2 * (85 * a ^ 4 - 294 * a ^ 3 + 506 * a ^ 2 - 438 * a + 213) ≥ 0 := by
10
+ /-
11
+ To prove that \((a-1)^2(85a^4-294a^3+506a^2-438a+213) \geq 0\), we can use the properties of non-negative numbers. Specifically, we note that \((a-1)^2\) is always non-negative because it is a square of a real number. Additionally, the polynomial \(85a^4 - 294a^3 + 506a^2 - 438a + 213\) is non-negative for all real numbers \(a\). Therefore, the product of a non-negative number \((a-1)^2\) and a non-negative polynomial \(85a^4 - 294a^3 + 506a^2 - 438a + 213\) is also non-negative.
12
+ -/
13
+ -- Use the property that the product of a non-negative number and a non-negative polynomial is non-negative.
14
+ apply mul_nonneg
15
+ -- Show that \((a-1)^2\) is non-negative because it is a square.
16
+ exact pow_two_nonneg (a - 1)
17
+ -- Show that the polynomial \(85a^4 - 294a^3 + 506a^2 - 438a + 213\) is non-negative for all real numbers \(a\).
18
+ nlinarith [sq_nonneg (a ^ 2 - a), sq_nonneg (a ^ 2 - 1), sq_nonneg (a - 1), sq_nonneg (a ^ 2 - 2 * a), sq_nonneg (a ^ 2 - 3 * a), sq_nonneg (a ^ 2 - 4 * a), sq_nonneg (a ^ 2 - 5 * a), sq_nonneg (a ^ 2 - 6 * a), sq_nonneg (a ^ 2 - 7 * a), sq_nonneg (a ^ 2 - 8 * a), sq_nonneg (a ^ 2 - 9 * a), sq_nonneg (a ^ 2 - 10 * a)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10291.lean ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- For non-negative real numbers x, y and z with $x+y+z=1$ , prove that $7(xy+yz+zx) \le 2+9xyz$ . -/
9
+ theorem lean_workbook_10291 (x y z : ℝ) (hx : 0 ≤ x) (hy : 0 ≤ y) (hz : 0 ≤ z) (h : x + y + z = 1) :
10
+ 7 * (x * y + y * z + z * x) ≤ 2 + 9 * x * y * z := by
11
+ /-
12
+ We need to prove that for non-negative real numbers \( x \), \( y \), and \( z \) with \( x + y + z = 1 \), the inequality \( 7(xy + yz + zx) \leq 2 + 9xyz \) holds. This can be shown using non-linear arithmetic (nlinarith) which takes into account the non-negativity of squares and other algebraic properties to verify the inequality.
13
+ -/
14
+ -- Use non-linear arithmetic to handle the inequality, considering the non-negativity of squares and other algebraic properties.
15
+ nlinarith [sq_nonneg (x + y + z), sq_nonneg (x - y), sq_nonneg (y - z), sq_nonneg (z - x),
16
+ sq_nonneg (x - 1 / 3), sq_nonneg (y - 1 / 3), sq_nonneg (z - 1 / 3)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10295.lean ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Let $ a,b,c$ are positive real number such that $a+b+c=3$ , prove that $\frac{1}{11+a^{2}}+\frac{1}{11+b^{2}}+\frac{1}{11+c^{2}}\leqslant \frac{1}{4}.$ -/
9
+ theorem lean_workbook_10295 (a b c : ℝ) (ha : 0 < a) (hb : 0 < b) (hc : 0 < c) (habc : a + b + c = 3) : 1 / (11 + a^2) + 1 / (11 + b^2) + 1 / (11 + c^2) ≤ 1 / 4 := by
10
+ /-
11
+ We need to prove that for positive real numbers \(a\), \(b\), and \(c\) such that \(a + b + c = 3\), the inequality \(\frac{1}{11 + a^2} + \frac{1}{11 + b^2} + \frac{1}{11 + c^2} \leq \frac{1}{4}\) holds.
12
+ To do this, we will show that the sum of the reciprocals of the expressions involving \(a\), \(b\), and \(c\) is less than or equal to \(\frac{1}{4}\). We will use algebraic manipulation and basic properties of inequalities to achieve this.
13
+ -/
14
+ have h₁ : 0 < a * b * c := by
15
+ -- Since a, b, and c are positive, their product is also positive.
16
+ exact mul_pos (mul_pos ha hb) hc
17
+ have h₂ : a * b * c ≤ 1 := by
18
+ -- Using the fact that a + b + c = 3, we can apply basic inequalities to show that a * b * c ≤ 1.
19
+ nlinarith [sq_nonneg (a + b + c), sq_nonneg (a - b), sq_nonneg (b - c), sq_nonneg (c - a)]
20
+ have h₃ : 1 / (11 + a^2) + 1 / (11 + b^2) + 1 / (11 + c^2) ≤ 1 / 4 := by
21
+ -- Using the fact that a * b * c ≤ 1, we can apply basic inequalities to show the desired result.
22
+ field_simp
23
+ rw [div_le_div_iff]
24
+ nlinarith [sq_nonneg (a + b + c), sq_nonneg (a - b), sq_nonneg (b - c), sq_nonneg (c - a)]
25
+ nlinarith [sq_nonneg (a + b + c), sq_nonneg (a - b), sq_nonneg (b - c), sq_nonneg (c - a)]
26
+ nlinarith [sq_nonneg (a + b + c), sq_nonneg (a - b), sq_nonneg (b - c), sq_nonneg (c - a)]
27
+ -- The final inequality follows from the above steps.
28
+ exact h₃
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10299.lean ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Let $x,y>0$ ,prove that: $\frac{4}{3}\frac{1}{x+y}+\frac{y^2}{2x+y}+\frac{x^2}{2y+x} \geq \frac{4}{3}$ -/
9
+ theorem lean_workbook_10299 (x y : ℝ) (hx : 0 < x) (hy : 0 < y) : (4 / 3) * (1 / (x + y)) + y^2 / (2 * x + y) + x^2 / (2 * y + x) >= 4 / 3 := by
10
+ /-
11
+ To prove the inequality \(\frac{4}{3}\frac{1}{x+y}+\frac{y^2}{2x+y}+\frac{x^2}{2y+x} \geq \frac{4}{3}\) for \(x, y > 0\), we proceed as follows:
12
+ 1. **Simplify the expression**: We start by simplifying the given expression using algebraic manipulations.
13
+ 2. **Apply inequalities**: We use known inequalities and properties of real numbers to show that the simplified expression is greater than or equal to \(\frac{4}{3}\).
14
+ -/
15
+ -- Simplify the expression by clearing denominators and rearranging terms.
16
+ field_simp [add_comm, add_left_comm, add_assoc]
17
+ -- Use the fact that all terms are positive to apply the inequality.
18
+ rw [div_le_div_iff]
19
+ -- Use non-linear arithmetic to prove the inequality.
20
+ nlinarith [sq_nonneg (x - y), mul_pos hx hy, sq_nonneg (x - 1), sq_nonneg (y - 1)]
21
+ -- Additional non-linear arithmetic to handle different cases.
22
+ nlinarith [sq_nonneg (x - y), mul_pos hx hy, sq_nonneg (x - 1), sq_nonneg (y - 1)]
23
+ nlinarith [sq_nonneg (x - y), mul_pos hx hy, sq_nonneg (x - 1), sq_nonneg (y - 1)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10303.lean ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- For $ a,b,c\geq 0$ prove that $8+2(a^2+b^2+c^2)+abc\geq 5(a+b+c) $ . -/
9
+ theorem lean_workbook_10303 (a b c : ℝ) (ha : a ≥ 0) (hb : b ≥ 0) (hc : c ≥ 0) : 8 + 2 * (a ^ 2 + b ^ 2 + c ^ 2) + a * b * c ≥ 5 * (a + b + c) := by
10
+ /-
11
+ We need to prove that for non-negative real numbers \(a\), \(b\), and \(c\), the inequality \(8 + 2(a^2 + b^2 + c^2) + abc \geq 5(a + b + c)\) holds. This can be shown using non-linear arithmetic by considering the non-negativity of squares and other expressions.
12
+ -/
13
+ -- Use non-linear arithmetic to prove the inequality by considering the non-negativity of squares and other expressions.
14
+ nlinarith [sq_nonneg (a + b + c - 3), sq_nonneg (a - 1), sq_nonneg (b - 1), sq_nonneg (c - 1),
15
+ mul_nonneg ha hb, mul_nonneg hb hc, mul_nonneg hc ha, sq_nonneg (a - b), sq_nonneg (b - c),
16
+ sq_nonneg (c - a), sq_nonneg (a * b - 1), sq_nonneg (b * c - 1), sq_nonneg (c * a - 1)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10305.lean ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Squaring both sides for $t>1$ we get after simplification: $2t\sqrt{t+8}>7t-8$. -/
9
+ theorem lean_workbook_10305 : ∀ t : ℝ, 1 < t → 2 * t * Real.sqrt (t + 8) > 7 * t - 8 := by
10
+ /-
11
+ For any real number \( t \) greater than 1, we need to show that \( 2t\sqrt{t+8} > 7t - 8 \). We start by noting that since \( t > 1 \), \( t + 8 > 0 \), ensuring that the square root is defined and positive. We then square both sides of the inequality to eliminate the square root. After simplifying, we use algebraic manipulation and properties of inequalities to show that the inequality holds.
12
+ -/
13
+ -- Introduce the variable t and the assumption t > 1.
14
+ intro t h
15
+ -- Show that t + 8 > 0 since t > 1.
16
+ have h₀ : 0 < t + 8 := by linarith
17
+ -- Use the property that the square root of a positive number is positive.
18
+ have h₁ : 0 < Real.sqrt (t + 8) := Real.sqrt_pos.2 h₀
19
+ -- Square both sides of the inequality to eliminate the square root.
20
+ nlinarith [sq_sqrt (by linarith : 0 ≤ t + 8), sq_nonneg (t - 4)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10307.lean ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Find the maximum and minimum of $ A=x^2+y^2+z^2+kxyz $, where $ x, y, z $ are non-negative numbers satisfying $ x+y+z=1 $, for all $ k \in R $. -/
9
+ theorem lean_workbook_10307 (x y z k : ℝ) (hx : 0 ≤ x) (hy : 0 ≤ y) (hz : 0 ≤ z) (hx1 : x + y + z = 1) : (x^2 + y^2 + z^2 + k * x * y * z) ≤ 1 + k/27 ∨ (x^2 + y^2 + z^2 + k * x * y * z) ≥ 1 + k/27 := by
10
+ /-
11
+ To find the maximum and minimum of \( A = x^2 + y^2 + z^2 + kxyz \) where \( x, y, z \) are non-negative numbers satisfying \( x + y + z = 1 \), we need to consider the constraints and the expression itself. The expression \( A \) can be analyzed by considering the non-negativity of the terms and their combinations. Specifically, we can use the fact that the sum \( x + y + z = 1 \) to bound the expression. By applying non-linear arithmetic, we can derive the necessary inequalities to determine the bounds of \( A \).
12
+ -/
13
+ -- We use non-linear arithmetic to derive the necessary inequalities.
14
+ by_cases h : x^2 + y^2 + z^2 + k * x * y * z ≤ 1 + k/27
15
+ -- If the inequality holds, we consider the case where the expression is less than or equal to 1 + k/27.
16
+ { left; linarith }
17
+ -- If the inequality does not hold, we consider the case where the expression is greater than or equal to 1 + k/27.
18
+ { right; linarith }
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10308.lean ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Prove that $a^2+b^2+c^2+4+36a^2b^2c^2\ge 19abc(a+b+c)$ given $a,b,c>0$ and $ab+bc+ca=1$. -/
9
+ theorem lean_workbook_10308 (a b c : ℝ) (hab : a > 0 ∧ b > 0 ∧ c > 0) (h : a * b + b * c + c * a = 1) : a ^ 2 + b ^ 2 + c ^ 2 + 4 + 36 * a ^ 2 * b ^ 2 * c ^ 2 ≥ 19 * a * b * c * (a + b + c) := by
10
+ /-
11
+ Given \(a, b, c > 0\) and \(ab + bc + ca = 1\), we need to prove that:
12
+ \[ a^2 + b^2 + c^2 + 4 + 36a^2b^2c^2 \ge 19abc(a + b + c). \]
13
+ We use the non-linear arithmetic (nlinarith) tactic, which automatically handles inequalities involving squares and products of real numbers. The tactic checks the non-negativity of various squared terms and combines them to derive the desired inequality.
14
+ -/
15
+ -- Use nlinarith to handle the non-linear arithmetic inequality.
16
+ -- We provide several non-negative terms to help nlinarith derive the inequality.
17
+ nlinarith [sq_nonneg (a + b + c), sq_nonneg (a - b), sq_nonneg (b - c), sq_nonneg (c - a),
18
+ mul_pos hab.1 hab.2.1, mul_pos hab.2.1 hab.2.2, mul_pos hab.2.2 hab.1,
19
+ sq_nonneg (a * b - 1 / 3), sq_nonneg (b * c - 1 / 3), sq_nonneg (c * a - 1 / 3),
20
+ sq_nonneg (a * b + b * c + c * a - 1)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10309.lean ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- it's $ 3a^{2}-12a\leq0 ,0\leq a\leq4 $ -/
9
+ theorem lean_workbook_10309 (a : ℝ) (h₁ : 3 * a ^ 2 - 12 * a ≤ 0) (h₂ : 0 ≤ a) (h₃ : a ≤ 4) : 0 ≤ a ∧ a ≤ 4 := by
10
+ /-
11
+ Given the inequalities \(3a^2 - 12a \leq 0\), \(0 \leq a\), and \(a \leq 4\), we need to show that \(0 \leq a \leq 4\).
12
+ 1. From \(3a^2 - 12a \leq 0\), we can factorize it as \(3a(a - 4) \leq 0\).
13
+ 2. Since \(0 \leq a\), we know that \(a\) is non-negative.
14
+ 3. Combining \(3a(a - 4) \leq 0\) with \(0 \leq a\), we deduce that \(a\) must be less than or equal to 4.
15
+ Thus, combining these results, we conclude that \(0 \leq a \leq 4\).
16
+ -/
17
+ -- We need to show that 0 ≤ a and a ≤ 4.
18
+ refine' ⟨h₂, _⟩
19
+ -- We already know 0 ≤ a from h₂.
20
+ -- Now, we need to show a ≤ 4.
21
+ -- From h₁: 3a^2 - 12a ≤ 0, we can factorize it as 3a(a - 4) ≤ 0.
22
+ -- Since 0 ≤ a, we know a is non-negative.
23
+ -- Combining 3a(a - 4) ≤ 0 with 0 ≤ a, we deduce a ≤ 4.
24
+ nlinarith
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10314.lean ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Prove that $3^n \ge 2n + 1$ for $n \in \mathbb{Z^+}$ -/
9
+ theorem lean_workbook_10314 (n : ℕ) : 3^n ≥ 2*n + 1 := by
10
+ /-
11
+ We aim to prove that for any positive integer \( n \), \( 3^n \geq 2n + 1 \). We will use mathematical induction to establish this result.
12
+ 1. **Base Case**: When \( n = 1 \), we need to show that \( 3^1 \geq 2 \cdot 1 + 1 \). This simplifies to \( 3 \geq 3 \), which is true.
13
+ 2. **Inductive Step**: Assume that the statement holds for some positive integer \( n \), i.e., \( 3^n \geq 2n + 1 \). We need to show that the statement holds for \( n + 1 \), i.e., \( 3^{n+1} \geq 2(n + 1) + 1 \).
14
+ Starting from \( 3^{n+1} = 3 \cdot 3^n \), we can use the inductive hypothesis \( 3^n \geq 2n + 1 \) to get:
15
+ \[
16
+ 3^{n+1} = 3 \cdot 3^n \geq 3 \cdot (2n + 1) = 6n + 3
17
+ \]
18
+ We need to show that \( 6n + 3 \geq 2(n + 1) + 1 = 2n + 3 \). This inequality simplifies to \( 6n + 3 \geq 2n + 3 \), which is equivalent to \( 4n \geq 0 \). Since \( n \) is a positive integer, \( 4n \geq 0 \) is always true.
19
+ Thus, by mathematical induction, we have shown that \( 3^n \geq 2n + 1 \) for all positive integers \( n \).
20
+ -/
21
+ induction n with
22
+ | zero =>
23
+ -- Base case: when n = 0, we need to show 3^0 ≥ 2*0 + 1
24
+ -- This simplifies to 1 ≥ 1, which is true.
25
+ simp
26
+ | succ n hn =>
27
+ -- Inductive step: assume the statement holds for n, i.e., 3^n ≥ 2n + 1
28
+ -- We need to show it holds for n + 1, i.e., 3^(n+1) ≥ 2(n + 1) + 1
29
+ simp_all [Nat.pow_succ, Nat.mul_succ]
30
+ -- Simplify the expression to 3^(n+1) = 3 * 3^n ≥ 3 * (2n + 1) = 6n + 3
31
+ -- We need to show 6n + 3 ≥ 2n + 3, which simplifies to 4n ≥ 0, always true for positive n
32
+ nlinarith
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10319.lean ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Prove that $\left(x^2-yz-1\right)^2+\left(y^2-zx-1\right)^2+\left(z^2-xy-1\right)^2\ge0$ -/
9
+ theorem lean_workbook_10319 (x y z : ℝ) : (x^2 - y * z - 1)^2 + (y^2 - z * x - 1)^2 + (z^2 - x * y - 1)^2 ≥ 0 := by
10
+ /-
11
+ We need to prove that for any real numbers \( x \), \( y \), and \( z \), the expression \(\left(x^2 - yz - 1\right)^2 + \left(y^2 - zx - 1\right)^2 + \left(z^2 - xy - 1\right)^2\) is non-negative. This can be shown by demonstrating that each term in the sum is a square of a real number, hence non-negative, and their sum is therefore non-negative.
12
+ -/
13
+ -- Apply the fact that the sum of non-negative numbers is non-negative.
14
+ apply le_of_sub_nonneg
15
+ -- Use non-linear arithmetic to show that the expression is non-negative.
16
+ -- Each term (x^2 - y * z - 1)^2, (y^2 - z * x - 1)^2, and (z^2 - x * y - 1)^2 is a square, hence non-negative.
17
+ nlinarith [sq_nonneg (x^2 - y * z - 1), sq_nonneg (y^2 - z * x - 1), sq_nonneg (z^2 - x * y - 1),
18
+ sq_nonneg (x^2 - y * z), sq_nonneg (y^2 - z * x), sq_nonneg (z^2 - x * y),
19
+ sq_nonneg (x^2 - 1), sq_nonneg (y^2 - 1), sq_nonneg (z^2 - 1)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_1032.lean ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- By Vasc's inequality we have \n $\frac53(a^2+b^2+c^2)^2 \ge 2\sum a^3b+3\sum ab^3$ -/
9
+ theorem lean_workbook_1032 (a b c : ℝ) : (5 / 3) * (a ^ 2 + b ^ 2 + c ^ 2) ^ 2 ≥ 2 * (a ^ 3 * b + b ^ 3 * c + c ^ 3 * a) + 3 * (a * b ^ 3 + b * c ^ 3 + c * a ^ 3) := by
10
+ /-
11
+ We need to show that for real numbers \(a\), \(b\), and \(c\), the inequality \(\frac{5}{3}(a^2 + b^2 + c^2)^2 \geq 2(a^3b + b^3c + c^3a) + 3(ab^3 + bc^3 + ca^3)\) holds. This can be verified using non-linear arithmetic (nlinarith) by considering the non-negativity of squares and applying basic algebraic inequalities.
12
+ -/
13
+ -- Use non-linear arithmetic to verify the inequality by considering the non-negativity of squares and applying basic algebraic inequalities.
14
+ nlinarith [sq_nonneg (a + b + c), sq_nonneg (a - b), sq_nonneg (b - c), sq_nonneg (c - a),
15
+ sq_nonneg (a - b + c), sq_nonneg (b - c + a), sq_nonneg (c - a + b)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10328.lean ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Prove $4a^3-9a^2+9a+4\geqq 0$ for $a \geq 1$. -/
9
+ theorem lean_workbook_10328 (a : ℝ) (h : a ≥ 1) : 4 * a ^ 3 - 9 * a ^ 2 + 9 * a + 4 ≥ 0 := by
10
+ /-
11
+ To prove that \(4a^3 - 9a^2 + 9a + 4 \geq 0\) for \(a \geq 1\), we can use the non-linear arithmetic (nlinarith) tactic in Lean4. This tactic is designed to handle inequalities involving polynomials and other non-linear expressions. By providing specific squares that are non-negative, we can establish the desired inequality.
12
+ -/
13
+ -- Use nlinarith to handle the inequality. We provide specific non-negative expressions to help nlinarith prove the inequality.
14
+ nlinarith [sq_nonneg (a - 1), sq_nonneg (a - 2 / 3), sq_nonneg (a - 1 / 3),
15
+ sq_nonneg (a + 1 / 3), sq_nonneg (a + 2 / 3)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10329.lean ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- $$2 | \binom{n}{2} \implies 4 | n(n-1) \implies n \equiv 0, 1 \mod 4.$$ -/
9
+ theorem lean_workbook_10329 : ∀ n : ℕ, 2 ∣ n.choose 2 → 4 ∣ n * (n - 1) → n ≡ 0 [ZMOD 4] ∨ n ≡ 1 [ZMOD 4] := by
10
+ /-
11
+ For any natural number \( n \), if \( 2 \) divides \( \binom{n}{2} \) and \( 4 \) divides \( n(n-1) \), then \( n \equiv 0 \mod 4 \) or \( n \equiv 1 \mod 4 \).
12
+ 1. **Assumption and Setup**:
13
+ - \( 2 \) divides \( \binom{n}{2} \) implies \( n \equiv 0 \mod 2 \) or \( n \equiv 1 \mod 2 \).
14
+ - \( 4 \) divides \( n(n-1) \) implies \( n \equiv 0 \mod 4 \) or \( n \equiv 1 \mod 4 \).
15
+ 2. **Case Analysis**:
16
+ - If \( n \equiv 0 \mod 2 \), then \( n = 2k \) for some integer \( k \).
17
+ - If \( n \equiv 1 \mod 2 \), then \( n = 2k + 1 \) for some integer \( k \).
18
+ - Similarly, for \( 4 \), we consider \( n \equiv 0 \mod 4 \) or \( n \equiv 1 \mod 4 \).
19
+ 3. **Verification**:
20
+ - Check the conditions under which \( n \equiv 0 \mod 4 \) and \( n \equiv 1 \mod 4 \).
21
+ 4. **Conclusion**:
22
+ - By analyzing the conditions, we conclude that \( n \equiv 0 \mod 4 \) or \( n \equiv 1 \mod 4 \).
23
+ -/
24
+ intro n h₀ h₁
25
+ -- Normalize the expressions involving divisibility and modular arithmetic.
26
+ norm_num [Nat.choose_two_right, Nat.dvd_iff_mod_eq_zero, Int.ModEq] at h₀ h₁ ⊢
27
+ -- Perform case analysis on the possible values of n modulo 4.
28
+ have h₂ : n % 4 = 0 ∨ n % 4 = 1 ∨ n % 4 = 2 ∨ n % 4 = 3 := by omega
29
+ rcases h₂ with (h₂ | h₂ | h₂ | h₂) <;> simp [h₂, Nat.mul_mod, Nat.add_mod, Nat.mod_mod] at h₀ h₁ ⊢
30
+ -- Use omega to solve the resulting equations and conclude the proof.
31
+ <;> omega
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10331.lean ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- We just have to prove that $6(a^2+b^2) \ge (3a^2+3b^2+(a+b)^2+2ab)$ which is equivalent to $2a^2+2b^2 \ge 4ab$ which is true. -/
9
+ theorem lean_workbook_10331 (a b : ℝ) :
10
+ 2 * a^2 + 2 * b^2 ≥ 4 * a * b := by
11
+ /-
12
+ To prove the inequality \(6(a^2 + b^2) \ge 3a^2 + 3b^2 + (a + b)^2 + 2ab\), we start by simplifying the inequality. We can rewrite the inequality as \(2a^2 + 2b^2 \ge 4ab\). This inequality is equivalent to \((a - b)^2 \ge 0\), which is always true since the square of any real number is non-negative.
13
+ -/
14
+ -- We start by proving a simpler inequality equivalent to the original.
15
+ have h : 0 ≤ (a - b)^2 := by
16
+ -- The square of any real number is non-negative.
17
+ apply sq_nonneg
18
+ -- Using the non-negativity of (a - b)^2, we can conclude the original inequality.
19
+ linarith [sq_nonneg (a - b)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10337.lean ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- If $a,b$ are both odd then $a^2+b^2+c^2 \equiv 2,3 \pmod {4}$ -/
9
+ theorem lean_workbook_10337 {a b c : ℤ} (ha : Odd a) (hb : Odd b) : (a^2 + b^2 + c^2) % 4 = 2 ∨ (a^2 + b^2 + c^2) % 4 = 3 := by
10
+ /-
11
+ Given that \(a\) and \(b\) are both odd integers, we need to show that \(a^2 + b^2 + c^2\) modulo 4 is either 2 or 3.
12
+ 1. Since \(a\) is odd, \(a\) modulo 4 can be either 1 or 3. This is because any odd integer can be written in the form \(2k + 1\) or \(2k + 3\), and modulo 4, these expressions simplify to 1 and 3 respectively.
13
+ 2. Similarly, since \(b\) is odd, \(b\) modulo 4 can also be either 1 or 3.
14
+ 3. For any integer \(c\), \(c\) modulo 4 can be 0, 1, 2, or 3.
15
+ 4. We consider all combinations of these residues and compute \(a^2 + b^2 + c^2\) modulo 4. We find that in all cases, the result is either 2 or 3.
16
+ -/
17
+ -- Since a is odd, a modulo 4 can be either 1 or 3.
18
+ have h₀ : a % 4 = 1 ∨ a % 4 = 3 := by
19
+ cases' ha with k hk
20
+ omega
21
+ -- Since b is odd, b modulo 4 can be either 1 or 3.
22
+ have h₁ : b % 4 = 1 ∨ b % 4 = 3 := by
23
+ cases' hb with k hk
24
+ omega
25
+ -- For any integer c, c modulo 4 can be 0, 1, 2, or 3.
26
+ have h₂ : c % 4 = 0 ∨ c % 4 = 1 ∨ c % 4 = 2 ∨ c % 4 = 3 := by
27
+ omega
28
+ -- Consider all combinations of these residues and compute a^2 + b^2 + c^2 modulo 4.
29
+ rcases h₀ with (h₀ | h₀) <;> rcases h₁ with (h₁ | h₁) <;> rcases h₂ with (h₂ | h₂ | h₂ | h₂) <;>
30
+ simp [h₀, h₁, h₂, pow_two, Int.add_emod, Int.mul_emod, Int.emod_emod]
31
+ <;> omega
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_1034.lean ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Let $x,y,z\ge0$ such that $x+y+z\le1,$ prove that $x^2+y^2+z^2-(xy)^2-(yz)^2-(zx)^2+2(xyz)^2\le1.$ -/
9
+ theorem lean_workbook_1034 : ∀ x y z : ℝ, x ≥ 0 ∧ y ≥ 0 ∧ z ≥ 0 ∧ x + y + z ≤ 1 → x ^ 2 + y ^ 2 + z ^ 2 - x * y ^ 2 - y * z ^ 2 - z * x ^ 2 + 2 * x * y * z ≤ 1 := by
10
+ /-
11
+ Given \( x, y, z \ge 0 \) such that \( x + y + z \le 1 \), we need to prove that:
12
+ \[ x^2 + y^2 + z^2 - xy^2 - yz^2 - zx^2 + 2xyz \le 1. \]
13
+ To prove this, we use the non-linear arithmetic (nlinarith) tactic, which automatically handles inequalities involving polynomials. We provide specific non-negativity conditions to ensure that the terms involved in the inequality are valid.
14
+ -/
15
+ -- Introduce the variables x, y, z and the hypothesis h
16
+ intro x y z h
17
+ -- Use the nlinarith tactic to handle the inequality
18
+ nlinarith [sq_nonneg (x - y), sq_nonneg (y - z), sq_nonneg (z - x),
19
+ mul_nonneg h.1 h.2.1, mul_nonneg h.2.1 h.2.2.1, mul_nonneg h.2.2.1 h.1,
20
+ mul_nonneg (sq_nonneg x) (sq_nonneg y), mul_nonneg (sq_nonneg y) (sq_nonneg z),
21
+ mul_nonneg (sq_nonneg z) (sq_nonneg x), mul_self_nonneg (x - y + z),
22
+ mul_self_nonneg (y - z + x), mul_self_nonneg (z - x + y)]
external/kimina-lean-server/tests/match/input/goedel-lean_workbook_10342.lean ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+ import Aesop
3
+
4
+ set_option maxHeartbeats 0
5
+
6
+ open BigOperators Real Nat Topology Rat
7
+
8
+ /- Claim 2. Let $x,y$ be nonnegative reals. Then\n\n $$\frac{1}{2x+1}+\frac{1}{2y+1}\ge\frac{2}{xy+2}.$$ -/
9
+ theorem lean_workbook_10342 (x y : ℝ) (hx : 0 ≤ x) (hy : 0 ≤ y) : (1 / (2 * x + 1) + 1 / (2 * y + 1)) ≥ 2 / (x * y + 2) := by
10
+ /-
11
+ To prove the inequality \(\frac{1}{2x+1}+\frac{1}{2y+1}\ge\frac{2}{xy+2}\) for nonnegative reals \(x\) and \(y\), we proceed as follows:
12
+ 1. **Simplify the left-hand side**: Combine the fractions \(\frac{1}{2x+1}\) and \(\frac{1}{2y+1}\) over a common denominator.
13
+ 2. **Simplify the right-hand side**: Combine the fractions over a common denominator.
14
+ 3. **Use algebraic manipulation**: Apply algebraic identities and inequalities to show that the left-hand side is greater than or equal to the right-hand side.
15
+ 4. **Apply inequalities**: Use known inequalities such as the AM-GM inequality to establish the desired result.
16
+ -/
17
+ -- Combine the fractions on the left-hand side over a common denominator.
18
+ have h₀ : 0 ≤ x * y := mul_nonneg hx hy
19
+ have h₁ : 0 ≤ x * y + 2 := by nlinarith
20
+ have h₂ : 0 ≤ 2 * x + 1 := by nlinarith
21
+ have h₃ : 0 ≤ 2 * y + 1 := by nlinarith
22
+ field_simp
23
+ rw [div_le_div_iff] <;>
24
+ nlinarith [sq_nonneg (x - y), sq_nonneg (x + y), sq_nonneg (x * y - 1), sq_nonneg (x * y + 1)]