fact stringlengths 12 2.2k | type stringclasses 4 values | library stringclasses 3 values | imports listlengths 1 10 | filename stringclasses 26 values | symbolic_name stringlengths 2 29 | docstring stringclasses 9 values |
|---|---|---|---|---|---|---|
arrowIntroductionBottom {A B : Prop} : A → B := by intro a sorry | theorem | _examples | [
"import Mathlib.Data.Nat.Prime.Basic",
"import Mathlib.Data.List.Chain",
"import Mathlib.Tactic.Linarith",
"import Mathlib.Data.Set.Basic",
"import Mathlib.Data.Finset.Fold",
"import Mathlib.Algebra.GCDMonoid.Multiset",
"import Lean",
"import Paperproof"
] | _examples/demos/NaturalDeduction.lean | arrowIntroductionBottom | null |
arrowEliminationTop {A B : Prop} (a : A) (ab : A → B) : OurGoal := by let h := ab a sorry | theorem | _examples | [
"import Mathlib.Data.Nat.Prime.Basic",
"import Mathlib.Data.List.Chain",
"import Mathlib.Tactic.Linarith",
"import Mathlib.Data.Set.Basic",
"import Mathlib.Data.Finset.Fold",
"import Mathlib.Algebra.GCDMonoid.Multiset",
"import Lean",
"import Paperproof"
] | _examples/demos/NaturalDeduction.lean | arrowEliminationTop | null |
arrowEliminationBottom {A B : Prop} (a : A) : B := by revert a sorry -- THE UNIVERSAL QUANTIFIER | theorem | _examples | [
"import Mathlib.Data.Nat.Prime.Basic",
"import Mathlib.Data.List.Chain",
"import Mathlib.Tactic.Linarith",
"import Mathlib.Data.Set.Basic",
"import Mathlib.Data.Finset.Fold",
"import Mathlib.Algebra.GCDMonoid.Multiset",
"import Lean",
"import Paperproof"
] | _examples/demos/NaturalDeduction.lean | arrowEliminationBottom | null |
forallIntroductionBottom {α : Type} {A : α → Prop} : ∀ y, A y := by intro x sorry | theorem | _examples | [
"import Mathlib.Data.Nat.Prime.Basic",
"import Mathlib.Data.List.Chain",
"import Mathlib.Tactic.Linarith",
"import Mathlib.Data.Set.Basic",
"import Mathlib.Data.Finset.Fold",
"import Mathlib.Algebra.GCDMonoid.Multiset",
"import Lean",
"import Paperproof"
] | _examples/demos/NaturalDeduction.lean | forallIntroductionBottom | null |
forallEliminationTop {α : Type} {A : α → Prop} (h : ∀ x, A x) (t : α) : OurGoal := by let s := h t sorry -- Corresponding Top & Bottom rules are hard to achieve with tactics, there are no tactics for turning free vars into foralls afaik -- THE EXISTENTIAL QUANTIFIER | theorem | _examples | [
"import Mathlib.Data.Nat.Prime.Basic",
"import Mathlib.Data.List.Chain",
"import Mathlib.Tactic.Linarith",
"import Mathlib.Data.Set.Basic",
"import Mathlib.Data.Finset.Fold",
"import Mathlib.Algebra.GCDMonoid.Multiset",
"import Lean",
"import Paperproof"
] | _examples/demos/NaturalDeduction.lean | forallEliminationTop | null |
existsIntroductionTop {α : Type} {A : α → Prop} {t: α} (h : A t) : OurGoal := by have h2 : ∃ x, A x := Exists.intro t h sorry | theorem | _examples | [
"import Mathlib.Data.Nat.Prime.Basic",
"import Mathlib.Data.List.Chain",
"import Mathlib.Tactic.Linarith",
"import Mathlib.Data.Set.Basic",
"import Mathlib.Data.Finset.Fold",
"import Mathlib.Algebra.GCDMonoid.Multiset",
"import Lean",
"import Paperproof"
] | _examples/demos/NaturalDeduction.lean | existsIntroductionTop | null |
existsIntroductionBottom {α : Type} {A : α → Prop} {t: α} : ∃ x, A x := by apply Exists.intro (w := t) sorry | theorem | _examples | [
"import Mathlib.Data.Nat.Prime.Basic",
"import Mathlib.Data.List.Chain",
"import Mathlib.Tactic.Linarith",
"import Mathlib.Data.Set.Basic",
"import Mathlib.Data.Finset.Fold",
"import Mathlib.Algebra.GCDMonoid.Multiset",
"import Lean",
"import Paperproof"
] | _examples/demos/NaturalDeduction.lean | existsIntroductionBottom | null |
existsEliminationTop {α : Type} {A : α → Prop} (h : ∃ x, A x) : OurGoal := by cases' h with y h1 sorry | theorem | _examples | [
"import Mathlib.Data.Nat.Prime.Basic",
"import Mathlib.Data.List.Chain",
"import Mathlib.Tactic.Linarith",
"import Mathlib.Data.Set.Basic",
"import Mathlib.Data.Finset.Fold",
"import Mathlib.Algebra.GCDMonoid.Multiset",
"import Lean",
"import Paperproof"
] | _examples/demos/NaturalDeduction.lean | existsEliminationTop | null |
existsEliminationBottom {α : Type} {A : α → Prop} (h : ∃ x, A x) (t : α) : A t := by apply Exists.elim (p := A) all_goals sorry -- WILD versions are veridical reproduction of what we see in logic textbooks. In lean we'll be using normal versions though. | theorem | _examples | [
"import Mathlib.Data.Nat.Prime.Basic",
"import Mathlib.Data.List.Chain",
"import Mathlib.Tactic.Linarith",
"import Mathlib.Data.Set.Basic",
"import Mathlib.Data.Finset.Fold",
"import Mathlib.Algebra.GCDMonoid.Multiset",
"import Lean",
"import Paperproof"
] | _examples/demos/NaturalDeduction.lean | existsEliminationBottom | null |
existsEliminationTopWILD {α : Type} {B : Prop} {A : α → Prop} (h : ∃ x, A x) (hi : ∀ y, A y → B) : OurGoal := by cases' h with s h2 let h3 := hi s h2 sorry | theorem | _examples | [
"import Mathlib.Data.Nat.Prime.Basic",
"import Mathlib.Data.List.Chain",
"import Mathlib.Tactic.Linarith",
"import Mathlib.Data.Set.Basic",
"import Mathlib.Data.Finset.Fold",
"import Mathlib.Algebra.GCDMonoid.Multiset",
"import Lean",
"import Paperproof"
] | _examples/demos/NaturalDeduction.lean | existsEliminationTopWILD | null |
existsEliminationBottomWILD {α : Type} {A : α → Prop} {B: Prop} : B := by apply Exists.elim (p := A) sorry intro y sorry --------- NATURAL DEDUCTION: full-fledged theorems --------- -- The natural deduction trees accompanying these proofs can be seen in "Logic and Proof" (Jeremy Avigad, Robert Y. Lewis, Floris van Doorn) textbook. -- We can interpret the natural deduction tree as either page66_evenOdd_TOP or page66_evenOdd_BOTTOM | theorem | _examples | [
"import Mathlib.Data.Nat.Prime.Basic",
"import Mathlib.Data.List.Chain",
"import Mathlib.Tactic.Linarith",
"import Mathlib.Data.Set.Basic",
"import Mathlib.Data.Finset.Fold",
"import Mathlib.Algebra.GCDMonoid.Multiset",
"import Lean",
"import Paperproof"
] | _examples/demos/NaturalDeduction.lean | existsEliminationBottomWILD | null |
page66_evenOdd_TOP {even : ℕ → Prop} {odd : ℕ → Prop} (h1: ∀n, (¬ even n → odd n)) : ∀ n, (even n) ∨ (odd n) := by intro x have h := Classical.em (even x) cases' h with hi hello left exact hi right exact h1 x hello | theorem | _examples | [
"import Mathlib.Data.Nat.Prime.Basic",
"import Mathlib.Data.List.Chain",
"import Mathlib.Tactic.Linarith",
"import Mathlib.Data.Set.Basic",
"import Mathlib.Data.Finset.Fold",
"import Mathlib.Algebra.GCDMonoid.Multiset",
"import Lean",
"import Paperproof"
] | _examples/demos/NaturalDeduction.lean | page66_evenOdd_TOP | null |
page66_evenOdd_BOTTOM {even : ℕ → Prop} {odd : ℕ → Prop} (h1: ∀n, (¬ even n → odd n)) : ∀ n, (even n) ∨ (odd n) := by intro x have h := Classical.em apply Or.elim (a := even x) (b := ¬ even x) apply h intro hi left exact hi intro hello right exact h1 x hello | theorem | _examples | [
"import Mathlib.Data.Nat.Prime.Basic",
"import Mathlib.Data.List.Chain",
"import Mathlib.Tactic.Linarith",
"import Mathlib.Data.Set.Basic",
"import Mathlib.Data.Finset.Fold",
"import Mathlib.Algebra.GCDMonoid.Multiset",
"import Lean",
"import Paperproof"
] | _examples/demos/NaturalDeduction.lean | page66_evenOdd_BOTTOM | null |
fake_mean_value_theorem {i1 i2 : ℝ} (f : ℝ → ℝ) (h : i1 < i2) : ∃ c ∈ Set.Icc i1 i2, deriv f c = (f i2 - f i1) / (i2 - i1) := by sorry | theorem | _examples | [
"import Mathlib.Data.Set.Basic",
"import Mathlib.Algebra.BigOperators.Fin",
"import Mathlib.Tactic.GCongr",
"import Paperproof",
"import Mathlib.Data.Real.Basic",
"import Mathlib.Analysis.Calculus.Deriv.Basic",
"import Mathlib.Tactic.Cases",
"import Mathlib.Algebra.Order.Field.Basic"
] | _examples/demos/NaturalLanguage.lean | fake_mean_value_theorem | null |
interval_child { a b c i1 i2 : ℝ } (aInI: a ∈ Set.Icc i1 i2) (bInI: b ∈ Set.Icc i1 i2) (cInAB: c ∈ Set.Icc a b) : c ∈ Set.Icc i1 i2 := by let abInI := Set.Icc_subset_Icc aInI.1 bInI.2 exact Set.mem_of_mem_of_subset cInAB abInI | theorem | _examples | [
"import Mathlib.Data.Set.Basic",
"import Mathlib.Algebra.BigOperators.Fin",
"import Mathlib.Tactic.GCongr",
"import Paperproof",
"import Mathlib.Data.Real.Basic",
"import Mathlib.Analysis.Calculus.Deriv.Basic",
"import Mathlib.Tactic.Cases",
"import Mathlib.Algebra.Order.Field.Basic"
] | _examples/demos/NaturalLanguage.lean | interval_child | null |
posTop {n m : ℝ} (dPos: n > 0) (divPos: m / n > 0) : m > 0 := by exact (div_pos_iff_of_pos_right dPos).mp divPos | theorem | _examples | [
"import Mathlib.Data.Set.Basic",
"import Mathlib.Algebra.BigOperators.Fin",
"import Mathlib.Tactic.GCongr",
"import Paperproof",
"import Mathlib.Data.Real.Basic",
"import Mathlib.Analysis.Calculus.Deriv.Basic",
"import Mathlib.Tactic.Cases",
"import Mathlib.Algebra.Order.Field.Basic"
] | _examples/demos/NaturalLanguage.lean | posTop | null |
corollary_increasing_function (f : ℝ → ℝ) (i1 i2 : ℝ) : (∀ x ∈ Set.Icc i1 i2, (deriv f x) > 0) → (∀ x ∈ Set.Icc i1 i2, ∀ y ∈ Set.Icc i1 i2, x < y → f x < f y) := by intros fact a aIn b bIn ab let meanValueTheorem := fake_mean_value_theorem f ab rcases meanValueTheorem with ⟨c, ⟨ cIn, derivEquals ⟩ ⟩ have derivPos := fact c (interval_child aIn bIn cIn) have quotientPos : (f b - f a) / (b - a) > 0 := by rw [derivEquals] at derivPos exact derivPos exact lt_add_neg_iff_lt.mp (posTop (sub_pos.mpr ab) quotientPos) | theorem | _examples | [
"import Mathlib.Data.Set.Basic",
"import Mathlib.Algebra.BigOperators.Fin",
"import Mathlib.Tactic.GCongr",
"import Paperproof",
"import Mathlib.Data.Real.Basic",
"import Mathlib.Analysis.Calculus.Deriv.Basic",
"import Mathlib.Tactic.Cases",
"import Mathlib.Algebra.Order.Field.Basic"
] | _examples/demos/NaturalLanguage.lean | corollary_increasing_function | null |
simpleAnd (X: Prop) (Y: Prop) (h: X ∧ Y) : False := by rcases h with ⟨h1, h2⟩ all_goals sorry | theorem | _examples | [
"import Mathlib.Data.Nat.Prime.Basic",
"import Paperproof"
] | _examples/demos/SemanticTableaux.lean | simpleAnd | null |
simpleOr (X: Prop) (Y: Prop) (h: X ∨ Y) : False := by rcases h with h1 | h2 all_goals sorry | theorem | _examples | [
"import Mathlib.Data.Nat.Prime.Basic",
"import Paperproof"
] | _examples/demos/SemanticTableaux.lean | simpleOr | null |
simpleThen (X: Prop) (Y: Prop) (h: X → Y) : False := by rw [imp_iff_not_or] at h rcases h with h1 | h2 all_goals sorry | theorem | _examples | [
"import Mathlib.Data.Nat.Prime.Basic",
"import Paperproof"
] | _examples/demos/SemanticTableaux.lean | simpleThen | null |
simpleNotOr (X: Prop) (Y: Prop) (h: ¬(X ∨ Y)) : False := by rw [not_or] at h rcases h with ⟨h1, h2⟩ sorry | theorem | _examples | [
"import Mathlib.Data.Nat.Prime.Basic",
"import Paperproof"
] | _examples/demos/SemanticTableaux.lean | simpleNotOr | null |
simpleNotAnd (X: Prop) (Y: Prop) (h: ¬(X ∧ Y)) : False := by rw [not_and_or] at h rcases h with h1 | h2 all_goals sorry | theorem | _examples | [
"import Mathlib.Data.Nat.Prime.Basic",
"import Paperproof"
] | _examples/demos/SemanticTableaux.lean | simpleNotAnd | null |
simpleNotThen (X: Prop) (Y: Prop) (h: ¬(X → Y)) : False := by rw [Classical.not_imp] at h rcases h with ⟨h1, h2⟩ sorry | theorem | _examples | [
"import Mathlib.Data.Nat.Prime.Basic",
"import Paperproof"
] | _examples/demos/SemanticTableaux.lean | simpleNotThen | null |
simpleForall {α : Type} (φ : α → Prop) (a : α) (h: ∀ x, φ x) : False := by let h1 := h a sorry | theorem | _examples | [
"import Mathlib.Data.Nat.Prime.Basic",
"import Paperproof"
] | _examples/demos/SemanticTableaux.lean | simpleForall | null |
simpleExists {α : Type} (φ : α → Prop) (h: ∃ x, φ x) : False := by rcases h with ⟨a, h1⟩ sorry | theorem | _examples | [
"import Mathlib.Data.Nat.Prime.Basic",
"import Paperproof"
] | _examples/demos/SemanticTableaux.lean | simpleExists | null |
simpleNotExists {α : Type} (φ : α → Prop) (a : α) (h: ¬ ∃ x, φ x) : False := by rw [not_exists] at h let h1 := h a sorry | theorem | _examples | [
"import Mathlib.Data.Nat.Prime.Basic",
"import Paperproof"
] | _examples/demos/SemanticTableaux.lean | simpleNotExists | null |
simpleNotForall {α : Type} (φ : α → Prop) (h: ¬ ∀ x, φ x) : False := by rw [not_forall] at h rcases h with ⟨a, h1⟩ sorry --------- SEMANTIC TABLEAUX: full-fledged theorems --------- -- (See `https://www.umsu.de/trees/#~3(p~2q)~5(~3p~1~3q)` for semantic tableaux) | theorem | _examples | [
"import Mathlib.Data.Nat.Prime.Basic",
"import Paperproof"
] | _examples/demos/SemanticTableaux.lean | simpleNotForall | null |
deMorgan (p : Prop) (q : Prop) : ¬(p ∨ q) → (¬p ∧ ¬q) := by -- Creating 1. by_contra h1 -- Creating 2. and 3. rw [Classical.not_imp] at h1 rcases h1 with ⟨h2, h3⟩ -- Creating 4. and 5. rw [not_or] at h2 rcases h2 with ⟨h4, h5⟩ -- Creating 6. and 7. rw [not_and, imp_iff_not_or] at h3 rcases h3 with h6 | h7 -- Close the branch! exact h6 h4 -- Close the branch! exact h7 h5 -- (See `https://www.umsu.de/trees/#((p~2q)~1(q~5p))~5p` for semantic tableaux) | theorem | _examples | [
"import Mathlib.Data.Nat.Prime.Basic",
"import Paperproof"
] | _examples/demos/SemanticTableaux.lean | deMorgan | null |
manyGoals (p : Prop) (q : Prop) : ((p ∨ q) ∧ (q → p)) → p := by -- Creating 1. by_contra h1 -- Creating 2. and 3. rw [Classical.not_imp] at h1 rcases h1 with ⟨h2, h3⟩ -- Creating 4. and 5. rcases h2 with ⟨h4, h5⟩ -- Creating 6. and 7. rw [imp_iff_not_or] at h5 rcases h5 with h6 | h7 -- Creating 8. and 9. rcases h4 with h8 | h9 -- Close the branch! exact h3 h8 -- Close the branch! exact h6 h9 -- Close the branch! exact h3 h7 -- (See `https://www.umsu.de/trees/#~7x(Px~1Qx)~5~7x(Px)~1~7x(Qx)` for semantic tableaux) | theorem | _examples | [
"import Mathlib.Data.Nat.Prime.Basic",
"import Paperproof"
] | _examples/demos/SemanticTableaux.lean | manyGoals | null |
firstOrderLogic {α : Type} (P Q : α → Prop) : (∃ x, P x ∧ Q x) → (∃ x, P x) ∧ (∃ x, Q x) := by by_contra h1 -- Creating 2. and 3. rw [Classical.not_imp] at h1 rcases h1 with ⟨h2, h3⟩ -- Creating 4. rcases h2 with ⟨a, h4⟩ -- Creating 5. and 6. rcases h4 with ⟨h5, h6⟩ -- Creating 7. and 8. rw [not_and_or] at h3 rcases h3 with h7 | h8 -- Creating 9. rw [not_exists] at h7 let h9 := h7 a -- Close the branch! exact h9 h5 -- Creating 10. rw [not_exists] at h8 let h10 := h8 a -- Close the branch! exact h10 h6 | theorem | _examples | [
"import Mathlib.Data.Nat.Prime.Basic",
"import Paperproof"
] | _examples/demos/SemanticTableaux.lean | firstOrderLogic | null |
simple_ex (n m : ℕ) (h1 : ∀ {a b : Nat}, a + b = b + a) (h2 : ∀ {a b : Nat}, a = b + b): n + m = m + n := by simp [h1, h2] -- 2. `calc` is a transitivity thing -- (also: again, shows what hypotheses are used) | theorem | _examples | [
"import Mathlib.Data.Set.Basic",
"import Mathlib.Algebra.BigOperators.Fin",
"import Mathlib.Tactic.GCongr",
"import Paperproof"
] | _examples/demos/Tutorial.lean | simple_ex | null |
finFunctionFinEquiv_single11 {m n : ℕ} [NeZero m] (i : Fin n) (j : Fin m) : (finFunctionFinEquiv (Pi.single i j) : ℕ) = j * m ^ (i : ℕ) := by rw [finFunctionFinEquiv_apply, Fintype.sum_eq_single i, Pi.single_eq_same] rintro x hx rw [Pi.single_eq_of_ne hx, Fin.coe_ofNat_eq_mod, Nat.zero_mod, zero_mul] -- 5. Any `cases`/`induction` has a uniform interface namespace OurInductives variable (SomeGoal: Prop) | theorem | _examples | [
"import Mathlib.Data.Set.Basic",
"import Mathlib.Algebra.BigOperators.Fin",
"import Mathlib.Tactic.GCongr",
"import Paperproof"
] | _examples/demos/Tutorial.lean | finFunctionFinEquiv_single11 | null |
Prod (α : Type u) (β : Type v) | mk : α → β → Prod α β | inductive | _examples | [
"import Mathlib.Data.Set.Basic",
"import Mathlib.Algebra.BigOperators.Fin",
"import Mathlib.Tactic.GCongr",
"import Paperproof"
] | _examples/demos/Tutorial.lean | Prod | null |
prod (hi: Prod Nat Nat) : SomeGoal := by rcases hi with ⟨a, b⟩ sorry | theorem | _examples | [
"import Mathlib.Data.Set.Basic",
"import Mathlib.Algebra.BigOperators.Fin",
"import Mathlib.Tactic.GCongr",
"import Paperproof"
] | _examples/demos/Tutorial.lean | prod | null |
Sum (α : Type u) (β : Type v) where | inl : α → Sum α β | inr : β → Sum α β | inductive | _examples | [
"import Mathlib.Data.Set.Basic",
"import Mathlib.Algebra.BigOperators.Fin",
"import Mathlib.Tactic.GCongr",
"import Paperproof"
] | _examples/demos/Tutorial.lean | Sum | null |
sum (hi: Sum Nat Nat) : SomeGoal := by rcases hi with x | y sorry; sorry | theorem | _examples | [
"import Mathlib.Data.Set.Basic",
"import Mathlib.Algebra.BigOperators.Fin",
"import Mathlib.Tactic.GCongr",
"import Paperproof"
] | _examples/demos/Tutorial.lean | sum | null |
Random where | hi: ℕ → String → Random | hello: (2 + 2 = 4) → Random | wow: Random | inductive | _examples | [
"import Mathlib.Data.Set.Basic",
"import Mathlib.Algebra.BigOperators.Fin",
"import Mathlib.Tactic.GCongr",
"import Paperproof"
] | _examples/demos/Tutorial.lean | Random | null |
casesRandom (h: Random) : SomeGoal := by rcases h with ⟨a, b⟩ | ⟨c⟩ sorry; sorry; sorry -- 6. We can see exactly what path was taken by tactic combinators | theorem | _examples | [
"import Mathlib.Data.Set.Basic",
"import Mathlib.Algebra.BigOperators.Fin",
"import Mathlib.Tactic.GCongr",
"import Paperproof"
] | _examples/demos/Tutorial.lean | casesRandom | null |
combs (p q r : Prop) (hp : p) : (p ∨ q ∨ r) ∧ (q ∨ p ∨ r) ∧ (q ∨ r ∨ p) := by repeat (first | apply And.intro | apply Or.inl; assumption | apply Or.inr | assumption) --------------------------- OPTIONS --------------------------- -- 1. "Zoom in", "Zoom out" -- 2. "Compact Horizontally" -- 3. "Compact Tactics" (won't do anything here, but useful for mathlib) -- 4. "Hide Goal Names" -- 5. "Always Green Hypotheses" -- 6. "Collapse box" | theorem | _examples | [
"import Mathlib.Data.Set.Basic",
"import Mathlib.Algebra.BigOperators.Fin",
"import Mathlib.Tactic.GCongr",
"import Paperproof"
] | _examples/demos/Tutorial.lean | combs | null |
append_assoc {α : Type} (a b c : List α) : (a ++ b) ++ c = a ++ (b ++ c) := by induction a with | nil => simp | cons x xs ih => simp [List.cons_append, ih] | theorem | _examples | [
"import Mathlib.Data.Set.Basic",
"import Mathlib.Algebra.BigOperators.Fin",
"import Mathlib.Tactic.GCongr",
"import Paperproof"
] | _examples/demos/Tutorial.lean | append_assoc | null |
test123 (p : Prop) (hp : p) : p ∧ p := by apply And.intro exact hp exact hp -- 1st | theorem | _examples | [
"import Mathlib.Data.Set.Basic",
"import Paperproof"
] | _examples/development/Header.lean | test123 | null |
commutativityOfIntersections (s t : Set Nat) : s ∩ t = t ∩ s := by ext x apply Iff.intro rw [Set.mem_inter_iff, and_comm] | theorem | _examples | [
"import Mathlib.Tactic",
"import Paperproof"
] | _examples/development/Rw.lean | commutativityOfIntersections | null |
sss (s t : Set Nat) : s ∩ t = t ∩ s := by ext x apply Iff.intro erw [Set.mem_inter_iff, and_comm] | theorem | _examples | [
"import Mathlib.Tactic",
"import Paperproof"
] | _examples/development/Rw.lean | sss | null |
www (s t : Set Nat) : s ∩ t = t ∩ s := by ext x apply Iff.intro rw_mod_cast [Set.mem_inter_iff, and_comm] | theorem | _examples | [
"import Mathlib.Tactic",
"import Paperproof"
] | _examples/development/Rw.lean | www | null |
ddd (s t : Set Nat) : s ∩ t = t ∩ s := by ext x apply Iff.intro rwa [Set.mem_inter_iff, and_comm] | theorem | _examples | [
"import Mathlib.Tactic",
"import Paperproof"
] | _examples/development/Rw.lean | ddd | null |
TEST_encard_union_le (s t : Set α) : (s ∪ t).encard ≤ s.encard + t.encard := by rw [← encard_union_add_encard_inter]; exact le_self_add -- TEST: anonymous functions | theorem | _examples | [
"import Paperproof",
"import Mathlib.Data.Set.Card",
"import Mathlib.Tactic.Explode"
] | _examples/development/TEST.lean | TEST_encard_union_le | null |
TEST_encard_insert_of_not_mem {a : α} (has : a ∉ s) : (insert a s).encard = s.encard + 1 := by rw [← union_singleton, encard_union_eq (by simpa), encard_singleton] -- TEST: rw; apply; intro; exact | theorem | _examples | [
"import Paperproof",
"import Mathlib.Data.Set.Card",
"import Mathlib.Tactic.Explode"
] | _examples/development/TEST.lean | TEST_encard_insert_of_not_mem | null |
encard_le_encard_of_injOn (hf : MapsTo f s t) (f_inj : InjOn f s) : s.encard ≤ t.encard := by rw [← f_inj.encard_image]; apply encard_le_card; rintro _ ⟨x, hx, rfl⟩; exact hf hx -- TODO: use this code to create proper testing for our parser -- (https://github.com/leanprover/lean4/blob/bfb02be28168d05ae362d6d9a135ec93820ca1cb/src/Lean/Elab/InfoTrees.lean#L20) -- elab "aliasC " x:ident " ← " ys:ident* : command => -- for y in ys do -- Lean.logInfo y -- elab "#explode " stx:term : command => Command.runTermElabM fun _ => do -- let (heading, e) ← try -- -- Adapted from `#check` implementation -- let theoremName : Name ← realizeGlobalConstNoOverloadWithInfo stx -- addCompletionInfo <| .id stx theoremName (danglingDot := false) {} none -- let decl ← getConstInfo theoremName -- let c : Expr := .const theoremName (decl.levelParams.map mkLevelParam) -- pure (m!"{MessageData.ofConst c} : {decl.type}", decl.value!) -- catch _ => -- let e ← Term.elabTerm stx none -- Term.synthesizeSyntheticMVarsNoPostponing -- let e ← Term.levelMVarToParam (← instantiateMVars e) -- pure (m!"{e} : {← Meta.inferType e}", e) -- unless e.isSyntheticSorry do -- let entries ← explode e -- let fitchTable : MessageData ← entriesToMessageData entries -- logInfo <|← addMessageContext m!"{heading}\n\n{fitchTable}\n" /-- info: lambda : True → True 0│ │ a ├ True 1│0,0│ ∀I │ True → True -/ -- #guard_msgs in #explode lambda | theorem | _examples | [
"import Paperproof",
"import Mathlib.Data.Set.Card",
"import Mathlib.Tactic.Explode"
] | _examples/development/TEST.lean | encard_le_encard_of_injOn | null |
commutativityOfIntersections (s t : Set ℕ) : s ∩ t = t ∩ s := by sorry | theorem | _examples | [
"import Mathlib.Data.Set.Basic",
"import Paperproof"
] | _examples/workshop-bonn-2025/1-Demo.lean | commutativityOfIntersections | null |
finFunctionFinEquiv_single11 {m n : ℕ} [NeZero m] (i : Fin n) (j : Fin m) : (finFunctionFinEquiv (Pi.single i j) : ℕ) = j * m ^ (i : ℕ) := by rw [finFunctionFinEquiv_apply, Fintype.sum_eq_single i] · rw [Pi.single_eq_same] · rintro x hx rw [Pi.single_eq_of_ne hx, Fin.coe_ofNat_eq_mod, Nat.zero_mod, zero_mul] -- 3. We can see exactly what path was taken by tactic combinators | theorem | _examples | [
"import Mathlib.Data.Set.Basic",
"import Mathlib.Algebra.BigOperators.Fin",
"import Mathlib.Tactic.GCongr",
"import Paperproof"
] | _examples/workshop-bonn-2025/2-Formalization.lean | finFunctionFinEquiv_single11 | null |
combs (p q r : Prop) (hp : p) : (p ∨ q ∨ r) ∧ (q ∨ p ∨ r) ∧ (q ∨ r ∨ p) := by repeat (first | apply And.intro | apply Or.inl; assumption | apply Or.inr | assumption) -- 4. Copy for LLM | theorem | _examples | [
"import Mathlib.Data.Set.Basic",
"import Mathlib.Algebra.BigOperators.Fin",
"import Mathlib.Tactic.GCongr",
"import Paperproof"
] | _examples/workshop-bonn-2025/2-Formalization.lean | combs | null |
append_assoc {α : Type} (a b c : List α) : (a ++ b) ++ c = a ++ (b ++ c) := by induction a with | nil => simp only [List.nil_append] | cons x xs ih => simp [List.cons_append, ih] --------------------------- Real Projets --------------------------- -- 2. Carleson:933: Mode:all-tactics + create snapshot -- 3. Carleson:933: Mode:single-tactic -- two ways to show diffs: look at red/green highlights + click 3 TIMES -- or simply display 2 things after each other | theorem | _examples | [
"import Mathlib.Data.Set.Basic",
"import Mathlib.Algebra.BigOperators.Fin",
"import Mathlib.Tactic.GCongr",
"import Paperproof"
] | _examples/workshop-bonn-2025/2-Formalization.lean | append_assoc | null |
commutativityOfIntersections (s t : Set ℕ) : s ∩ t = t ∩ s := by sorry | theorem | _examples | [
"import Mathlib.Data.Set.Basic",
"import Paperproof"
] | _examples/workshop-tbilisi-2024/1-Demo.lean | commutativityOfIntersections | null |
top : a ∧ b → a := by sorry -- 1. What can be do to `_ → _` goal? -- 2. What can we do to `_ ∧ _` goal? | theorem | _examples | [
"import Mathlib.Tactic.Cases",
"import Mathlib.Tactic.Use",
"import Mathlib.Data.Set.Basic",
"import Paperproof"
] | _examples/workshop-tbilisi-2024/2-Tutorial.lean | top | null |
bottom : a → b → a ∧ b := by sorry -- 1. Variable scopes | theorem | _examples | [
"import Mathlib.Tactic.Cases",
"import Mathlib.Tactic.Use",
"import Mathlib.Data.Set.Basic",
"import Paperproof"
] | _examples/workshop-tbilisi-2024/2-Tutorial.lean | bottom | null |
commutativityOfIntersections (s t : Set Nat) : s ∩ t = t ∩ s := by ext x apply Iff.intro intro h1 rw [Set.mem_inter_iff, and_comm] at h1 exact h1 -- intro h2 -- rw [Set.mem_inter_iff, and_comm] at h2 -- exact h2 -- Very physical actions -- Very few moves to memorize | theorem | _examples | [
"import Mathlib.Tactic.Cases",
"import Mathlib.Tactic.Use",
"import Mathlib.Data.Set.Basic",
"import Paperproof"
] | _examples/workshop-tbilisi-2024/2-Tutorial.lean | commutativityOfIntersections | null |
simple_ex (n m : ℕ) (h1 : ∀ {a b : Nat}, a + b = b + a) (h2 : ∀ {a b : Nat}, a = b + b): n + m = m + n := by simp [h1, h2] -- 2. `calc` is a transitivity thing -- (also: again, shows what hypotheses are used) | theorem | _examples | [
"import Mathlib.Data.Set.Basic",
"import Mathlib.Algebra.BigOperators.Fin",
"import Mathlib.Tactic.GCongr",
"import Paperproof"
] | _examples/workshop-tbilisi-2024/3-Tutorial.lean | simple_ex | null |
finFunctionFinEquiv_single11 {m n : ℕ} [NeZero m] (i : Fin n) (j : Fin m) : (finFunctionFinEquiv (Pi.single i j) : ℕ) = j * m ^ (i : ℕ) := by rw [finFunctionFinEquiv_apply, Fintype.sum_eq_single i, Pi.single_eq_same] rintro x hx rw [Pi.single_eq_of_ne hx, Fin.coe_ofNat_eq_mod, Nat.zero_mod, zero_mul] -- 5. Any `cases`/`induction` has a uniform interface namespace OurInductives variable (SomeGoal: Prop) | theorem | _examples | [
"import Mathlib.Data.Set.Basic",
"import Mathlib.Algebra.BigOperators.Fin",
"import Mathlib.Tactic.GCongr",
"import Paperproof"
] | _examples/workshop-tbilisi-2024/3-Tutorial.lean | finFunctionFinEquiv_single11 | null |
Prod (α : Type u) (β : Type v) | mk : α → β → Prod α β | inductive | _examples | [
"import Mathlib.Data.Set.Basic",
"import Mathlib.Algebra.BigOperators.Fin",
"import Mathlib.Tactic.GCongr",
"import Paperproof"
] | _examples/workshop-tbilisi-2024/3-Tutorial.lean | Prod | null |
prod (hi: Prod Nat Nat) : SomeGoal := by rcases hi with ⟨a, b⟩ sorry | theorem | _examples | [
"import Mathlib.Data.Set.Basic",
"import Mathlib.Algebra.BigOperators.Fin",
"import Mathlib.Tactic.GCongr",
"import Paperproof"
] | _examples/workshop-tbilisi-2024/3-Tutorial.lean | prod | null |
Sum (α : Type u) (β : Type v) where | inl : α → Sum α β | inr : β → Sum α β | inductive | _examples | [
"import Mathlib.Data.Set.Basic",
"import Mathlib.Algebra.BigOperators.Fin",
"import Mathlib.Tactic.GCongr",
"import Paperproof"
] | _examples/workshop-tbilisi-2024/3-Tutorial.lean | Sum | null |
sum (hi: Sum Nat Nat) : SomeGoal := by rcases hi with x | y sorry; sorry | theorem | _examples | [
"import Mathlib.Data.Set.Basic",
"import Mathlib.Algebra.BigOperators.Fin",
"import Mathlib.Tactic.GCongr",
"import Paperproof"
] | _examples/workshop-tbilisi-2024/3-Tutorial.lean | sum | null |
Random where | hi: ℕ → String → Random | hello: (2 + 2 = 4) → Random | wow: Random | inductive | _examples | [
"import Mathlib.Data.Set.Basic",
"import Mathlib.Algebra.BigOperators.Fin",
"import Mathlib.Tactic.GCongr",
"import Paperproof"
] | _examples/workshop-tbilisi-2024/3-Tutorial.lean | Random | null |
casesRandom (h: Random) : SomeGoal := by rcases h with ⟨a, b⟩ | ⟨c⟩ | _ sorry; sorry; sorry -- 6. We can see exactly what path was taken by tactic combinators | theorem | _examples | [
"import Mathlib.Data.Set.Basic",
"import Mathlib.Algebra.BigOperators.Fin",
"import Mathlib.Tactic.GCongr",
"import Paperproof"
] | _examples/workshop-tbilisi-2024/3-Tutorial.lean | casesRandom | null |
combs (p q r : Prop) (hp : p) : (p ∨ q ∨ r) ∧ (q ∨ p ∨ r) ∧ (q ∨ r ∨ p) := by repeat (first | apply And.intro | apply Or.inl; assumption | apply Or.inr | assumption) --------------------------- OPTIONS --------------------------- -- 1. "Zoom in", "Zoom out" -- 2. "Compact Horizontally" -- 3. "Compact Tactics" (won't do anything here, but useful for mathlib) -- 4. "Hide Goal Names" -- 5. "Always Green Hypotheses" -- 6. "Collapse box" | theorem | _examples | [
"import Mathlib.Data.Set.Basic",
"import Mathlib.Algebra.BigOperators.Fin",
"import Mathlib.Tactic.GCongr",
"import Paperproof"
] | _examples/workshop-tbilisi-2024/3-Tutorial.lean | combs | null |
append_assoc {α : Type} (a b c : List α) : (a ++ b) ++ c = a ++ (b ++ c) := by induction a with | nil => simp | cons x xs ih => simp [List.cons_append, ih] | theorem | _examples | [
"import Mathlib.Data.Set.Basic",
"import Mathlib.Algebra.BigOperators.Fin",
"import Mathlib.Tactic.GCongr",
"import Paperproof"
] | _examples/workshop-tbilisi-2024/3-Tutorial.lean | append_assoc | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.