text
stringlengths
0
3.34M
import topology.instances.real open filter real open_locale topological_space theorem leibeck_23_3 (S : set ℝ) (c : ℝ) (hc : is_lub S c) : βˆƒ (f : β„• β†’ ℝ), (βˆ€ n, f n ∈ S) ∧ tendsto f at_top (𝓝 c) := begin sorry end
informal statement Let $R$ be a ring, with $M$ an ideal of $R$. Suppose that every element of $R$ which is not in $M$ is a unit of $R$. Prove that $M$ is a maximal ideal and that moreover it is the only maximal ideal of $R$.formal statement theorem exercise_11_4_1b {F : Type*} [field F] [fintype F] (hF : card F = 2) : ...
informal statement Suppose that $T \in \mathcal{L}(V)$ has $\operatorname{dim} V$ distinct eigenvalues and that $S \in \mathcal{L}(V)$ has the same eigenvectors as $T$ (not necessarily with the same eigenvalues). Prove that $S T=T S$.formal statement theorem exercise_6_2 {V : Type*} [add_comm_group V] [module β„‚ V] [i...
constants (p q : Prop) theorem t_and_intro (Hp : p) (Hq : q) : p ∧ q := and.intro Hp Hq check t_and_intro -- t_and_intro : βˆ€ p q, p β†’ q β†’ p ∧ q
import LeanUtils open Nat theorem square_of_even_number_is_even (m : Nat) (hβ‚€ : even m) : (even (m ^ 2)) := by have ⟨n, hβ‚βŸ© : βˆƒ (n : Nat), m = 2 * n := by simp at *; assumption have hβ‚‚ : m^2 = 2*(2*n^2) := by calc m^2 = (2*n)^2 := by repeat (first | ring | simp_all) _ = 4*n^2 := by ...
informal statement Show that the equation $7 x^{3}+2=y^{3}$ has no solution in integers.formal statement theorem exercise_3_5 : Β¬ βˆƒ x y : β„€, 7*x^3 + 2 = y^3 :=
informal statement Suppose (a) $f$ is continuous for $x \geq 0$, (b) $f^{\prime}(x)$ exists for $x>0$, (c) $f(0)=0$, (d) $f^{\prime}$ is monotonically increasing. Put $g(x)=\frac{f(x)}{x} \quad(x>0)$ and prove that $g$ is monotonically increasing.formal statement theorem exercise_5_6 {f : ℝ β†’ ℝ} (hf1 : continuous f...
open Nat theorem add_assoc (m n k : Nat) : m + n + k = m + (n + k) := Nat.recOn (motive := fun k => m + n + k = m + (n + k)) k rfl (fun k ih => by simp [Nat.add_succ, ih]; done)
informal statement Prove that the addition of residue classes $\mathbb{Z}/n\mathbb{Z}$ is associative.formal statement theorem exercise_1_1_3 (n : β„€) : βˆ€ (a b c : β„€), (a+b)+c ≑ a+(b+c) [ZMOD n] :=
informal statement Prove that if $H$ is a subgroup of $G$ then $H$ is generated by the set $H-\{1\}$.formal statement theorem exercise_2_4_4 {G : Type*} [group G] (H : subgroup G) : subgroup.closure ((H : set G) \ {1}) = ⊀ :=
import advice lemma conj (P Q : Prop) (P ∧ Q) : P := {! !}
-- Homework 5 due 9.26 theorem problem1 (A B : Prop) : (A β†’ B) β†’ (Β¬ B β†’ Β¬ A) := sorry theorem problem2 (A B : Prop) : Β¬ (A ∨ B) ↔ Β¬ A ∧ Β¬ B := sorry theorem problem3 (A B C : Prop) (h : B ↔ C) : (A ∨ B) ↔ A ∨ C := sorry theorem problem4 (A B : Prop) : (A β†’ B) ↔ Β¬ A ∨ B := sorry theorem problem5 (A B : Prop) : Β¬ A...
informal statement Prove that if $V$ is a complex inner-product space, then $\langle u, v\rangle=\frac{\|u+v\|^{2}-\|u-v\|^{2}+\|u+i v\|^{2} i-\|u-i v\|^{2} i}{4}$ for all $u, v \in V$.formal statement theorem exercise_6_7 {V : Type*} [inner_product_space β„‚ V] (u v : V) : βŸͺu, v⟫_β„‚ = (β€–u + vβ€–^2 - β€–u - vβ€–^2 + I*β€–u + Iβ€’...
informal statement Let $G$ be any group. Prove that the map from $G$ to itself defined by $g \mapsto g^{-1}$ is a homomorphism if and only if $G$ is abelian.formal statement theorem exercise_2_1_5 {G : Type*} [group G] [fintype G] (hG : card G > 2) (H : subgroup G) [fintype H] : card H β‰  card G - 1 :=
informal statement Let $E$ be a bounded set in $R^{1}$. Prove that there exists a real function $f$ such that $f$ is uniformly continuous and is not bounded on $E$.formal statement theorem exercise_4_12 {Ξ± Ξ² Ξ³ : Type*} [uniform_space Ξ±] [uniform_space Ξ²] [uniform_space Ξ³] {f : Ξ± β†’ Ξ²} {g : Ξ² β†’ Ξ³} (hf : uniform_con...
informal statement Prove that if $V$ is a complex inner-product space, then $\langle u, v\rangle=\frac{\|u+v\|^{2}-\|u-v\|^{2}+\|u+i v\|^{2} i-\|u-i v\|^{2} i}{4}$ for all $u, v \in V$.formal statement theorem exercise_6_16 {K V : Type*} [is_R_or_C K] [inner_product_space K V] {U : submodule K V} : U.orthogonal = ...
[GOAL] ⊒ Β¬UnivLE.{u + 1, u} [PROOFSTEP] simp only [Small_iff, not_forall, not_exists, not_nonempty_iff] [GOAL] ⊒ βˆƒ x, βˆ€ (x_1 : Type u), IsEmpty (x ≃ x_1) [PROOFSTEP] exact ⟨Type u, fun Ξ± => ⟨fun f => Function.not_surjective_Type.{u, u} f.symm f.symm.surjective⟩⟩
import data.complex.exponential import algebra.polynomial.big_operators import analysis.special_functions.trigonometric.basic theorem AMC_2021_A_22 (a b c :ℝ)(P:ℝ β†’ ℝ) (hP: βˆ€ (x:ℝ), P x = x^3+a*x^2*b*x+c) (hroots:(P (real.cos 2*real.pi/7) = 0)∧(P (real.cos 4*real.pi/7) = 0)∧(P (real.cos 6*real.pi/7) = 0)): a*b*c = 1/3...
informal statement Let $n$ be a positive integer, and let $f_{n}(z)=n+(n-1) z+$ $(n-2) z^{2}+\cdots+z^{n-1}$. Prove that $f_{n}$ has no roots in the closed unit disk $\{z \in \mathbb{C}:|z| \leq 1\}$.formal statement theorem exercise_2017_b3 (f : ℝ β†’ ℝ) (c : β„• β†’ ℝ) (hf : f = Ξ» x, (βˆ‘' (i : β„•), (c i) * x^i)) (hc : βˆ€...
informal statement Prove that there is no rational number whose square is $12$.formal statement theorem exercise_1_5 (A minus_A : set ℝ) (hA : A.nonempty) (hA_bdd_below : bdd_below A) (hminus_A : minus_A = {x | -x ∈ A}) : Inf A = Sup minus_A :=
informal statement Suppose $p \in \mathcal{P}(\mathbf{C})$ has degree $m$. Prove that $p$ has $m$ distinct roots if and only if $p$ and its derivative $p^{\prime}$ have no roots in common.formal statement theorem exercise_5_4 {F V : Type*} [add_comm_group V] [field F] [module F V] (S T : V β†’β‚—[F] V) (hST : S ∘ T = T ∘...
informal statement Prove that the multiplicative groups $\mathbb{R}-\{0\}$ and $\mathbb{C}-\{0\}$ are not isomorphic.formal statement theorem exercise_1_6_17 {G : Type*} [group G] (f : G β†’ G) (hf : f = Ξ» g, g⁻¹) : βˆ€ x y : G, f x * f y = f (x*y) ↔ βˆ€ x y : G, x*y = y*x :=
import smt2 lemma negation_of_conj : forall (P Q : Prop), not (P ∧ Q) ↔ not P ∨ not Q := by intros; z3 "d1.log" lemma negation_of_disj : forall (P Q : Prop), Β¬ (P ∨ Q) ↔ Β¬ P ∧ Β¬ Q := begin intros, z3 end
import data.real.basic theorem IMO_Shortlist_A4_2001 (f : ℝ β†’ ℝ) : (βˆ€ x y : ℝ, f(x^2 - y^2) = x*f(x) - y * f(y)) β†’ βˆƒ l : ℝ, βˆ€ x : ℝ, f(x) = l*x := sorry
theory Filter1 imports Main begin lemma ""
informal statement Suppose $T \in \mathcal{L}(V)$ is self-adjoint, $\lambda \in \mathbf{F}$, and $\epsilon>0$. Prove that if there exists $v \in V$ such that $\|v\|=1$ and $\|T v-\lambda v\|<\epsilon,$ then $T$ has an eigenvalue $\lambda^{\prime}$ such that $\left|\lambda-\lambda^{\prime}\right|<\epsilon$.formal statem...
informal statement Show that the rationals $\mathbb{Q}$ are not locally compact.formal statement theorem exercise_29_1 : Β¬ locally_compact_space β„š :=
informal statement Prove that no group of order $p^2 q$, where $p$ and $q$ are prime, is simple.formal statement theorem exercise_6_8_1 {G : Type*} [group G] (a b : G) : closure ({a, b} : set G) = closure {b*a*b^2, b*a*b^3} :=
[GOAL] a b : β„€ ⊒ a = b ↔ ↑a = ↑b [PROOFSTEP] simp only [Int.cast_inj] [GOAL] a b : β„€ ⊒ a β‰  b ↔ ↑a β‰  ↑b [PROOFSTEP] simp only [ne_eq, Int.cast_inj]
informal statement A map $f: X \rightarrow Y$ is said to be an open map if for every open set $U$ of $X$, the set $f(U)$ is open in $Y$. Show that $\pi_{1}: X \times Y \rightarrow X$ and $\pi_{2}: X \times Y \rightarrow Y$ are open maps.formal statement theorem exercise_17_4 {X : Type*} [topological_space X] (U A : s...
example : βˆƒ x, x + 2 = 8 := begin let a : β„• := 3 * 2, existsi a, reflexivity end
[GOAL] ⊒ AbsoluteValue.uniformSpace AbsoluteValue.abs = PseudoMetricSpace.toUniformSpace [PROOFSTEP] ext s [GOAL] case a.a s : Set (β„š Γ— β„š) ⊒ s ∈ uniformity β„š ↔ s ∈ uniformity β„š [PROOFSTEP] rw [(AbsoluteValue.hasBasis_uniformity _).mem_iff, Metric.uniformity_basis_dist_rat.mem_iff] [GOAL] case a.a s : Set (β„š Γ— β„š) ⊒ (βˆƒ i...
universes u v theorem eqLitOfSize0 {Ξ± : Type u} (a : Array Ξ±) (hsz : a.size = 0) : a = #[] := a.toArrayLitEq 0 hsz theorem eqLitOfSize1 {Ξ± : Type u} (a : Array Ξ±) (hsz : a.size = 1) : a = #[a.getLit 0 hsz (ofDecideEqTrue rfl)] := a.toArrayLitEq 1 hsz theorem eqLitOfSize2 {Ξ± : Type u} (a : Array Ξ±) (hsz : a.size = 2)...
import LeanUtils open Nat theorem n_cube_plus_2_n (n : Nat) : divisible 3 (n^3 + 2*n) := by match n with | 0 => repeat (first | trivial | ring | simp_all) | k+1 => have h₁ : divisible 3 (k ^ 3 + 2 * k) := n_cube_plus_2_n _ have ⟨z, hβ‚‚βŸ© : βˆƒ z, k^3 + 2*k = 3*z := by repeat (first | ring | simp_all)...
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton ! This file was ported from Lean 3 source module topology.category.Top.epi_mono ! leanprover-community/mathlib commit 70fd9563a21e7b963887c9360bd29b2393e6225a ! Please do not...
lemma closure_empty [simp]: "closure {} = {}"
informal statement Show that every linear map from a one-dimensional vector space to itself is multiplication by some scalar. More precisely, prove that if $\operatorname{dim} V=1$ and $T \in \mathcal{L}(V, V)$, then there exists $a \in \mathbf{F}$ such that $T v=a v$ for all $v \in V$.formal statement theorem exercise...
informal statement Prove that characteristic subgroups are normal.formal statement theorem exercise_4_4_7 {G : Type*} [group G] {H : subgroup G} [fintype H] (hH : βˆ€ (K : subgroup G) (fK : fintype K), card H = @card K fK β†’ H = K) : H.characteristic :=
/- Copyright (c) 2021 Yourong Zang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yourong Zang -/ import analysis.calculus.conformal.normed_space import analysis.inner_product_space.conformal_linear_map /-! # Conformal maps between inner product spaces A function be...
import Smt theorem assoc (f : Bool β†’ Bool β†’ Bool) (p q r : Bool) : f p (f q r) == f (f p q) r := by smt admit
/- Copyright (c) 2017 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura -/ prelude import Init.Data.Option.Basic universe u v theorem Option.eq_of_eq_some {Ξ± : Type u} : βˆ€ {x y : Option Ξ±}, (βˆ€z, x = some z ↔ y = some z) β†’ x = y ...
informal statement Show that the lower limit topology $\mathbb{R}_l$ and $K$-topology $\mathbb{R}_K$ are not comparable.formal statement theorem exercise_13_8b : (topological_space.generate_from {S : set ℝ | βˆƒ a b : β„š, a < b ∧ S = Ico a b}).is_open β‰  (lower_limit_topology ℝ).is_open :=
def inc (x : Nat) := x + 1 @[simp] theorem inc_eq : inc x = x + 1 := rfl theorem ex (a b : Fin (inc n)) (h : a = b) : b = a := by simp only [inc_eq] at a trace_state exact h.symm
Formal statement is: lemma interior_hyperplane [simp]: assumes "a \<noteq> 0" shows "interior {x. a \<bullet> x = b} = {}" Informal statement is: If $a \neq 0$, then the interior of the hyperplane $\{x \in \mathbb{R}^n \mid a \cdot x = b\}$ is empty.
constants (p q : Prop) (H : p ∧ q) theorem t_proof_left : p := and.elim_left H theorem t_proof_right : q := and.elim_right H check t_proof_left -- t_proof_left : p check t_proof_right -- t_proof_right : q
theorem Ex003_1 (a b: Prop) : Β¬a β†’ a β†’ b := assume A:Β¬a, assume B:a, have C:false, from A B, show b, from false.elim C theorem Ex003_2 (a b : Prop) : Β¬a β†’ a β†’ b := begin intro, intro, contradiction end
informal statement If $P$ is a $p$-Sylow subgroup of $G$ and $P \triangleleft G$, prove that $P$ is the only $p$-Sylow subgroup of $G$.formal statement theorem exercise_2_11_6 {G : Type*} [group G] {p : β„•} (hp : nat.prime p) {P : sylow p G} (hP : P.normal) : βˆ€ (Q : sylow p G), P = Q :=
informal statement Let $\mathcal{T}_\alpha$ be a family of topologies on $X$. Show that there is a unique smallest topology on $X$ containing all the collections $\mathcal{T}_\alpha$.formal statement theorem exercise_13_5a {X : Type*} [topological_space X] (A : set (set X)) (hA : is_topological_basis A) : generate_...
informal statement Prove that $\cos 1^{\circ}$ is algebraic over $\mathbb{Q}$.formal statement theorem exercise_5_5_2 : irreducible (X^3 - 3*X - 1 : polynomial β„š) :=
-- You can even write it as a function! theorem contrapositive (P Q : Prop) : (P β†’ Q) β†’ (Β¬ Q β†’ Β¬ P) := Ξ» HPQ HnQ HP, HnQ (HPQ HP)
informal statement Let $I, J$ be ideals in a ring $R$. Prove that the residue of any element of $I \cap J$ in $R / I J$ is nilpotent.formal statement theorem exercise_10_7_10 {R : Type*} [ring R] (M : ideal R) (hM : βˆ€ (x : R), x βˆ‰ M β†’ is_unit x) : is_maximal M ∧ βˆ€ (N : ideal R), is_maximal N β†’ N = M :=
informal statement Prove that if $R$ is an integral domain and $x^{2}=1$ for some $x \in R$ then $x=\pm 1$.formal statement theorem exercise_7_1_15 {R : Type*} [ring R] (hR : βˆ€ a : R, a^2 = a) : comm_ring R :=
informal statement A map $f: X \rightarrow Y$ is said to be an open map if for every open set $U$ of $X$, the set $f(U)$ is open in $Y$. Show that $\pi_{1}: X \times Y \rightarrow X$ and $\pi_{2}: X \times Y \rightarrow Y$ are open maps.formal statement theorem exercise_16_4 {X Y : Type*} [topological_space X] [topolog...
Module first. Polymorphic Record BAR (A:Type) := { foo: A->Prop; bar: forall (x y: A), foo x -> foo y}. Section A. Context {A:Type}. Set Printing Universes. Hint Resolve bar. Goal forall (P:BAR A) x y, foo _ P x -> foo _ P y. intros. eauto. Qed. End A. End first. Module firstbest. Polymorphic Record BAR (A:Ty...
import mynat.definition import mynat.add import mynat.mul lemma example2 (x y : mynat) (h : y = x + 7) : 2 * y = 2 * (x + 7) := begin rw h, refl, end
import data.real.basic import data.real.nnreal theorem USAMO_Problem_1_2011 (a b c : real) [a > 0] [b > 0] [c > 0]: a^2 + b^2 + c^2 +(a+b+c)^4 ≀ 4 β†’ ((a*b + 1) / (a+b)^2) +(b*c+1) / (b+c)^2 + (c*a+1) / (c+a)^2 β‰₯ 3 := sorry
informal statement Prove that $\lim_{n \rightarrow \infty} \sum_{i<n} a_i = \infty$, where $a_i = \sqrt{i + 1} -\sqrt{i}$.formal statement theorem exercise_3_6a : tendsto (Ξ» (n : β„•), (βˆ‘ i in finset.range n, g i)) at_top at_top :=
def fact : Nat β†’ Nat | 0 => 1 | (n+1) => (n+1)*fact n #check fact 6 #eval fact 10 -- set_option pp.all true theorem tst1 : 100000000000 + 200000000000 = 300000000000 := rfl theorem tst2 : 100000000000 * 200000000000 = 20000000000000000000000 := rfl theorem tst3 : fact 7 = 5040 := rfl theorem tst4 : fact 10 = ...
def f (x : Nat) := 0 theorem ex1 (h : f x = 1) : False := by simp [f] at h def g (x : Nat) := [x] theorem ex2 (h : g x = []) : 0 = 1 := by simp [g] at h theorem ex3 (x : Ξ±) (h : id x β‰  x) : 0 = 1 := by simp at h
informal statement Suppose $X$ is a nonempty complete metric space, and $\left\{G_{n}\right\}$ is a sequence of dense open sets of $X$. Prove Baire's theorem, namely, that $\bigcap_{1}^{\infty} G_{n}$ is not empty.formal statement theorem exercise_4_2a {Ξ± : Type} [metric_space Ξ±] {Ξ² : Type} [metric_space Ξ²] (f : ...
informal statement Suppose $u, v \in V$. Prove that $\langle u, v\rangle=0$ if and only if $\|u\| \leq\|u+a v\|$ for all $a \in \mathbf{F}$.formal statement theorem exercise_6_7 {V : Type*} [inner_product_space β„‚ V] (u v : V) : βŸͺu, v⟫_β„‚ = (β€–u + vβ€–^2 - β€–u - vβ€–^2 + I*β€–u + Iβ€’vβ€–^2 - I*β€–u-Iβ€’vβ€–^2) / 4 :=
import algebra.big_operators.order import tactic.ring open_locale big_operators theorem finset.mem_le_pos_sum {Ξ± : Type*} {Ξ² : Type*} [linear_ordered_add_comm_group Ξ²] (f : Ξ± β†’ Ξ²) (s : finset Ξ±) (h1 : βˆ€ x, x ∈ s β†’ 0 < f x) : βˆ€ y (H : y ∈ s), f y ≀ βˆ‘ x in s, f x := begin apply finset.single_le_sum, intros x h,...
(* the only way to compute zero is for p to become canonical. The only canonical member of A=A is eq_refl. However, it is impossible to that p is propositionally equal to eq_refl. In particular the univalence axiom allows for non-refl proofs. *) Fixpoint zero (A : Set) (p : A = A) {struct p} : nat := 0. (* although...
import data.real.irrational import topology.basic import algebra.order.floor --OUTPUT 1 theorem irrational_orbit_dense {Ξ± : ℝ} (hΞ±_irrat : irrational Ξ±) : closure ((Ξ» m : β„€, int.fract (Ξ± * ↑m)) '' (@set.univ β„€)) = set.Icc 0 1 :=density_of_irrational_orbit (Ξ± : ℝ) (hΞ± : Β¬ is_rat Ξ±) : βˆ€ y ∈ Icc 0 1, βˆƒ x ∈ Icc 0 1, x β‰  ...
informal statement Show that the collection $\{(a,b) \mid a < b, a \text{ and } b \text{ rational}\}$ is a basis that generates a topology different from the lower limit topology on $\mathbb{R}$.formal statement theorem exercise_16_4 {X Y : Type*} [topological_space X] [topological_space Y] (π₁ : X Γ— Y β†’ X) (Ο€β‚‚ : X...
import logic.function import data.fintype def list.chain'' {Ξ±} (R : Ξ± β†’ Ξ± β†’ Prop) : (Ξ± β†’ Prop) β†’ list Ξ± β†’ Ξ± β†’ Prop | P [] a := P a | P (a::l) b := P a ∧ list.chain'' (R a) l b def flip_one {Ξ±} [decidable_eq Ξ±] (f : Ξ± β†’ bool) (i : Ξ±) : Ξ± β†’ bool := function.update f i (bnot (f i)) def admissible {Ξ±} [decidable_eq Ξ±] (...
import AutograderTests.Util in_exercise inductive Example | ctor (h : False) theorem exercise : Example := sorry in_solution inductive Example | ctor (h : True) -- clever change theorem exercise : Example := ⟨⟨⟩⟩
import tactic lemma my_lemma: βˆ€ n : β„•, n β‰₯ 0 := Ξ» n, nat.zero_le n lemma my_lemma2: βˆ€ n : β„•, n β‰₯ 0 := begin intro n, apply nat.zero_le, end #print my_lemma2 -- Comentario: Al colocar el cursor sobre print se obtiene -- theorem my_lemma2 : βˆ€ (n : β„•), n β‰₯ 0 := -- Ξ» (n : β„•), n.zero_le lemma my_lemma3: βˆ€ n :...
informal statement If $f$ is a real continuous function defined on a closed set $E \subset \mathbb{R}$, prove that there exist continuous real functions $g$ on $\mathbb{R}$ such that $g(x)=f(x)$ for all $x \in E$.formal statement theorem exercise_4_6 (f : ℝ β†’ ℝ) (E : set ℝ) (G : set (ℝ Γ— ℝ)) (h₁ : is_compact E)...
/- Copyright (c) 2021 Yourong Zang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yourong Zang ! This file was ported from Lean 3 source module analysis.inner_product_space.conformal_linear_map ! leanprover-community/mathlib commit 46b633fd842bef9469441c0209906f6dddd...
informal statement Prove that if $f(x)$ and $g(x)$ are polynomials with rational coefficients whose product $f(x) g(x)$ has integer coefficients, then the product of any coefficient of $g(x)$ with any coefficient of $f(x)$ is an integer.formal statement theorem exercise_9_4_2b : irreducible (X^6 + 30*X^5 - 15*X^3 + ...
variable {Ξ± : Type*} def is_prefix (l₁ : list Ξ±) (lβ‚‚ : list Ξ±) : Prop := βˆƒ t, l₁ ++ t = lβ‚‚ def list_has_le : has_le (list Ξ±) := ⟨is_prefix⟩ section local attribute [instance] list_has_le theorem list.is_prefix_refl (l : list Ξ±) : l ≀ l := ⟨[], by simp⟩ end -- error: -- theorem bar (l : list Ξ±) : l ≀ l :=...
namespace Hidden open Nat theorem zero_add (n : Nat) : 0 + n = n := Nat.recOn (motive := fun x => 0 + x = x) n (show 0 + 0 = 0 from rfl) (fun (n : Nat) (ih : 0 + n = n) => show 0 + succ n = succ n from calc 0 + succ n = succ (0 + n) := rfl _ = succ n := by rw [ih]) end...
import Smt theorem triv (p : Bool) : p β†’ p := by smt simp_all
lemma maze (P Q R S T U: Prop) (p : P) (h : P β†’ Q) (i : Q β†’ R) (j : Q β†’ T) (k : S β†’ T) (l : T β†’ U) : U := begin apply l, apply j, apply h, exact p, end
informal statement Let $X$ be a compact Hausdorff space. Let $\mathcal{A}$ be a collection of closed connected subsets of $X$ that is simply ordered by proper inclusion. Then $Y=\bigcap_{A \in \mathcal{A}} A$ is connected.formal statement theorem exercise_26_11 {X : Type*} [topological_space X] [compact_space X] [t2_...
(* * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) * * SPDX-License-Identifier: BSD-2-Clause *) theory ptr_modifies imports "Word_Lib.WordSetup" "CParser.CTranslation" begin external_file "ptr_modifies.c" install_C_file "ptr_modifies.c" context ptr_modifies begin thm foo_ptr_new_modifies thm f_modifies ...
/- Copyright (c) 2017 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura -/ prelude import Init.Data.Option.Basic universe u v theorem Option.eq_of_eq_some {Ξ± : Type u} : βˆ€ {x y : Option Ξ±}, (βˆ€z, x = some z ↔ y = some z) β†’ x = y ...
open import Relation.Binary.Core module Heapsort.Impl1.Correctness.Order {A : Set} (_≀_ : A β†’ A β†’ Set) (tot≀ : Total _≀_) (trans≀ : Transitive _≀_) where open import Data.List open import Function using (_∘_) open import Heapsort.Impl1 _≀_ tot≀ trans≀ open impor...
informal statement Suppose $a, b \in R^k$. Find $c \in R^k$ and $r > 0$ such that $|x-a|=2|x-b|$ if and only if $| x - c | = r$. Prove that $3c = 4b - a$ and $3r = 2 |b - a|$.formal statement theorem exercise_2_24 {X : Type*} [metric_space X] (hX : βˆ€ (A : set X), infinite A β†’ βˆƒ (x : X), x ∈ closure A) : separable_s...
informal statement Prove that a group of order 312 has a normal Sylow $p$-subgroup for some prime $p$ dividing its order.formal statement theorem exercise_4_5_16 {p q r : β„•} {G : Type*} [group G] [fintype G] (hpqr : p < q ∧ q < r) (hpqr1 : p.prime ∧ q.prime ∧ r.prime)(hG : card G = p*q*r) : nonempty (sylow p ...
import linear_algebra.finite_dimensional lemma set.eq_empty_or_eq_insert {x : Type*} (s : set x) : s = βˆ… ∨ βˆƒ t (x βˆ‰ t), s = insert x t := begin rcases s.eq_empty_or_nonempty with (rfl|⟨x, hx⟩), { exact or.inl rfl }, { refine or.inr ⟨s \ {x}, x, _, _⟩; simp [set.insert_eq_of_mem hx] } end lemma csupr_subtype {Ξ± ...
informal statement Let $x$ be an element of $G$. Prove that $x^2=1$ if and only if $|x|$ is either $1$ or $2$.formal statement theorem exercise_1_1_18 {G : Type*} [group G] (x y : G) : x * y = y * x ↔ y⁻¹ * x * y = x ↔ x⁻¹ * y⁻¹ * x * y = 1 :=
lemma interior_empty [simp]: "interior {} = {}"
informal statement Prove that two elements $a, b$ of a group generate the same subgroup as $b a b^2, b a b^3$.formal statement theorem exercise_6_8_1 {G : Type*} [group G] (a b : G) : closure ({a, b} : set G) = closure {b*a*b^2, b*a*b^3} :=
/- Practice with predicate logic in Lean -/ variable {Ξ± : Type} (P Q : Ξ± β†’ Prop) theorem prob01 (aβ‚€ : Ξ±) (h : βˆ€ a, P a) : βˆƒ a, P a := sorry theorem prob02 (h : βˆƒ a, P a ∧ Β¬ Q a) (h : βˆ€ a, P a β†’ Q a) : False := sorry theorem prob03 (a a' : Ξ±) (h : a = a') (h' : P a) : P a' := sorry
[GOAL] ⊒ 1 = 1 [PROOFSTEP] sleep_heartbeats 1000 [GOAL] ⊒ 1 = 1 [PROOFSTEP] rfl
open tactic lemma ex1 (a b c : nat) : a + 0 = 0 + a ∧ 0 + b = b ∧ c + b = b + c := begin repeat {any_goals {constructor}}, show c + b = b + c, { apply add_comm }, -- third goal of three show a + 0 = 0 + a, { simp }, -- first of two show 0 + b = b, { rw [zero_add] } end /- Same example, but the local conte...
/- Copyright (c) 2021 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import algebra.algebra.subalgebra import topology.algebra.polynomial import topology.continuous_function.bounded import analysis.special_functions.bernstein /-! # Th...
import data.real.basic open classical attribute [instance] prop_decidable /- Rigorous definition of a limit For a sequence x_n, we say that \lim_{n \to \infty} x_n = l if βˆ€ Ξ΅ > 0, βˆƒ N, n β‰₯ N β†’ |x_n - l| < Ξ΅ -/ def lim_to_inf (x : β„• β†’ ℝ) (l : ℝ) := βˆ€ Ξ΅ > 0, βˆƒ N, βˆ€ n β‰₯ N, abs (x n - l) < Ξ΅ /- Bounded seque...
informal statement Show that there are infinitely many primes congruent to $-1$ modulo 6 .formal statement theorem exercise_3_5 : Β¬ βˆƒ x y : β„€, 7*x^3 + 2 = y^3 :=
/- Copyright (c) 2022 Kyle Miller. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kyle Miller ! This file was ported from Lean 3 source module data.finite.set ! leanprover-community/mathlib commit 509de852e1de55e1efa8eacfa11df0823f26f226 ! Please do not edit these lin...
import data.real.basic theorem challenge3 : (2 : ℝ) + 2 β‰  5 := begin sorry end
informal statement Show that 2 is divisible by $(1+i)^{2}$ in $\mathbb{Z}[i]$.formal statement theorem exercise_2_21 {l : β„• β†’ ℝ} (hl : βˆ€ p n : β„•, p.prime β†’ l (p^n) = log p ) (hl1 : βˆ€ m : β„•, Β¬ is_prime_pow m β†’ l m = 0) : l = Ξ» n, βˆ‘ d : divisors n, moebius (n/d) * log d :=
informal statement Define $\wedge(n)=\log p$ if $n$ is a power of $p$ and zero otherwise. Prove that $\sum_{A \mid n} \mu(n / d) \log d$ $=\wedge(n)$.formal statement theorem exercise_2_21 {l : β„• β†’ ℝ} (hl : βˆ€ p n : β„•, p.prime β†’ l (p^n) = log p ) (hl1 : βˆ€ m : β„•, Β¬ is_prime_pow m β†’ l m = 0) : l = Ξ» n, βˆ‘ d : diviso...
informal statement For all odd $n$ show that $8 \mid n^{2}-1$.formal statement theorem exercise_1_31 : (⟨1, 1⟩ : gaussian_int) ^ 2 ∣ 2 :=
import data.list.basic open list universe u variables {Ξ± : Type} (x y z : Ξ±) (xs ys zs : list Ξ±) def mk_symm (xs : list Ξ±) := xs ++ reverse xs attribute [simp] theorem reverse_mk_symm (xs : list Ξ±) : reverse (mk_symm xs) = mk_symm xs := by simp [mk_symm] example (xs ys : list β„•) : reverse (xs ++ mk_symm ys) = ...
import Meta.Boolean import Meta.Resolution theorem mpCvc5 (P Q : Prop) : Β¬ (P β†’ (P β†’ Q) β†’ Q) β†’ False := Ξ» lean_a0 => have lean_s0 := notImplies2 lean_a0 have lean_s1 := notImplies1 lean_s0 have lean_s2 := impliesElim lean_s1 have lean_s4 := notImplies1 lean_a0 have lean_s6 := ...
example (x y : β„•) (h : x = y) : y = x := begin revert x y, intros, symmetry, assumption end
informal statement Define $f_{n}:[0,1] \rightarrow \mathbb{R}$ by the equation $f_{n}(x)=x^{n}$. Show that the sequence $\left(f_{n}(x)\right)$ converges for each $x \in[0,1]$.formal statement theorem exercise_21_8 {X : Type*} [topological_space X] {Y : Type*} [metric_space Y] {f : β„• β†’ X β†’ Y} {x : β„• β†’ X} (hf : βˆ€ ...