declaration
stringlengths 27
11.3k
| file
stringlengths 52
114
| context
dict | tactic_states
listlengths 1
1.24k
|
|---|---|---|---|
example (n m k : ℕ) : n * (m - k) = n * m - n * k := by
apply?
|
/root/DuelModelResearch/mathlib4/MathlibTest/LibrarySearch/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "apply?",
"before_state": "n m k : ℕ\n⊢ n * (m - k) = n * m - n * k",
"after_state": "No Goals!"
},
{
"line": "exact Nat.mul_sub_left_distrib n m k",
"before_state": "n m k : ℕ\n⊢ n * (m - k) = n * m - n * k",
"after_state": "No Goals!"
}
] |
example (n m k : ℕ) : n * m - n * k = n * (m - k) := by
apply?
|
/root/DuelModelResearch/mathlib4/MathlibTest/LibrarySearch/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "apply?",
"before_state": "n m k : ℕ\n⊢ n * m - n * k = n * (m - k)",
"after_state": "No Goals!"
},
{
"line": "exact Eq.symm (Nat.mul_sub_left_distrib n m k)",
"before_state": "n m k : ℕ\n⊢ n * m - n * k = n * (m - k)",
"after_state": "No Goals!"
}
] |
example {α : Type} (x y : α) : x = y ↔ y = x := by apply?
|
/root/DuelModelResearch/mathlib4/MathlibTest/LibrarySearch/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "apply?",
"before_state": "α : Type\nx y : α\n⊢ x = y ↔ y = x",
"after_state": "No Goals!"
},
{
"line": "exact eq_comm",
"before_state": "α : Type\nx y : α\n⊢ x = y ↔ y = x",
"after_state": "No Goals!"
}
] |
example (a b : ℕ) (_ha : 0 < a) (_hb : 0 < b) : 0 < a + b := by apply?
|
/root/DuelModelResearch/mathlib4/MathlibTest/LibrarySearch/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "apply?",
"before_state": "a b : ℕ\n_ha : 0 < a\n_hb : 0 < b\n⊢ 0 < a + b",
"after_state": "No Goals!"
},
{
"line": "exact Nat.add_pos_left _ha b",
"before_state": "a b : ℕ\n_ha : 0 < a\n_hb : 0 < b\n⊢ 0 < a + b",
"after_state": "No Goals!"
}
] |
example (a b : ℕ) (_ha : 0 < a) (_hb : 0 < b) : 0 < a + b := by apply?
|
/root/DuelModelResearch/mathlib4/MathlibTest/LibrarySearch/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "apply?",
"before_state": "a b : ℕ\n_ha : 0 < a\n_hb : 0 < b\n⊢ 0 < a + b",
"after_state": "No Goals!"
},
{
"line": "exact Nat.add_pos_left _ha b",
"before_state": "a b : ℕ\n_ha : 0 < a\n_hb : 0 < b\n⊢ 0 < a + b",
"after_state": "No Goals!"
}
] |
example (a b : ℕ) (_ha : a > 0) (_hb : 0 < b) : 0 < a + b := by apply?
|
/root/DuelModelResearch/mathlib4/MathlibTest/LibrarySearch/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "apply?",
"before_state": "a b : ℕ\n_ha : a > 0\n_hb : 0 < b\n⊢ 0 < a + b",
"after_state": "No Goals!"
},
{
"line": "exact Nat.add_pos_left _ha b",
"before_state": "a b : ℕ\n_ha : a > 0\n_hb : 0 < b\n⊢ 0 < a + b",
"after_state": "No Goals!"
}
] |
example (a b : ℕ) (h : a ∣ b) (w : b > 0) : a ≤ b := by
apply?
|
/root/DuelModelResearch/mathlib4/MathlibTest/LibrarySearch/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "apply?",
"before_state": "a b : ℕ\nh : a ∣ b\nw : b > 0\n⊢ a ≤ b",
"after_state": "No Goals!"
},
{
"line": "exact Nat.le_of_dvd w h",
"before_state": "a b : ℕ\nh : a ∣ b\nw : b > 0\n⊢ a ≤ b",
"after_state": "No Goals!"
}
] |
example (a b : ℕ) (h : a ∣ b) (w : b > 0) : b ≥ a := by apply?
|
/root/DuelModelResearch/mathlib4/MathlibTest/LibrarySearch/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "apply?",
"before_state": "a b : ℕ\nh : a ∣ b\nw : b > 0\n⊢ b ≥ a",
"after_state": "No Goals!"
},
{
"line": "exact Nat.le_of_dvd w h",
"before_state": "a b : ℕ\nh : a ∣ b\nw : b > 0\n⊢ b ≥ a",
"after_state": "No Goals!"
}
] |
example (a : ℕ) : ¬ (a < 0) := by apply?
|
/root/DuelModelResearch/mathlib4/MathlibTest/LibrarySearch/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "apply?",
"before_state": "a : ℕ\n⊢ ¬a < 0",
"after_state": "No Goals!"
},
{
"line": "exact Nat.not_lt_zero a",
"before_state": "a : ℕ\n⊢ ¬a < 0",
"after_state": "No Goals!"
}
] |
example (a : ℕ) (h : a < 0) : False := by apply?
|
/root/DuelModelResearch/mathlib4/MathlibTest/LibrarySearch/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "apply?",
"before_state": "a : ℕ\nh : a < 0\n⊢ False",
"after_state": "No Goals!"
},
{
"line": "exact Nat.not_succ_le_zero a h",
"before_state": "a : ℕ\nh : a < 0\n⊢ False",
"after_state": "No Goals!"
}
] |
example : ∀ P : Prop, ¬(P ↔ ¬P) := by apply?
|
/root/DuelModelResearch/mathlib4/MathlibTest/LibrarySearch/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "apply?",
"before_state": "⊢ ∀ (P : Prop), ¬(P ↔ ¬P)",
"after_state": "No Goals!"
},
{
"line": "exact fun P => iff_not_self",
"before_state": "⊢ ∀ (P : Prop), ¬(P ↔ ¬P)",
"after_state": "No Goals!"
}
] |
example {a b c : ℕ} (h₁ : a ∣ c) (h₂ : a ∣ b + c) : a ∣ b := by apply?
|
/root/DuelModelResearch/mathlib4/MathlibTest/LibrarySearch/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "apply?",
"before_state": "a b c : ℕ\nh₁ : a ∣ c\nh₂ : a ∣ b + c\n⊢ a ∣ b",
"after_state": "No Goals!"
},
{
"line": "exact (Nat.dvd_add_iff_left h₁).mpr h₂",
"before_state": "a b c : ℕ\nh₁ : a ∣ c\nh₂ : a ∣ b + c\n⊢ a ∣ b",
"after_state": "No Goals!"
}
] |
example (L _M : List (List ℕ)) : List ℕ := by apply? using L
|
/root/DuelModelResearch/mathlib4/MathlibTest/LibrarySearch/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "apply? using L",
"before_state": "L _M : List (List ℕ)\n⊢ List ℕ",
"after_state": "No Goals!"
},
{
"line": "exact L.flatten",
"before_state": "L _M : List (List ℕ)\n⊢ List ℕ",
"after_state": "No Goals!"
}
] |
example (P _Q : List ℕ) (h : ℕ) : List ℕ := by apply? using h, P
|
/root/DuelModelResearch/mathlib4/MathlibTest/LibrarySearch/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "apply? using h, P",
"before_state": "P _Q : List ℕ\nh : ℕ\n⊢ List ℕ",
"after_state": "No Goals!"
},
{
"line": "exact List.range'TR.go h h h P",
"before_state": "P _Q : List ℕ\nh : ℕ\n⊢ List ℕ",
"after_state": "No Goals!"
}
] |
example (l : List α) (f : α → β ⊕ γ) : List β × List γ := by
apply? using f -- partitionMap f l
|
/root/DuelModelResearch/mathlib4/MathlibTest/LibrarySearch/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "apply? using f",
"before_state": "α : Type ?u.29\nβ : Type ?u.35\nγ : Type ?u.34\nl : List α\nf : α → β ⊕ γ\n⊢ List β × List γ",
"after_state": "No Goals!"
},
{
"line": "exact List.partitionMap f l",
"before_state": "α : Type ?u.29\nβ : Type ?u.35\nγ : Type ?u.34\nl : List α\nf : α → β ⊕ γ\n⊢ List β × List γ",
"after_state": "No Goals!"
}
] |
example (n m : ℕ) : ℕ := by apply? using n, m
|
/root/DuelModelResearch/mathlib4/MathlibTest/LibrarySearch/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "apply? using n, m",
"before_state": "n m : ℕ\n⊢ ℕ",
"after_state": "No Goals!"
},
{
"line": "exact n.sub m",
"before_state": "n m : ℕ\n⊢ ℕ",
"after_state": "No Goals!"
}
] |
example (P Q : List ℕ) (_h : ℕ) : List ℕ := by apply? using P, Q
|
/root/DuelModelResearch/mathlib4/MathlibTest/LibrarySearch/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "apply? using P, Q",
"before_state": "P Q : List ℕ\n_h : ℕ\n⊢ List ℕ",
"after_state": "No Goals!"
},
{
"line": "exact Nat.SOM.Mon.mul.go _h P Q",
"before_state": "P Q : List ℕ\n_h : ℕ\n⊢ List ℕ",
"after_state": "No Goals!"
}
] |
theorem Bool_eq_iff {A B : Bool} : (A = B) = (A ↔ B) := by
(cases A <;> cases B <;> simp)
|
/root/DuelModelResearch/mathlib4/MathlibTest/LibrarySearch/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "focus\n cases A <;> cases B\n with_annotate_state\"<;>\" skip\n all_goals simp",
"before_state": "A B : Bool\n⊢ (A = B) = (A = true ↔ B = true)",
"after_state": "No Goals!"
},
{
"line": "focus\n cases A\n with_annotate_state\"<;>\" skip\n all_goals cases B",
"before_state": "A B : Bool\n⊢ (A = B) = (A = true ↔ B = true)",
"after_state": "case false.false\n⊢ (false = false) = (false = true ↔ false = true)\n---\ncase false.true\n⊢ (false = true) = (false = true ↔ true = true)\n---\ncase true.false\n⊢ (true = false) = (true = true ↔ false = true)\n---\ncase true.true\n⊢ (true = true) = (true = true ↔ true = true)"
},
{
"line": "cases A",
"before_state": "A B : Bool\n⊢ (A = B) = (A = true ↔ B = true)",
"after_state": "case false\nB : Bool\n⊢ (false = B) = (false = true ↔ B = true)\n---\ncase true\nB : Bool\n⊢ (true = B) = (true = true ↔ B = true)"
},
{
"line": "with_annotate_state\"<;>\" skip",
"before_state": "case false\nB : Bool\n⊢ (false = B) = (false = true ↔ B = true)\n---\ncase true\nB : Bool\n⊢ (true = B) = (true = true ↔ B = true)",
"after_state": "case false\nB : Bool\n⊢ (false = B) = (false = true ↔ B = true)\n---\ncase true\nB : Bool\n⊢ (true = B) = (true = true ↔ B = true)"
},
{
"line": "skip",
"before_state": "case false\nB : Bool\n⊢ (false = B) = (false = true ↔ B = true)\n---\ncase true\nB : Bool\n⊢ (true = B) = (true = true ↔ B = true)",
"after_state": "case false\nB : Bool\n⊢ (false = B) = (false = true ↔ B = true)\n---\ncase true\nB : Bool\n⊢ (true = B) = (true = true ↔ B = true)"
},
{
"line": "all_goals cases B",
"before_state": "case false\nB : Bool\n⊢ (false = B) = (false = true ↔ B = true)\n---\ncase true\nB : Bool\n⊢ (true = B) = (true = true ↔ B = true)",
"after_state": "case false.false\n⊢ (false = false) = (false = true ↔ false = true)\n---\ncase false.true\n⊢ (false = true) = (false = true ↔ true = true)\n---\ncase true.false\n⊢ (true = false) = (true = true ↔ false = true)\n---\ncase true.true\n⊢ (true = true) = (true = true ↔ true = true)"
},
{
"line": "cases B",
"before_state": "case false\nB : Bool\n⊢ (false = B) = (false = true ↔ B = true)",
"after_state": "case false.false\n⊢ (false = false) = (false = true ↔ false = true)\n---\ncase false.true\n⊢ (false = true) = (false = true ↔ true = true)"
},
{
"line": "cases B",
"before_state": "case true\nB : Bool\n⊢ (true = B) = (true = true ↔ B = true)",
"after_state": "case true.false\n⊢ (true = false) = (true = true ↔ false = true)\n---\ncase true.true\n⊢ (true = true) = (true = true ↔ true = true)"
},
{
"line": "with_annotate_state\"<;>\" skip",
"before_state": "case false.false\n⊢ (false = false) = (false = true ↔ false = true)\n---\ncase false.true\n⊢ (false = true) = (false = true ↔ true = true)\n---\ncase true.false\n⊢ (true = false) = (true = true ↔ false = true)\n---\ncase true.true\n⊢ (true = true) = (true = true ↔ true = true)",
"after_state": "case false.false\n⊢ (false = false) = (false = true ↔ false = true)\n---\ncase false.true\n⊢ (false = true) = (false = true ↔ true = true)\n---\ncase true.false\n⊢ (true = false) = (true = true ↔ false = true)\n---\ncase true.true\n⊢ (true = true) = (true = true ↔ true = true)"
},
{
"line": "skip",
"before_state": "case false.false\n⊢ (false = false) = (false = true ↔ false = true)\n---\ncase false.true\n⊢ (false = true) = (false = true ↔ true = true)\n---\ncase true.false\n⊢ (true = false) = (true = true ↔ false = true)\n---\ncase true.true\n⊢ (true = true) = (true = true ↔ true = true)",
"after_state": "case false.false\n⊢ (false = false) = (false = true ↔ false = true)\n---\ncase false.true\n⊢ (false = true) = (false = true ↔ true = true)\n---\ncase true.false\n⊢ (true = false) = (true = true ↔ false = true)\n---\ncase true.true\n⊢ (true = true) = (true = true ↔ true = true)"
},
{
"line": "all_goals simp",
"before_state": "case false.false\n⊢ (false = false) = (false = true ↔ false = true)\n---\ncase false.true\n⊢ (false = true) = (false = true ↔ true = true)\n---\ncase true.false\n⊢ (true = false) = (true = true ↔ false = true)\n---\ncase true.true\n⊢ (true = true) = (true = true ↔ true = true)",
"after_state": "No Goals!"
},
{
"line": "simp",
"before_state": "case false.false\n⊢ (false = false) = (false = true ↔ false = true)",
"after_state": "No Goals!"
},
{
"line": "simp",
"before_state": "case false.true\n⊢ (false = true) = (false = true ↔ true = true)",
"after_state": "No Goals!"
},
{
"line": "simp",
"before_state": "case true.false\n⊢ (true = false) = (true = true ↔ false = true)",
"after_state": "No Goals!"
},
{
"line": "simp",
"before_state": "case true.true\n⊢ (true = true) = (true = true ↔ true = true)",
"after_state": "No Goals!"
}
] |
example {r : α → α → Prop} : Function.Surjective (Quot.mk r) := by exact?
|
/root/DuelModelResearch/mathlib4/MathlibTest/LibrarySearch/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "exact?",
"before_state": "α : Sort u_1\nr : α → α → Prop\n⊢ Function.Surjective (Quot.mk r)",
"after_state": "No Goals!"
},
{
"line": "exact Quot.mk_surjective",
"before_state": "α : Sort u_1\nr : α → α → Prop\n⊢ Function.Surjective (Quot.mk r)",
"after_state": "No Goals!"
}
] |
lemma prime_of_prime (n : ℕ) : Prime n ↔ Nat.Prime n := by
exact?
|
/root/DuelModelResearch/mathlib4/MathlibTest/LibrarySearch/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "exact?",
"before_state": "n : ℕ\n⊢ Prime n ↔ Nat.Prime n",
"after_state": "No Goals!"
},
{
"line": "exact Iff.symm Nat.prime_iff",
"before_state": "n : ℕ\n⊢ Prime n ↔ Nat.Prime n",
"after_state": "No Goals!"
}
] |
example (P Q : Prop) (h : P → Q) (h' : ¬Q) : ¬P := by
exact? says exact fun a ↦ h' (h a)
|
/root/DuelModelResearch/mathlib4/MathlibTest/LibrarySearch/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "exact? says exact fun a ↦ h' (h a)",
"before_state": "P Q : Prop\nh : P → Q\nh' : ¬Q\n⊢ ¬P",
"after_state": "No Goals!"
},
{
"line": "exact fun a ↦ h' (h a)",
"before_state": "P Q : Prop\nh : P → Q\nh' : ¬Q\n⊢ ¬P",
"after_state": "No Goals!"
}
] |
example (_h : List.range 10000 = List.range 10000) (n m : Nat) : n + m = m + n := by
with_reducible exact?
|
/root/DuelModelResearch/mathlib4/MathlibTest/LibrarySearch/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "with_reducible exact?",
"before_state": "_h : List.range 10000 = List.range 10000\nn m : ℕ\n⊢ n + m = m + n",
"after_state": "No Goals!"
},
{
"line": "exact?",
"before_state": "_h : List.range 10000 = List.range 10000\nn m : ℕ\n⊢ n + m = m + n",
"after_state": "No Goals!"
},
{
"line": "exact Nat.add_comm n m",
"before_state": "_h : List.range 10000 = List.range 10000\nn m : ℕ\n⊢ n + m = m + n",
"after_state": "No Goals!"
}
] |
example : 0 < 1 := by exact?
|
/root/DuelModelResearch/mathlib4/MathlibTest/LibrarySearch/mathlib.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "exact?",
"before_state": "⊢ 0 < 1",
"after_state": "No Goals!"
},
{
"line": "exact Nat.one_pos",
"before_state": "⊢ 0 < 1",
"after_state": "No Goals!"
}
] |
example (x y : Nat) : True := by
observe? h : x + y = y + x
guard_hyp h : x + y = y + x
trivial
|
/root/DuelModelResearch/mathlib4/MathlibTest/LibrarySearch/observe.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "observe? h : x + y = y + x",
"before_state": "x y : ℕ\n⊢ True",
"after_state": "x y : ℕ\nh : x + y = y + x\n⊢ True"
},
{
"line": "observe ? h : x + y = y + x",
"before_state": "x y : ℕ\n⊢ True",
"after_state": "x y : ℕ\nh : x + y = y + x\n⊢ True"
},
{
"line": "guard_hyp h : x + y = y + x",
"before_state": "x y : ℕ\nh : x + y = y + x\n⊢ True",
"after_state": "x y : ℕ\nh : x + y = y + x\n⊢ True"
},
{
"line": "trivial",
"before_state": "x y : ℕ\nh : x + y = y + x\n⊢ True",
"after_state": "No Goals!"
},
{
"line": "apply True.intro✝",
"before_state": "x y : ℕ\nh : x + y = y + x\n⊢ True",
"after_state": "No Goals!"
}
] |
example (xs ys : List α) : (xs ++ ys).length = ys.length + xs.length := by
rw_search
|
/root/DuelModelResearch/mathlib4/MathlibTest/RewriteSearch/Basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "rw_search",
"before_state": "α : Type u_1\nxs ys : List α\n⊢ (xs ++ ys).length = ys.length + xs.length",
"after_state": "No Goals!"
}
] |
example (xs ys : List α) :
(xs ++ ys ++ ys).length = 2 * ys.length + xs.length := by
rw_search
|
/root/DuelModelResearch/mathlib4/MathlibTest/RewriteSearch/Basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "rw_search",
"before_state": "α : Type u_1\nxs ys : List α\n⊢ (xs ++ ys ++ ys).length = 2 * ys.length + xs.length",
"after_state": "No Goals!"
}
] |
example (xs ys : List α) :
(xs ++ ys ++ ys).length = 2 * ys.length + xs.length := by
rw_search [-add_rotate]
|
/root/DuelModelResearch/mathlib4/MathlibTest/RewriteSearch/Basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "rw_search [-add_rotate]",
"before_state": "α : Type u_1\nxs ys : List α\n⊢ (xs ++ ys ++ ys).length = 2 * ys.length + xs.length",
"after_state": "No Goals!"
}
] |
example {a b c : Int} : a + b = c + b + (a - c) := by
rw_search
|
/root/DuelModelResearch/mathlib4/MathlibTest/RewriteSearch/Basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "rw_search",
"before_state": "a b c : ℤ\n⊢ a + b = c + b + (a - c)",
"after_state": "No Goals!"
}
] |
example {R : Type u} [Semiring R] {p : Polynomial R} [Subsingleton R] :
Polynomial.degree p = ⊥ := by
rw_search [-Polynomial.degree_of_subsingleton]
-- Mathlib proof:
-- rw [Subsingleton.elim p 0, degree_zero]
done
|
/root/DuelModelResearch/mathlib4/MathlibTest/RewriteSearch/Polynomial.lean
|
{
"open": [
"Polynomial"
],
"variables": []
}
|
[
{
"line": "rw_search [-Polynomial.degree_of_subsingleton]\n -- Mathlib proof:\n -- rw [Subsingleton.elim p 0, degree_zero]",
"before_state": "R : Type u\ninst✝¹ : Semiring R\np : R[X]\ninst✝ : Subsingleton R\n⊢ p.degree = ⊥",
"after_state": "R : Type u\ninst✝¹ : Semiring R\np : R[X]\ninst✝ : Subsingleton R\n⊢ p.degree = ⊥"
},
{
"line": "done",
"before_state": "R : Type u\ninst✝¹ : Semiring R\np : R[X]\ninst✝ : Subsingleton R\n⊢ p.degree = ⊥",
"after_state": "No Goals!"
}
] |
example {R : Type u} {a : R} [Semiring R] (n : ℕ) (ha : a ≠ 0) :
Polynomial.degree (Polynomial.C a * Polynomial.X ^ n) = n := by
rw_search [-Polynomial.degree_C_mul_X_pow]
-- Mathlib proof:
-- rw [C_mul_X_pow_eq_monomial, degree_monomial n ha]
done
|
/root/DuelModelResearch/mathlib4/MathlibTest/RewriteSearch/Polynomial.lean
|
{
"open": [
"Polynomial"
],
"variables": []
}
|
[
{
"line": "rw_search [-Polynomial.degree_C_mul_X_pow]\n -- Mathlib proof:\n -- rw [C_mul_X_pow_eq_monomial, degree_monomial n ha]",
"before_state": "R : Type u\na : R\ninst✝ : Semiring R\nn : ℕ\nha : a ≠ 0\n⊢ (C a * X ^ n).degree = ↑n",
"after_state": "No Goals!"
}
] |
example {R : Type u} [Semiring R] {p q : Polynomial R}
(h : Polynomial.degree p < Polynomial.degree q) :
Polynomial.degree (p + q) = Polynomial.degree q := by
rw_search [-Polynomial.degree_add_eq_right_of_degree_lt]
-- Mathlib proof:
-- rw [add_comm, degree_add_eq_left_of_degree_lt h]
done
|
/root/DuelModelResearch/mathlib4/MathlibTest/RewriteSearch/Polynomial.lean
|
{
"open": [
"Polynomial"
],
"variables": []
}
|
[
{
"line": "rw_search [-Polynomial.degree_add_eq_right_of_degree_lt]\n -- Mathlib proof:\n -- rw [add_comm, degree_add_eq_left_of_degree_lt h]",
"before_state": "R : Type u\ninst✝ : Semiring R\np q : R[X]\nh : p.degree < q.degree\n⊢ (p + q).degree = q.degree",
"after_state": "No Goals!"
}
] |
example {R : Type u} [Semiring R] (a : R) (n : ℕ) :
Polynomial.leadingCoeff (Polynomial.C a * Polynomial.X ^ n) = a := by
rw_search [-Polynomial.leadingCoeff_C_mul_X_pow]
-- Mathlib proof:
-- rw [C_mul_X_pow_eq_monomial, leadingCoeff_monomial]
done
|
/root/DuelModelResearch/mathlib4/MathlibTest/RewriteSearch/Polynomial.lean
|
{
"open": [
"Polynomial"
],
"variables": []
}
|
[
{
"line": "rw_search [-Polynomial.leadingCoeff_C_mul_X_pow]\n -- Mathlib proof:\n -- rw [C_mul_X_pow_eq_monomial, leadingCoeff_monomial]",
"before_state": "R : Type u\ninst✝ : Semiring R\na : R\nn : ℕ\n⊢ (C a * X ^ n).leadingCoeff = a",
"after_state": "No Goals!"
}
] |
example {R : Type u} [Semiring R] {p : Polynomial R}
(h : Finset.card (Polynomial.support p) ≤ 1) :
Polynomial.C (Polynomial.leadingCoeff p) * Polynomial.X ^ Polynomial.natDegree p = p := by
rw_search [-Polynomial.C_mul_X_pow_eq_self]
-- Mathlib proof:
-- rw [C_mul_X_pow_eq_monomial, monomial_natDegree_leadingCoeff_eq_self h]
done
|
/root/DuelModelResearch/mathlib4/MathlibTest/RewriteSearch/Polynomial.lean
|
{
"open": [
"Polynomial"
],
"variables": []
}
|
[
{
"line": "rw_search [-Polynomial.C_mul_X_pow_eq_self]\n -- Mathlib proof:\n -- rw [C_mul_X_pow_eq_monomial, monomial_natDegree_leadingCoeff_eq_self h]",
"before_state": "R : Type u\ninst✝ : Semiring R\np : R[X]\nh : p.support.card ≤ 1\n⊢ C p.leadingCoeff * X ^ p.natDegree = p",
"after_state": "No Goals!"
}
] |
example {R : Type u} {a b : R} [Semiring R] (ha : a ≠ 0) :
Polynomial.natDegree (Polynomial.C a * Polynomial.X + Polynomial.C b) = 1 := by
rw_search [-Polynomial.natDegree_linear]
-- Mathlib proof:
-- rw [natDegree_add_C, natDegree_C_mul_X a ha]
done
|
/root/DuelModelResearch/mathlib4/MathlibTest/RewriteSearch/Polynomial.lean
|
{
"open": [
"Polynomial"
],
"variables": []
}
|
[
{
"line": "rw_search [-Polynomial.natDegree_linear]\n -- Mathlib proof:\n -- rw [natDegree_add_C, natDegree_C_mul_X a ha]",
"before_state": "R : Type u\na b : R\ninst✝ : Semiring R\nha : a ≠ 0\n⊢ (C a * X + C b).natDegree = 1",
"after_state": "No Goals!"
}
] |
example {R : Type u} [Ring R] [Nontrivial R] (x : R) :
Polynomial.natDegree (Polynomial.X - Polynomial.C x) = 1 := by
rw_search [-Polynomial.natDegree_X_sub_C]
-- Mathlib proof:
-- rw [natDegree_sub_C, natDegree_X]
done
|
/root/DuelModelResearch/mathlib4/MathlibTest/RewriteSearch/Polynomial.lean
|
{
"open": [
"Polynomial"
],
"variables": []
}
|
[
{
"line": "rw_search [-Polynomial.natDegree_X_sub_C]\n -- Mathlib proof:\n -- rw [natDegree_sub_C, natDegree_X]",
"before_state": "R : Type u\ninst✝¹ : Ring R\ninst✝ : Nontrivial R\nx : R\n⊢ (X - C x).natDegree = 1",
"after_state": "No Goals!"
}
] |
example {S : Type v} [Ring S] (c : S) :
Polynomial.nextCoeff (Polynomial.X - Polynomial.C c) = -c := by
rw_search
-- Mathlib proof:
-- rw [sub_eq_add_neg, ← map_neg C c, nextCoeff_X_add_C]
done
|
/root/DuelModelResearch/mathlib4/MathlibTest/RewriteSearch/Polynomial.lean
|
{
"open": [
"Polynomial"
],
"variables": []
}
|
[
{
"line": "rw_search\n -- Mathlib proof:\n -- rw [sub_eq_add_neg, ← map_neg C c, nextCoeff_X_add_C]",
"before_state": "S : Type v\ninst✝ : Ring S\nc : S\n⊢ (X - C c).nextCoeff = -c",
"after_state": "No Goals!"
}
] |
example {R : Type u} [Ring R] [Nontrivial R] {n : ℕ} (hn : 0 < n) (a : R) :
Polynomial.degree (Polynomial.X ^ n - Polynomial.C a) = n := by
rw_search [-Polynomial.degree_X_pow_sub_C]
-- Mathlib proof:
-- rw [sub_eq_add_neg, ← map_neg C a, degree_X_pow_add_C hn]
done
|
/root/DuelModelResearch/mathlib4/MathlibTest/RewriteSearch/Polynomial.lean
|
{
"open": [
"Polynomial"
],
"variables": []
}
|
[
{
"line": "rw_search [-Polynomial.degree_X_pow_sub_C]\n -- Mathlib proof:\n -- rw [sub_eq_add_neg, ← map_neg C a, degree_X_pow_add_C hn]",
"before_state": "R : Type u\ninst✝¹ : Ring R\ninst✝ : Nontrivial R\nn : ℕ\nhn : 0 < n\na : R\n⊢ (X ^ n - C a).degree = ↑n",
"after_state": "No Goals!"
}
] |
example {R : Type u} [Ring R] [Nontrivial R] {n : ℕ} {r : R} :
Polynomial.natDegree (Polynomial.X ^ n - Polynomial.C r) = n := by
rw_search [-Polynomial.natDegree_X_pow_sub_C]
-- Mathlib proof:
-- rw [sub_eq_add_neg, ← map_neg C r, natDegree_X_pow_add_C]
done
|
/root/DuelModelResearch/mathlib4/MathlibTest/RewriteSearch/Polynomial.lean
|
{
"open": [
"Polynomial"
],
"variables": []
}
|
[
{
"line": "rw_search [-Polynomial.natDegree_X_pow_sub_C]\n -- Mathlib proof:\n -- rw [sub_eq_add_neg, ← map_neg C r, natDegree_X_pow_add_C]",
"before_state": "R : Type u\ninst✝¹ : Ring R\ninst✝ : Nontrivial R\nn : ℕ\nr : R\n⊢ (X ^ n - C r).natDegree = n",
"after_state": "No Goals!"
}
] |
lemma prod_test (R : Type) [CommMonoid R] (f : Fin 10 → R) :
∏ i, f i = f 0 * f 1 * f 2 * f 3 * f 4 * f 5 * f 6 * f 7 * f 8 * f 9 := by
simp only [Fin.prod_univ_ofNat]
|
/root/DuelModelResearch/mathlib4/MathlibTest/Simproc/ProdUnivMany.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "simp only [Fin.prod_univ_ofNat]",
"before_state": "R : Type\ninst✝ : CommMonoid R\nf : Fin 10 → R\n⊢ ∏ i, f i = f 0 * f 1 * f 2 * f 3 * f 4 * f 5 * f 6 * f 7 * f 8 * f 9",
"after_state": "No Goals!"
}
] |
example (R : Type) [AddCommMonoid R] (f : Fin 10 → R) :
∑ i, f i = f 0 + f 1 + f 2 + f 3 + f 4 + f 5 + f 6 + f 7 + f 8 + f 9 := by
simp only [Fin.sum_univ_ofNat]
|
/root/DuelModelResearch/mathlib4/MathlibTest/Simproc/ProdUnivMany.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "simp only [Fin.sum_univ_ofNat]",
"before_state": "R : Type\ninst✝ : AddCommMonoid R\nf : Fin 10 → R\n⊢ ∑ i, f i = f 0 + f 1 + f 2 + f 3 + f 4 + f 5 + f 6 + f 7 + f 8 + f 9",
"after_state": "No Goals!"
}
] |
example (a : α) (hp : p a) (hq : q a) : ∃ b : α, (p b ∧ b = a) ∧ q b := by
simp only [existsAndEq]
guard_target = (p a ∧ True) ∧ q a
exact ⟨⟨hp, trivial⟩, hq⟩
|
/root/DuelModelResearch/mathlib4/MathlibTest/Simproc/ExistsAndEq.lean
|
{
"open": [],
"variables": [
"(α : Type u) (p q : α → Prop)"
]
}
|
[
{
"line": "simp only [existsAndEq]",
"before_state": "α : Type u\np q : α → Prop\na : α\nhp : p a\nhq : q a\n⊢ ∃ b, (p b ∧ b = a) ∧ q b",
"after_state": "α : Type u\np q : α → Prop\na : α\nhp : p a\nhq : q a\n⊢ (p a ∧ True) ∧ q a"
},
{
"line": "guard_target = (p a ∧ True) ∧ q a",
"before_state": "α : Type u\np q : α → Prop\na : α\nhp : p a\nhq : q a\n⊢ (p a ∧ True) ∧ q a",
"after_state": "α : Type u\np q : α → Prop\na : α\nhp : p a\nhq : q a\n⊢ (p a ∧ True) ∧ q a"
},
{
"line": "exact ⟨⟨hp, trivial⟩, hq⟩",
"before_state": "α : Type u\np q : α → Prop\na : α\nhp : p a\nhq : q a\n⊢ (p a ∧ True) ∧ q a",
"after_state": "No Goals!"
}
] |
example (a : α) : ∃ b : α, b = a := by
simp only [existsAndEq]
|
/root/DuelModelResearch/mathlib4/MathlibTest/Simproc/ExistsAndEq.lean
|
{
"open": [],
"variables": [
"(α : Type u) (p q : α → Prop)"
]
}
|
[
{
"line": "simp only [existsAndEq]",
"before_state": "α : Type u\np q : α → Prop\na : α\n⊢ ∃ b, b = a",
"after_state": "No Goals!"
}
] |
example (a : α) (hp : p a) (hq : q a) : (∃ b : α, p b ∧ (∃ c : α, b = a ∧ q c)) := by
-- the simproc doesn't handle nested `Exists`
simp -failIfUnchanged only [existsAndEq]
guard_target = ∃ b : α, p b ∧ (∃ c : α, b = a ∧ q c)
simp only [exists_and_left]
guard_target = ∃ b, p b ∧ b = a ∧ ∃ x, q x
-- but can clean up the rest
simp only [existsAndEq]
guard_target = p a ∧ True ∧ ∃ x, q x
exact ⟨hp, trivial, a, hq⟩
|
/root/DuelModelResearch/mathlib4/MathlibTest/Simproc/ExistsAndEq.lean
|
{
"open": [
"Lean Meta Simp"
],
"variables": [
"(α : Type u) (p q : α → Prop)"
]
}
|
[
{
"line": "simp -failIfUnchanged only [existsAndEq]",
"before_state": "α : Type u\np q : α → Prop\na : α\nhp : p a\nhq : q a\n⊢ ∃ b, p b ∧ ∃ c, b = a ∧ q c",
"after_state": "α : Type u\np q : α → Prop\na : α\nhp : p a\nhq : q a\n⊢ ∃ b, p b ∧ ∃ c, b = a ∧ q c"
},
{
"line": "guard_target = ∃ b : α, p b ∧ (∃ c : α, b = a ∧ q c)",
"before_state": "α : Type u\np q : α → Prop\na : α\nhp : p a\nhq : q a\n⊢ ∃ b, p b ∧ ∃ c, b = a ∧ q c",
"after_state": "α : Type u\np q : α → Prop\na : α\nhp : p a\nhq : q a\n⊢ ∃ b, p b ∧ ∃ c, b = a ∧ q c"
},
{
"line": "simp only [exists_and_left]",
"before_state": "α : Type u\np q : α → Prop\na : α\nhp : p a\nhq : q a\n⊢ ∃ b, p b ∧ ∃ c, b = a ∧ q c",
"after_state": "α : Type u\np q : α → Prop\na : α\nhp : p a\nhq : q a\n⊢ ∃ b, p b ∧ b = a ∧ ∃ x, q x"
},
{
"line": "guard_target = ∃ b, p b ∧ b = a ∧ ∃ x, q x",
"before_state": "α : Type u\np q : α → Prop\na : α\nhp : p a\nhq : q a\n⊢ ∃ b, p b ∧ b = a ∧ ∃ x, q x",
"after_state": "α : Type u\np q : α → Prop\na : α\nhp : p a\nhq : q a\n⊢ ∃ b, p b ∧ b = a ∧ ∃ x, q x"
},
{
"line": "simp only [existsAndEq]",
"before_state": "α : Type u\np q : α → Prop\na : α\nhp : p a\nhq : q a\n⊢ ∃ b, p b ∧ b = a ∧ ∃ x, q x",
"after_state": "α : Type u\np q : α → Prop\na : α\nhp : p a\nhq : q a\n⊢ p a ∧ True ∧ ∃ x, q x"
},
{
"line": "guard_target = p a ∧ True ∧ ∃ x, q x",
"before_state": "α : Type u\np q : α → Prop\na : α\nhp : p a\nhq : q a\n⊢ p a ∧ True ∧ ∃ x, q x",
"after_state": "α : Type u\np q : α → Prop\na : α\nhp : p a\nhq : q a\n⊢ p a ∧ True ∧ ∃ x, q x"
},
{
"line": "exact ⟨hp, trivial, a, hq⟩",
"before_state": "α : Type u\np q : α → Prop\na : α\nhp : p a\nhq : q a\n⊢ p a ∧ True ∧ ∃ x, q x",
"after_state": "No Goals!"
}
] |
example :
(NonUnitalNormedRing.toNormedAddCommGroup : NormedAddCommGroup ℂ) =
Complex.instNormedAddCommGroup := by
with_reducible_and_instances rfl
|
/root/DuelModelResearch/mathlib4/MathlibTest/instance_diamonds/normed.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "with_reducible_and_instances rfl",
"before_state": "⊢ NonUnitalNormedRing.toNormedAddCommGroup = Complex.instNormedAddCommGroup",
"after_state": "No Goals!"
},
{
"line": "rfl",
"before_state": "⊢ NonUnitalNormedRing.toNormedAddCommGroup = Complex.instNormedAddCommGroup",
"after_state": "No Goals!"
},
{
"line": "eq_refl",
"before_state": "⊢ NonUnitalNormedRing.toNormedAddCommGroup = Complex.instNormedAddCommGroup",
"after_state": "No Goals!"
}
] |
example : (Complex.SMul.instSMulRealComplex : SMul ℚ ℂ) = (Algebra.toSMul : SMul ℚ ℂ) := by
with_reducible_and_instances rfl
|
/root/DuelModelResearch/mathlib4/MathlibTest/instance_diamonds/Data/Complex/Module.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "with_reducible_and_instances rfl",
"before_state": "⊢ Complex.SMul.instSMulRealComplex = Algebra.toSMul",
"after_state": "No Goals!"
},
{
"line": "rfl",
"before_state": "⊢ Complex.SMul.instSMulRealComplex = Algebra.toSMul",
"after_state": "No Goals!"
},
{
"line": "eq_refl",
"before_state": "⊢ Complex.SMul.instSMulRealComplex = Algebra.toSMul",
"after_state": "No Goals!"
}
] |
example : (AddCommGroup.toNatModule : Module ℕ (AlgebraicClosure k)) =
@Algebra.toModule _ _ _ _ (AlgebraicClosure.instAlgebra k) := by
with_reducible_and_instances rfl
|
/root/DuelModelResearch/mathlib4/MathlibTest/instance_diamonds/FieldTheory/IsAlgClosed/AlgebraicClosure.lean
|
{
"open": [],
"variables": [
"{k : Type*} [Field k]"
]
}
|
[
{
"line": "with_reducible_and_instances rfl",
"before_state": "k : Type u_1\ninst✝ : Field k\n⊢ AddCommGroup.toNatModule = Algebra.toModule",
"after_state": "No Goals!"
},
{
"line": "rfl",
"before_state": "k : Type u_1\ninst✝ : Field k\n⊢ AddCommGroup.toNatModule = Algebra.toModule",
"after_state": "No Goals!"
},
{
"line": "eq_refl",
"before_state": "k : Type u_1\ninst✝ : Field k\n⊢ AddCommGroup.toNatModule = Algebra.toModule",
"after_state": "No Goals!"
}
] |
example : (AddCommGroup.toIntModule _ : Module ℤ (AlgebraicClosure k)) =
@Algebra.toModule _ _ _ _ (AlgebraicClosure.instAlgebra k) := by
with_reducible_and_instances rfl
|
/root/DuelModelResearch/mathlib4/MathlibTest/instance_diamonds/FieldTheory/IsAlgClosed/AlgebraicClosure.lean
|
{
"open": [],
"variables": [
"{k : Type*} [Field k]"
]
}
|
[
{
"line": "with_reducible_and_instances rfl",
"before_state": "k : Type u_1\ninst✝ : Field k\n⊢ AddCommGroup.toIntModule (AlgebraicClosure k) = Algebra.toModule",
"after_state": "No Goals!"
},
{
"line": "rfl",
"before_state": "k : Type u_1\ninst✝ : Field k\n⊢ AddCommGroup.toIntModule (AlgebraicClosure k) = Algebra.toModule",
"after_state": "No Goals!"
},
{
"line": "eq_refl",
"before_state": "k : Type u_1\ninst✝ : Field k\n⊢ AddCommGroup.toIntModule (AlgebraicClosure k) = Algebra.toModule",
"after_state": "No Goals!"
}
] |
example :
(AddCommGroup.toNatModule : Module ℕ (SplittingField f)) =
@Algebra.toModule _ _ _ _ (SplittingField.algebra' f) := by
with_reducible_and_instances rfl
|
/root/DuelModelResearch/mathlib4/MathlibTest/instance_diamonds/FieldTheory/SplittingField/Construction.lean
|
{
"open": [
"Polynomial"
],
"variables": [
"{F : Type u} {K : Type v} {L : Type w}",
"[Field K] [Field L] [Field F]",
"(f : K[X])"
]
}
|
[
{
"line": "with_reducible_and_instances rfl",
"before_state": "F : Type u\nK : Type v\nL : Type w\ninst✝² : Field K\ninst✝¹ : Field L\ninst✝ : Field F\nf : K[X]\n⊢ AddCommGroup.toNatModule = Algebra.toModule",
"after_state": "No Goals!"
},
{
"line": "rfl",
"before_state": "F : Type u\nK : Type v\nL : Type w\ninst✝² : Field K\ninst✝¹ : Field L\ninst✝ : Field F\nf : K[X]\n⊢ AddCommGroup.toNatModule = Algebra.toModule",
"after_state": "No Goals!"
},
{
"line": "eq_refl",
"before_state": "F : Type u\nK : Type v\nL : Type w\ninst✝² : Field K\ninst✝¹ : Field L\ninst✝ : Field F\nf : K[X]\n⊢ AddCommGroup.toNatModule = Algebra.toModule",
"after_state": "No Goals!"
}
] |
example :
(AddCommGroup.toIntModule _ : Module ℤ (SplittingField f)) =
@Algebra.toModule _ _ _ _ (SplittingField.algebra' f) := by
with_reducible_and_instances rfl
|
/root/DuelModelResearch/mathlib4/MathlibTest/instance_diamonds/FieldTheory/SplittingField/Construction.lean
|
{
"open": [
"Polynomial"
],
"variables": [
"{F : Type u} {K : Type v} {L : Type w}",
"[Field K] [Field L] [Field F]",
"(f : K[X])"
]
}
|
[
{
"line": "with_reducible_and_instances rfl",
"before_state": "F : Type u\nK : Type v\nL : Type w\ninst✝² : Field K\ninst✝¹ : Field L\ninst✝ : Field F\nf : K[X]\n⊢ AddCommGroup.toIntModule f.SplittingField = Algebra.toModule",
"after_state": "No Goals!"
},
{
"line": "rfl",
"before_state": "F : Type u\nK : Type v\nL : Type w\ninst✝² : Field K\ninst✝¹ : Field L\ninst✝ : Field F\nf : K[X]\n⊢ AddCommGroup.toIntModule f.SplittingField = Algebra.toModule",
"after_state": "No Goals!"
},
{
"line": "eq_refl",
"before_state": "F : Type u\nK : Type v\nL : Type w\ninst✝² : Field K\ninst✝¹ : Field L\ninst✝ : Field F\nf : K[X]\n⊢ AddCommGroup.toIntModule f.SplittingField = Algebra.toModule",
"after_state": "No Goals!"
}
] |
lemma foo (a b : ℕ) (ha : a ≠ 0) (hb : b ≠ 0) : a * b ≠ 0 := by
apply_rules [mul_ne_zero]
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/instances.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "apply_rules [mul_ne_zero]",
"before_state": "a b : ℕ\nha : a ≠ 0\nhb : b ≠ 0\n⊢ a * b ≠ 0",
"after_state": "No Goals!"
}
] |
example (h : Nat) : Nat := by solve_by_elim
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "solve_by_elim",
"before_state": "h : ℕ\n⊢ ℕ",
"after_state": "No Goals!"
}
] |
example {α β : Type} (f : α → β) (a : α) : β := by solve_by_elim
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "solve_by_elim",
"before_state": "α β : Type\nf : α → β\na : α\n⊢ β",
"after_state": "No Goals!"
}
] |
example {α β : Type} (f : α → α → β) (a : α) : β := by solve_by_elim
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "solve_by_elim",
"before_state": "α β : Type\nf : α → α → β\na : α\n⊢ β",
"after_state": "No Goals!"
}
] |
example {α β γ : Type} (f : α → β) (g : β → γ) (a : α) : γ := by solve_by_elim
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "solve_by_elim",
"before_state": "α β γ : Type\nf : α → β\ng : β → γ\na : α\n⊢ γ",
"after_state": "No Goals!"
}
] |
example {α β γ : Type} (_f : α → β) (g : β → γ) (b : β) : γ := by solve_by_elim
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "solve_by_elim",
"before_state": "α β γ : Type\n_f : α → β\ng : β → γ\nb : β\n⊢ γ",
"after_state": "No Goals!"
}
] |
example {α : Nat → Type} (f : (n : Nat) → α n → α (n+1)) (a : α 0) : α 4 := by solve_by_elim
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "solve_by_elim",
"before_state": "α : ℕ → Type\nf : (n : ℕ) → α n → α (n + 1)\na : α 0\n⊢ α 4",
"after_state": "No Goals!"
}
] |
example (h : Nat) : Nat := by solve_by_elim []
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "solve_by_elim []",
"before_state": "h : ℕ\n⊢ ℕ",
"after_state": "No Goals!"
}
] |
example {α β : Type} (f : α → β) (a : α) : β := by solve_by_elim []
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "solve_by_elim []",
"before_state": "α β : Type\nf : α → β\na : α\n⊢ β",
"after_state": "No Goals!"
}
] |
example {α β : Type} (f : α → α → β) (a : α) : β := by solve_by_elim []
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "solve_by_elim []",
"before_state": "α β : Type\nf : α → α → β\na : α\n⊢ β",
"after_state": "No Goals!"
}
] |
example {α β γ : Type} (f : α → β) (g : β → γ) (a : α) : γ := by solve_by_elim []
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "solve_by_elim []",
"before_state": "α β γ : Type\nf : α → β\ng : β → γ\na : α\n⊢ γ",
"after_state": "No Goals!"
}
] |
example {α β γ : Type} (_f : α → β) (g : β → γ) (b : β) : γ := by solve_by_elim []
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "solve_by_elim []",
"before_state": "α β γ : Type\n_f : α → β\ng : β → γ\nb : β\n⊢ γ",
"after_state": "No Goals!"
}
] |
example {α : Nat → Type} (f : (n : Nat) → α n → α (n+1)) (a : α 0) : α 4 := by solve_by_elim []
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "solve_by_elim []",
"before_state": "α : ℕ → Type\nf : (n : ℕ) → α n → α (n + 1)\na : α 0\n⊢ α 4",
"after_state": "No Goals!"
}
] |
example {α β : Type} (f : α → β) (a : α) : β := by
fail_if_success solve_by_elim [-f]
fail_if_success solve_by_elim [-a]
fail_if_success solve_by_elim only [f]
solve_by_elim
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "fail_if_success solve_by_elim [-f]",
"before_state": "α β : Type\nf : α → β\na : α\n⊢ β",
"after_state": "α β : Type\nf : α → β\na : α\n⊢ β"
},
{
"line": "solve_by_elim [-f]",
"before_state": "α β : Type\nf : α → β\na : α\n⊢ β",
"after_state": "No Goals!"
},
{
"line": "fail_if_success solve_by_elim [-a]",
"before_state": "α β : Type\nf : α → β\na : α\n⊢ β",
"after_state": "α β : Type\nf : α → β\na : α\n⊢ β"
},
{
"line": "solve_by_elim [-a]",
"before_state": "α β : Type\nf : α → β\na : α\n⊢ β",
"after_state": "No Goals!"
},
{
"line": "fail_if_success solve_by_elim only [f]",
"before_state": "α β : Type\nf : α → β\na : α\n⊢ β",
"after_state": "α β : Type\nf : α → β\na : α\n⊢ β"
},
{
"line": "solve_by_elim only [f]",
"before_state": "α β : Type\nf : α → β\na : α\n⊢ β",
"after_state": "No Goals!"
},
{
"line": "solve_by_elim",
"before_state": "α β : Type\nf : α → β\na : α\n⊢ β",
"after_state": "No Goals!"
}
] |
example {α β γ : Type} (f : α → β) (g : β → γ) (b : β) : γ := by
fail_if_success solve_by_elim [-g]
solve_by_elim [-f]
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "fail_if_success solve_by_elim [-g]",
"before_state": "α β γ : Type\nf : α → β\ng : β → γ\nb : β\n⊢ γ",
"after_state": "α β γ : Type\nf : α → β\ng : β → γ\nb : β\n⊢ γ"
},
{
"line": "solve_by_elim [-g]",
"before_state": "α β γ : Type\nf : α → β\ng : β → γ\nb : β\n⊢ γ",
"after_state": "No Goals!"
},
{
"line": "solve_by_elim [-f]",
"before_state": "α β γ : Type\nf : α → β\ng : β → γ\nb : β\n⊢ γ",
"after_state": "No Goals!"
}
] |
example (h : Nat) : Nat := by solve_by_elim only [h]
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "solve_by_elim only [h]",
"before_state": "h : ℕ\n⊢ ℕ",
"after_state": "No Goals!"
}
] |
example {α β : Type} (f : α → β) (a : α) : β := by solve_by_elim only [f, a]
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "solve_by_elim only [f, a]",
"before_state": "α β : Type\nf : α → β\na : α\n⊢ β",
"after_state": "No Goals!"
}
] |
example {α β : Type} (f : α → α → β) (a : α) : β := by solve_by_elim only [f, a]
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "solve_by_elim only [f, a]",
"before_state": "α β : Type\nf : α → α → β\na : α\n⊢ β",
"after_state": "No Goals!"
}
] |
example {α β γ : Type} (f : α → β) (g : β → γ) (a : α) : γ := by solve_by_elim only [f, g, a]
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "solve_by_elim only [f, g, a]",
"before_state": "α β γ : Type\nf : α → β\ng : β → γ\na : α\n⊢ γ",
"after_state": "No Goals!"
}
] |
example {α β γ : Type} (_f : α → β) (g : β → γ) (b : β) : γ := by solve_by_elim only [g, b]
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "solve_by_elim only [g, b]",
"before_state": "α β γ : Type\n_f : α → β\ng : β → γ\nb : β\n⊢ γ",
"after_state": "No Goals!"
}
] |
example {α : Nat → Type} (f : (n : Nat) → α n → α (n+1)) (a : α 0) : α 4 := by
solve_by_elim only [f, a]
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "solve_by_elim only [f, a]",
"before_state": "α : ℕ → Type\nf : (n : ℕ) → α n → α (n + 1)\na : α 0\n⊢ α 4",
"after_state": "No Goals!"
}
] |
example (h₁ h₂ : False) : Empty := by
-- 'It doesn't make sense to remove local hypotheses when using `only` without `*`.'
fail_if_success solve_by_elim only [-h₁]
-- 'It does make sense to use `*` without `only`.'
fail_if_success solve_by_elim [*, -h₁]
solve_by_elim only [*, -h₁]
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "fail_if_success\n solve_by_elim only [-h₁]\n -- 'It does make sense to use `*` without `only`.'",
"before_state": "h₁ h₂ : False\n⊢ Empty",
"after_state": "h₁ h₂ : False\n⊢ Empty"
},
{
"line": "solve_by_elim only [-h₁]\n -- 'It does make sense to use `*` without `only`.'",
"before_state": "h₁ h₂ : False\n⊢ Empty",
"after_state": "h₁ h₂ : False\n⊢ Empty"
},
{
"line": "fail_if_success solve_by_elim [*, -h₁]",
"before_state": "h₁ h₂ : False\n⊢ Empty",
"after_state": "h₁ h₂ : False\n⊢ Empty"
},
{
"line": "solve_by_elim [*, -h₁]",
"before_state": "h₁ h₂ : False\n⊢ Empty",
"after_state": "h₁ h₂ : False\n⊢ Empty"
},
{
"line": "solve_by_elim only [*, -h₁]",
"before_state": "h₁ h₂ : False\n⊢ Empty",
"after_state": "No Goals!"
}
] |
example (P₁ P₂ : α → Prop) (f : ∀ (a : α), P₁ a → P₂ a → β)
(a : α) (ha₁ : P₁ a) (ha₂ : P₂ a) : β := by
solve_by_elim
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "solve_by_elim",
"before_state": "α : Sort ?u.26\nβ : Sort ?u.40\nP₁ P₂ : α → Prop\nf : (a : α) → P₁ a → P₂ a → β\na : α\nha₁ : P₁ a\nha₂ : P₂ a\n⊢ β",
"after_state": "No Goals!"
}
] |
example {X : Type} (x : X) : x = x := by
fail_if_success solve_by_elim (config := {constructor := false}) only -- needs the `rfl` lemma
solve_by_elim
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "fail_if_success\n solve_by_elim (config := { constructor := false }) only\n -- needs the `rfl` lemma",
"before_state": "X : Type\nx : X\n⊢ x = x",
"after_state": "X : Type\nx : X\n⊢ x = x"
},
{
"line": "solve_by_elim (config := { constructor := false }) only\n -- needs the `rfl` lemma",
"before_state": "X : Type\nx : X\n⊢ x = x",
"after_state": "No Goals!"
},
{
"line": "solve_by_elim",
"before_state": "X : Type\nx : X\n⊢ x = x",
"after_state": "No Goals!"
}
] |
example {X : Type} (x y : X) (p : Prop) (h : x = x → y = y → p) : p := by solve_by_elim
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "solve_by_elim",
"before_state": "X : Type\nx y : X\np : Prop\nh : x = x → y = y → p\n⊢ p",
"after_state": "No Goals!"
}
] |
example : True := by
fail_if_success solve_by_elim (config := {constructor := false}) only -- needs the `trivial` lemma
solve_by_elim
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "fail_if_success\n solve_by_elim (config := { constructor := false }) only\n -- needs the `trivial` lemma",
"before_state": "⊢ True",
"after_state": "⊢ True"
},
{
"line": "solve_by_elim (config := { constructor := false }) only\n -- needs the `trivial` lemma",
"before_state": "⊢ True",
"after_state": "No Goals!"
},
{
"line": "solve_by_elim",
"before_state": "⊢ True",
"after_state": "No Goals!"
}
] |
example : True := by
-- uses the `trivial` lemma, which should now be removed from the default set:
solve_by_elim (config := {constructor := false})
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "solve_by_elim (config := { constructor := false })",
"before_state": "⊢ True",
"after_state": "No Goals!"
}
] |
example : True := by
solve_by_elim only -- uses the constructor discharger.
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "solve_by_elim only\n -- uses the constructor discharger.",
"before_state": "⊢ True",
"after_state": "No Goals!"
}
] |
example (P₁ P₂ : α → Prop) (f : ∀ (a: α), P₁ a → P₂ a → β)
(a : α) (_ha₁ : P₁ a)
(a' : α) (ha'₁ : P₁ a') (ha'₂ : P₂ a') : β := by
fail_if_success solve_by_elim (config := .noBackTracking)
solve_by_elim
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "fail_if_success solve_by_elim (config := .noBackTracking)",
"before_state": "α : Sort ?u.26\nβ : Sort ?u.40\nP₁ P₂ : α → Prop\nf : (a : α) → P₁ a → P₂ a → β\na : α\n_ha₁ : P₁ a\na' : α\nha'₁ : P₁ a'\nha'₂ : P₂ a'\n⊢ β",
"after_state": "α : Sort ?u.26\nβ : Sort ?u.40\nP₁ P₂ : α → Prop\nf : (a : α) → P₁ a → P₂ a → β\na : α\n_ha₁ : P₁ a\na' : α\nha'₁ : P₁ a'\nha'₂ : P₂ a'\n⊢ β"
},
{
"line": "solve_by_elim (config := .noBackTracking)",
"before_state": "α : Sort ?u.26\nβ : Sort ?u.40\nP₁ P₂ : α → Prop\nf : (a : α) → P₁ a → P₂ a → β\na : α\n_ha₁ : P₁ a\na' : α\nha'₁ : P₁ a'\nha'₂ : P₂ a'\n⊢ β",
"after_state": "α : Sort ?u.26\nβ : Sort ?u.40\nP₁ P₂ : α → Prop\nf : (a : α) → P₁ a → P₂ a → β\na : α\n_ha₁ : P₁ a\na' : α\nha'₁ : P₁ a'\nha'₂ : P₂ a'\n⊢ β"
},
{
"line": "solve_by_elim",
"before_state": "α : Sort ?u.26\nβ : Sort ?u.40\nP₁ P₂ : α → Prop\nf : (a : α) → P₁ a → P₂ a → β\na : α\n_ha₁ : P₁ a\na' : α\nha'₁ : P₁ a'\nha'₂ : P₂ a'\n⊢ β",
"after_state": "No Goals!"
}
] |
example {α : Type} {a b : α → Prop} (h₀ : b = a) (y : α) : a y = b y := by
fail_if_success solve_by_elim (config := {symm := false})
solve_by_elim
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "fail_if_success solve_by_elim (config := { symm := false })",
"before_state": "α : Type\na b : α → Prop\nh₀ : b = a\ny : α\n⊢ a y = b y",
"after_state": "α : Type\na b : α → Prop\nh₀ : b = a\ny : α\n⊢ a y = b y"
},
{
"line": "solve_by_elim (config := { symm := false })",
"before_state": "α : Type\na b : α → Prop\nh₀ : b = a\ny : α\n⊢ a y = b y",
"after_state": "No Goals!"
},
{
"line": "solve_by_elim",
"before_state": "α : Type\na b : α → Prop\nh₀ : b = a\ny : α\n⊢ a y = b y",
"after_state": "No Goals!"
}
] |
example (P : True → False) : 3 = 7 := by
fail_if_success solve_by_elim (config := {exfalso := false})
solve_by_elim
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "fail_if_success solve_by_elim (config := { exfalso := false })",
"before_state": "P : True → False\n⊢ 3 = 7",
"after_state": "P : True → False\n⊢ 3 = 7"
},
{
"line": "solve_by_elim (config := { exfalso := false })",
"before_state": "P : True → False\n⊢ 3 = 7",
"after_state": "P : True → False\n⊢ 3 = 7"
},
{
"line": "solve_by_elim",
"before_state": "P : True → False\n⊢ 3 = 7",
"after_state": "No Goals!"
}
] |
example (n : Nat) : Nat × Nat := by
constructor
solve_by_elim
solve_by_elim
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "constructor",
"before_state": "n : ℕ\n⊢ ℕ × ℕ",
"after_state": "case fst\nn : ℕ\n⊢ ℕ\n---\ncase snd\nn : ℕ\n⊢ ℕ"
},
{
"line": "solve_by_elim",
"before_state": "case fst\nn : ℕ\n⊢ ℕ\n---\ncase snd\nn : ℕ\n⊢ ℕ",
"after_state": "case snd\nn : ℕ\n⊢ ℕ"
},
{
"line": "solve_by_elim",
"before_state": "case snd\nn : ℕ\n⊢ ℕ",
"after_state": "No Goals!"
}
] |
example (n : Nat) : Nat × Nat := by
constructor
solve_by_elim*
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "constructor",
"before_state": "n : ℕ\n⊢ ℕ × ℕ",
"after_state": "case fst\nn : ℕ\n⊢ ℕ\n---\ncase snd\nn : ℕ\n⊢ ℕ"
},
{
"line": "solve_by_elim*",
"before_state": "case fst\nn : ℕ\n⊢ ℕ\n---\ncase snd\nn : ℕ\n⊢ ℕ",
"after_state": "No Goals!"
}
] |
example (n m : Nat) (f : Nat → Nat → Prop) (h : f n m) : ∃ p : Nat × Nat, f p.1 p.2 := by
fconstructor
fconstructor
solve_by_elim*
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "fconstructor",
"before_state": "n m : ℕ\nf : ℕ → ℕ → Prop\nh : f n m\n⊢ ∃ p, f p.1 p.2",
"after_state": "case w\nn m : ℕ\nf : ℕ → ℕ → Prop\nh : f n m\n⊢ ℕ × ℕ\n---\ncase h\nn m : ℕ\nf : ℕ → ℕ → Prop\nh : f n m\n⊢ f ?w.1 ?w.2"
},
{
"line": "fconstructor",
"before_state": "case w\nn m : ℕ\nf : ℕ → ℕ → Prop\nh : f n m\n⊢ ℕ × ℕ\n---\ncase h\nn m : ℕ\nf : ℕ → ℕ → Prop\nh : f n m\n⊢ f ?w.1 ?w.2",
"after_state": "case w.fst\nn m : ℕ\nf : ℕ → ℕ → Prop\nh : f n m\n⊢ ℕ\n---\ncase w.snd\nn m : ℕ\nf : ℕ → ℕ → Prop\nh : f n m\n⊢ ℕ\n---\ncase h\nn m : ℕ\nf : ℕ → ℕ → Prop\nh : f n m\n⊢ f (?w.fst, ?w.snd).1 (?w.fst, ?w.snd).2"
},
{
"line": "solve_by_elim*",
"before_state": "case w.fst\nn m : ℕ\nf : ℕ → ℕ → Prop\nh : f n m\n⊢ ℕ\n---\ncase w.snd\nn m : ℕ\nf : ℕ → ℕ → Prop\nh : f n m\n⊢ ℕ\n---\ncase h\nn m : ℕ\nf : ℕ → ℕ → Prop\nh : f n m\n⊢ f (?w.fst, ?w.snd).1 (?w.fst, ?w.snd).2",
"after_state": "No Goals!"
}
] |
example (P : Nat → Type) (f : {n : Nat} → P n) : P 2 × P 3 := by
fconstructor
solve_by_elim* only [f]
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "fconstructor",
"before_state": "P : ℕ → Type\nf : {n : ℕ} → P n\n⊢ P 2 × P 3",
"after_state": "case fst\nP : ℕ → Type\nf : {n : ℕ} → P n\n⊢ P 2\n---\ncase snd\nP : ℕ → Type\nf : {n : ℕ} → P n\n⊢ P 3"
},
{
"line": "solve_by_elim* only [f]",
"before_state": "case fst\nP : ℕ → Type\nf : {n : ℕ} → P n\n⊢ P 2\n---\ncase snd\nP : ℕ → Type\nf : {n : ℕ} → P n\n⊢ P 3",
"after_state": "No Goals!"
}
] |
example : 6 = 6 ∧ [7] = [7] := by
fconstructor
solve_by_elim* only [@rfl _]
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "fconstructor",
"before_state": "⊢ 6 = 6 ∧ [7] = [7]",
"after_state": "case left\n⊢ 6 = 6\n---\ncase right\n⊢ [7] = [7]"
},
{
"line": "solve_by_elim* only [@rfl _]",
"before_state": "case left\n⊢ 6 = 6\n---\ncase right\n⊢ [7] = [7]",
"after_state": "No Goals!"
}
] |
example (f g : Nat → Prop) : (∃ k : Nat, f k) ∨ (∃ k : Nat, g k) ↔ ∃ k : Nat, f k ∨ g k := by
fconstructor
rintro (⟨n, fn⟩ | ⟨n, gn⟩)
pick_goal 3
rintro ⟨n, hf | hg⟩
solve_by_elim* (config := {maxDepth := 13}) [Or.inl, Or.inr, Exists.intro]
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "fconstructor",
"before_state": "f g : ℕ → Prop\n⊢ ((∃ k, f k) ∨ ∃ k, g k) ↔ ∃ k, f k ∨ g k",
"after_state": "case mp\nf g : ℕ → Prop\n⊢ ((∃ k, f k) ∨ ∃ k, g k) → ∃ k, f k ∨ g k\n---\ncase mpr\nf g : ℕ → Prop\n⊢ (∃ k, f k ∨ g k) → (∃ k, f k) ∨ ∃ k, g k"
},
{
"line": "rintro (⟨n, fn⟩ | ⟨n, gn⟩)",
"before_state": "case mp\nf g : ℕ → Prop\n⊢ ((∃ k, f k) ∨ ∃ k, g k) → ∃ k, f k ∨ g k\n---\ncase mpr\nf g : ℕ → Prop\n⊢ (∃ k, f k ∨ g k) → (∃ k, f k) ∨ ∃ k, g k",
"after_state": "case mp.inl.intro\nf g : ℕ → Prop\nn : ℕ\nfn : f n\n⊢ ∃ k, f k ∨ g k\n---\ncase mp.inr.intro\nf g : ℕ → Prop\nn : ℕ\ngn : g n\n⊢ ∃ k, f k ∨ g k\n---\ncase mpr\nf g : ℕ → Prop\n⊢ (∃ k, f k ∨ g k) → (∃ k, f k) ∨ ∃ k, g k"
},
{
"line": "pick_goal 3",
"before_state": "case mp.inl.intro\nf g : ℕ → Prop\nn : ℕ\nfn : f n\n⊢ ∃ k, f k ∨ g k\n---\ncase mp.inr.intro\nf g : ℕ → Prop\nn : ℕ\ngn : g n\n⊢ ∃ k, f k ∨ g k\n---\ncase mpr\nf g : ℕ → Prop\n⊢ (∃ k, f k ∨ g k) → (∃ k, f k) ∨ ∃ k, g k",
"after_state": "case mpr\nf g : ℕ → Prop\n⊢ (∃ k, f k ∨ g k) → (∃ k, f k) ∨ ∃ k, g k\n---\ncase mp.inl.intro\nf g : ℕ → Prop\nn : ℕ\nfn : f n\n⊢ ∃ k, f k ∨ g k\n---\ncase mp.inr.intro\nf g : ℕ → Prop\nn : ℕ\ngn : g n\n⊢ ∃ k, f k ∨ g k"
},
{
"line": "rintro ⟨n, hf | hg⟩",
"before_state": "case mpr\nf g : ℕ → Prop\n⊢ (∃ k, f k ∨ g k) → (∃ k, f k) ∨ ∃ k, g k\n---\ncase mp.inl.intro\nf g : ℕ → Prop\nn : ℕ\nfn : f n\n⊢ ∃ k, f k ∨ g k\n---\ncase mp.inr.intro\nf g : ℕ → Prop\nn : ℕ\ngn : g n\n⊢ ∃ k, f k ∨ g k",
"after_state": "case mpr.intro.inl\nf g : ℕ → Prop\nn : ℕ\nhf : f n\n⊢ (∃ k, f k) ∨ ∃ k, g k\n---\ncase mpr.intro.inr\nf g : ℕ → Prop\nn : ℕ\nhg : g n\n⊢ (∃ k, f k) ∨ ∃ k, g k\n---\ncase mp.inl.intro\nf g : ℕ → Prop\nn : ℕ\nfn : f n\n⊢ ∃ k, f k ∨ g k\n---\ncase mp.inr.intro\nf g : ℕ → Prop\nn : ℕ\ngn : g n\n⊢ ∃ k, f k ∨ g k"
},
{
"line": "solve_by_elim* (config := { maxDepth := 13 }) [Or.inl, Or.inr, Exists.intro]",
"before_state": "case mpr.intro.inl\nf g : ℕ → Prop\nn : ℕ\nhf : f n\n⊢ (∃ k, f k) ∨ ∃ k, g k\n---\ncase mpr.intro.inr\nf g : ℕ → Prop\nn : ℕ\nhg : g n\n⊢ (∃ k, f k) ∨ ∃ k, g k\n---\ncase mp.inl.intro\nf g : ℕ → Prop\nn : ℕ\nfn : f n\n⊢ ∃ k, f k ∨ g k\n---\ncase mp.inr.intro\nf g : ℕ → Prop\nn : ℕ\ngn : g n\n⊢ ∃ k, f k ∨ g k",
"after_state": "No Goals!"
}
] |
example (P : Prop) : P → P := by
fail_if_success solve_by_elim (config := {intro := false})
solve_by_elim
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "fail_if_success solve_by_elim (config := { intro := false })",
"before_state": "P : Prop\n⊢ P → P",
"after_state": "P : Prop\n⊢ P → P"
},
{
"line": "solve_by_elim (config := { intro := false })",
"before_state": "P : Prop\n⊢ P → P",
"after_state": "No Goals!"
},
{
"line": "solve_by_elim",
"before_state": "P : Prop\n⊢ P → P",
"after_state": "No Goals!"
}
] |
example (P Q : Prop) : P ∧ Q → P ∧ Q := by
solve_by_elim
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "solve_by_elim",
"before_state": "P Q : Prop\n⊢ P ∧ Q → P ∧ Q",
"after_state": "No Goals!"
}
] |
example {a b : Type} (h₀ : a → b) (h₁ : a) : b := by
apply_assumption
apply_assumption
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "apply_assumption",
"before_state": "a b : Type\nh₀ : a → b\nh₁ : a\n⊢ b",
"after_state": "a b : Type\nh₀ : a → b\nh₁ : a\n⊢ a"
},
{
"line": "apply_assumption",
"before_state": "a b : Type\nh₀ : a → b\nh₁ : a\n⊢ a",
"after_state": "No Goals!"
}
] |
example {α : Type} {p : α → Prop} (h₀ : ∀ x, p x) (y : α) : p y := by
apply_assumption
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "apply_assumption",
"before_state": "α : Type\np : α → Prop\nh₀ : ∀ (x : α), p x\ny : α\n⊢ p y",
"after_state": "No Goals!"
}
] |
example (a b : α) (h : b = a) : a = b := by
fail_if_success apply_assumption (config := {symm := false})
apply_assumption
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "fail_if_success apply_assumption (config := { symm := false })",
"before_state": "α : Sort u_1\na b : α\nh : b = a\n⊢ a = b",
"after_state": "α : Sort u_1\na b : α\nh : b = a\n⊢ a = b"
},
{
"line": "apply_assumption (config := { symm := false })",
"before_state": "α : Sort u_1\na b : α\nh : b = a\n⊢ a = b",
"after_state": "No Goals!"
},
{
"line": "apply_assumption",
"before_state": "α : Sort u_1\na b : α\nh : b = a\n⊢ a = b",
"after_state": "No Goals!"
}
] |
example {P Q : Prop} (p : P) (q : Q) (h : P → ¬ Q) : Nat := by
fail_if_success apply_assumption (config := {exfalso := false})
apply_assumption <;> assumption
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "fail_if_success apply_assumption (config := { exfalso := false })",
"before_state": "P Q : Prop\np : P\nq : Q\nh : P → ¬Q\n⊢ ℕ",
"after_state": "P Q : Prop\np : P\nq : Q\nh : P → ¬Q\n⊢ ℕ"
},
{
"line": "apply_assumption (config := { exfalso := false })",
"before_state": "P Q : Prop\np : P\nq : Q\nh : P → ¬Q\n⊢ ℕ",
"after_state": "P Q : Prop\np : P\nq : Q\nh : P → ¬Q\n⊢ ℕ"
},
{
"line": "focus\n apply_assumption\n with_annotate_state\"<;>\" skip\n all_goals assumption",
"before_state": "P Q : Prop\np : P\nq : Q\nh : P → ¬Q\n⊢ ℕ",
"after_state": "No Goals!"
},
{
"line": "apply_assumption",
"before_state": "P Q : Prop\np : P\nq : Q\nh : P → ¬Q\n⊢ ℕ",
"after_state": "case a\nP Q : Prop\np : P\nq : Q\nh : P → ¬Q\n⊢ P\n---\ncase a\nP Q : Prop\np : P\nq : Q\nh : P → ¬Q\n⊢ Q"
},
{
"line": "with_annotate_state\"<;>\" skip",
"before_state": "case a\nP Q : Prop\np : P\nq : Q\nh : P → ¬Q\n⊢ P\n---\ncase a\nP Q : Prop\np : P\nq : Q\nh : P → ¬Q\n⊢ Q",
"after_state": "case a\nP Q : Prop\np : P\nq : Q\nh : P → ¬Q\n⊢ P\n---\ncase a\nP Q : Prop\np : P\nq : Q\nh : P → ¬Q\n⊢ Q"
},
{
"line": "skip",
"before_state": "case a\nP Q : Prop\np : P\nq : Q\nh : P → ¬Q\n⊢ P\n---\ncase a\nP Q : Prop\np : P\nq : Q\nh : P → ¬Q\n⊢ Q",
"after_state": "case a\nP Q : Prop\np : P\nq : Q\nh : P → ¬Q\n⊢ P\n---\ncase a\nP Q : Prop\np : P\nq : Q\nh : P → ¬Q\n⊢ Q"
},
{
"line": "all_goals assumption",
"before_state": "case a\nP Q : Prop\np : P\nq : Q\nh : P → ¬Q\n⊢ P\n---\ncase a\nP Q : Prop\np : P\nq : Q\nh : P → ¬Q\n⊢ Q",
"after_state": "No Goals!"
},
{
"line": "assumption",
"before_state": "case a\nP Q : Prop\np : P\nq : Q\nh : P → ¬Q\n⊢ P",
"after_state": "No Goals!"
},
{
"line": "assumption",
"before_state": "case a\nP Q : Prop\np : P\nq : Q\nh : P → ¬Q\n⊢ Q",
"after_state": "No Goals!"
}
] |
example : 5 ≤ 7 := by
apply_rules [le_rfl]
guard_target = 5 = 7
exact mySorry
|
/root/DuelModelResearch/mathlib4/MathlibTest/solve_by_elim/basic.lean
|
{
"open": [],
"variables": []
}
|
[
{
"line": "apply_rules [le_rfl]",
"before_state": "⊢ 5 ≤ 7",
"after_state": "No Goals!"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.