text stringlengths 0 3.34M |
|---|
--Proof: a -> b -> a
theorem Ex002(a b : Prop) : a -> b -> a :=
assume H1 : a,
assume H2 : b,
show a, from H1
|
variable {α} (p : α → Prop) [DecidablePred p]
def filter : List α → List α
| [] => []
| a::as => if p a then a :: filter as else filter as
theorem filter_nil : filter p [] = [] :=
rfl
theorem filter_cons (a : α) (as : List α) : filter p (a :: as) = if p a then a :: filter p as else filter p as :=
rfl
theorem fil... |
/-
This in-class exercise requires solutions to two problems
-/
/-
PROBLEM #1.
In Lean, define pf1 to be a proof of the proposition
that, "for any proposition, Q, (Q ∧ ¬ Q) → false.
Here is a start on an answer. We use λ to
introduce the assumption that Q is some proposition.
The underscore is what you have to f... |
informal statement Show that 2 is divisible by $(1+i)^{2}$ in $\mathbb{Z}[i]$.formal statement theorem exercise_1_31 : (⟨1, 1⟩ : gaussian_int) ^ 2 ∣ 2 := |
lemma or_symm (P Q : Prop) : (P ∨ Q) → (Q ∨ P) :=
begin
intro pq,
cases pq with p q,
{
right,
exact p,
},
{
left,
exact q,
},
end |
record R : Set₁ where
field
A : Set
B : Set
B = A
field
C : Set
D : Set
D = A → B → C
|
/-
Copyright (c) 2020 Joseph Myers. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Joseph Myers
! This file was ported from Lean 3 source module geometry.euclidean.angle.unoriented.right_angle
! leanprover-community/mathlib commit 46b633fd842bef9469441c0209906f6dddd2b... |
(* @SUITE seq *)
theory seq
imports "../Hoare_Tactics"
begin
lemma
assumes "hoare {P &m} x:=1; x:=2 {x=2}"
assumes "hoare {x=2} x:=3; x:=4; x:=5; x:=6 {x<10}"
shows "hoare {P &m} x:=1; x:=2; x:=3; x:=4; x:=5; x:=6 {x<10}"
apply (seq 2)
apply (fact assms(1))
by (fact assms(2))
lemma
assumes "hoare {P ... |
--
axiom p {α β} : α → β → Prop
axiom foo {α β} (a : α) (b : β) : p a b
example : p 0 0 := by simp [foo]
example (a : Nat) : p a a := by simp [foo a]
example : p 0 0 := by simp [foo 0]
example : p 0 0 := by simp [foo 0 0]
example : p 0 0 := by
simp [foo 1] -- will not simplify
simp [foo 0]
example : p 0 0 ∧ p 1 1... |
lemma multiplicity_characterization'_int [rule_format]: "finite {p. p \<ge> 0 \<and> 0 < f (p::int)} \<Longrightarrow> (\<forall>p. 0 < f p \<longrightarrow> prime p) \<Longrightarrow> prime p \<Longrightarrow> multiplicity p (\<Prod>p | p \<ge> 0 \<and> 0 < f p. p ^ f p) = f p" |
import Smt
theorem modus_ponens {p q : Prop} : p → (p → q) → q := by
smt
|
structure S where
x : Bool
y : Nat
def S.Z (s : S) : Type :=
if s.x then Nat else Int
def S.z : (s : S) → s.Z
| s@{ x := true, .. } => s.y
| s@{ x := false, .. } => Int.ofNat s.y
def S.a : (s : S) → s.Z
| s => s.z
def S.b : (s : S) → s.Z
| s@h:{ x := true, .. } => h ▸ s.z
| s => s.z
#check @S.b.mat... |
informal statement Prove that the multiplicative groups $\mathbb{R}-\{0\}$ and $\mathbb{C}-\{0\}$ are not isomorphic.formal statement theorem exercise_1_6_4 :
is_empty (multiplicative ℝ ≃* multiplicative ℂ) := |
[STATEMENT]
lemma or_nonnegative_int_iff [simp]:
\<open>k OR l \<ge> 0 \<longleftrightarrow> k \<ge> 0 \<and> l \<ge> 0\<close> for k l :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (0 \<le> k OR l) = (0 \<le> k \<and> 0 \<le> l)
[PROOF STEP]
by (simp only: or_eq_not_not_and not_nonnegative_int_iff) simp |
open import Agda.Builtin.Unit
open import Agda.Builtin.List
open import Agda.Builtin.Nat
open import Agda.Builtin.Equality
open import Agda.Builtin.Reflection
open import Agda.Builtin.Sigma
macro
@0 trivial : Term → TC ⊤
trivial = unify (con (quote refl) [])
test : 42 ≡ 42
test = trivial
@0 m : Name → TC ⊤
m F =... |
lemma coeffs_0_eq_Nil [simp]: "coeffs 0 = []" |
import Mathlib.Tactic.TypeCheck
/-- A term where `inferType` returns `Prop`, but which does not type check. -/
elab "wrong" : term =>
return Lean.mkApp2 (.const ``id [.zero]) (.sort .zero) (.app (.sort .zero) (.sort .zero))
example : True := by
type_check Nat -- Type
type_check Bool.true -- Bool
type_check na... |
Support that requires grown children to offer material and moral support for their aging parents , particularly at times of " illness , loneliness , or distress " .
|
From st.prelude Require Import autosubst.
From st.STLCmuVS Require Import lang typing tactics.
From st.STLCmu Require Import types.
From st.STLCmuVS.lib Require Import fixarrow omega.
From st.backtranslations.un_syn Require Import universe.base.
Inductive direction :=
| Embed
| Project.
Definition FstSnd (ep : di... |
/-
Copyright (c) 2014 Jeremy Avigad. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jeremy Avigad, Leonardo de Moura
-/
import algebra.group_power.order
import algebra.big_operators.basic
/-!
# Definitions and properties of `gcd`, `lcm`, and `coprime`
-/
namespace n... |
Formal statement is: lemma coeffs_map_poly [code abstract]: "coeffs (map_poly f p) = strip_while ((=) 0) (map f (coeffs p))" Informal statement is: The coefficients of the polynomial obtained by applying a function to the coefficients of a polynomial are the coefficients of the original polynomial with zeros stripped o... |
open import Relation.Binary.Core
module TreeSort.Impl2.Correctness.Permutation {A : Set}
(_≤_ : A → A → Set)
(tot≤ : Total _≤_) where
open import BBSTree _≤_
open import Bound.Total A
open import Bound.Total.Order _≤_
open import Data.List
open import Data.Sum
open import List.P... |
/-
Copyright (c) 2023 Eric Wieser. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Eric Wieser
! This file was ported from Lean 3 source module ring_theory.complex
! leanprover-community/mathlib commit 9015c511549dc77a0f8d6eba021d8ac4bba20c82
! Please do not edit these... |
/-
Copyright (c) 2021 OpenAI. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kunhao Zheng, Stanislas Polu, David Renshaw, OpenAI GPT-f
-/
import mathzoo.imports.miniF2F
open_locale nat rat real big_operators topological_space
theorem amc12b_2002_p6
(a b : ℝ)
(h₀ ... |
(* This file is generated by Why3's Coq driver *)
(* Beware! Only edit allowed sections below *)
Require Import ZArith.
Require Import Rbase.
Axiom Max_is_ge : forall (x:Z) (y:Z), (x <= (Zmax x y))%Z /\
(y <= (Zmax x y))%Z.
Axiom Max_is_some : forall (x:Z) (y:Z), ((Zmax x y) = x) \/ ((Zmax x y) = y).
Axiom Min_i... |
A set is locally $P$ if and only if it is $P$. |
theorem ex1 (x : Nat) : 0 + x = x := by
cases x with
| zero => skip -- Error: unsolved goals
| succ y => skip -- Error: unsolved goals
theorem ex2 (x : Nat) : 0 + x = x := by
induction x with
| zero => skip -- Error: unsolved goals
| succ y ih => skip -- Error: unsolved goals
theorem ex3 (x : Nat) ... |
import data.complex.basic
variable z : ℂ
theorem Q7 (H : z^2=-1) : z=complex.I ∨ z = -complex.I := sorry
|
[STATEMENT]
lemma fromEnumTrue [simp]: "fromEnum True = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. fromEnum True = 1
[PROOF STEP]
by (simp add: fromEnum_def enum_bool) |
informal statement Prove that for all $n>1$ that $\mathbb{Z}/n\mathbb{Z}$ is not a group under multiplication of residue classes.formal statement theorem exercise_1_1_16 {G : Type*} [group G]
(x : G) (hx : x ^ 2 = 1) :
order_of x = 1 ∨ order_of x = 2 := |
prelude
set_option linter.all false -- prevent error messages from runFrontend
inductive Nat where
| zero : Nat
| succ (n : Nat) : Nat
inductive Eq : α → α → Prop where
| refl (a : α) : Eq a a
theorem key : ∀ (n m : Nat), (∀ (n m : Nat), Eq n m) → Eq n m :=
fun n m ih => (fun n m => ih n m) n m
--theorem ke... |
inductive Expr where
| nat : Nat → Expr
| plus : Expr → Expr → Expr
| bool : Bool → Expr
| and : Expr → Expr → Expr
deriving DecidableEq
inductive Ty where
| nat
| bool
deriving DecidableEq
inductive HasType : Expr → Ty → Prop
| nat : HasType (.nat v) .nat
| plus : HasType a .nat → HasType b .n... |
(** * Testcases for [test_auxiliary.v]
Authors:
- Lulof Pirée (1363638)
Creation date: 20 May 2021
Testcases for the functions used to build testcases.
It is assumes that [assert_raises_error] is correct,
and using this assumption it is tested that the other
functions in [test_auxiliary.v] are correct.
---------... |
theory Unified_PW_Hashing
imports
Unified_PW
Refine_Imperative_HOL.IICF_List_Mset
Worklist_Algorithms_Misc
TA_Library.Tracing
begin
subsection \<open>Towards an Implementation of the Unified Passed-Wait List\<close>
context Worklist1_Defs
begin
definition "add_pw_unified_spec passed wait a \<equiv>... |
lemma closure_UNIV [simp]: "closure UNIV = UNIV" |
module myenv
integer,parameter :: max_name_length=15
contains
subroutine myhostname(nname)
USE IFPORT
character(len=MAX_HOSTNAM_LENGTH + 1) :: hostname
character(len=max_name_length) :: nname
ISTAT = HOSTNAM (hostname)
if(len_trim(hostname) .ge. max_name_length)then
write(*,*)"hostname too long"
... |
import algebra.group
variable {G: Type*}
-- mathlib's constructor for `group` asks only for a (two-sided) identity
-- alongside a left inverse. This exercise shows it is possible to produce
-- both of those things if given a right identity and a right inverse.
theorem Q_12 (G: Type*) (mul: G → G → G) (e: G) (y: G → G... |
Sargassum muticum ( <unk> ) <unk> , now well established in a number of localities on the south , west , and north @-@ east coasts
|
-- Welcome to Lean! As you can tell I'm working with Lean through VS Code. Unfortunately there aren't a ton of options available for Lean-compatible editors (the other option is emacs)
-- I'll be using ``tactics'' to prove the results below, so I need to import the tactics module just as I would import a module in... |
--
set_option autoBoundImplicitLocal false
universe u
variable {α : Type u}
variable {β : α → Type v}
infix:50 " ≅ " => HEq
theorem ex {p₁ p₂ : Sigma (fun a => β a)} (h₁ : p₁.1 = p₂.1) (h : p₁.2 ≅ p₂.2) : p₁ = p₂ :=
match p₁, p₂, h₁, h with
| ⟨_, _⟩, ⟨_, _⟩, rfl, HEq.refl _ => rfl
|
lemma strip_while_coeffs [simp]: "strip_while (HOL.eq 0) (coeffs p) = coeffs p" |
using Distributions, StatsBase, HypothesisTests, Plots, Random; pyplot()
Random.seed!(0)
n = 25
N = 10^4
xGrid = -10:0.001:10
kGrid = 0:0.01:5
dist1, dist2 = Exponential(1), Normal()
function ksStat(dist)
data = rand(dist,n)
Fhat = ecdf(data)
sqrt(n)*maximum(abs.(Fhat.(xGrid) - cdf.(dist,xGrid)))
end
kSt... |
lemma iff_trans (P Q R : Prop) : (P ↔ Q) → (Q ↔ R) → (P ↔ R) :=
begin
intros hpq hqr,
split,
intro p,
apply hqr.1,
apply hpq.1,
exact p,
intro r,
apply hpq.2,
apply hqr.2,
exact r,
end
|
module Numeral.Natural.Oper.DivMod.Proofs where
import Lvl
open import Data
open import Data.Boolean.Stmt
open import Logic.Predicate
open import Numeral.Finite
open import Numeral.Natural
open import Numeral.Natural.Oper
open import Numeral.Natural.Oper.Comparisons
open import Numeral.Natural.Oper.FlooredDivision
ope... |
/-
Copyright (c) 2022 Damiano Testa. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Damiano Testa
-/
import algebra.geom_sum
import algebra.group.unique_prods
import algebra.monoid_algebra.basic
import data.finsupp.lex
import data.zmod.basic
/-!
# Examples of zero-div... |
/-
Copyright (c) 2021 OpenAI. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kunhao Zheng, Stanislas Polu, David Renshaw, OpenAI GPT-f
-/
import mathzoo.imports.miniF2F
open_locale nat rat real big_operators topological_space
theorem mathd_numbertheory_412
(x y : ℕ... |
{-# OPTIONS --without-K --safe --no-sized-types --no-guardedness
--no-subtyping #-}
module Agda.Builtin.Word.Properties where
open import Agda.Builtin.Word
open import Agda.Builtin.Equality
primitive
primWord64ToNatInjective : ∀ a b → primWord64ToNat a ≡ primWord64ToNat b → a ≡ b
|
theory Tut09
imports "HOL-IMP.Hoare_Sound_Complete"
begin
paragraph "Step 1"
definition Max :: "com" where
"Max = IF Less (V ''a'') (V ''b'') THEN ''c'' ::= V ''b'' ELSE ''c'' ::= V ''a''"
paragraph "Step 2"
lemma max_right[simp]: "(a::int)<b \<Longrightarrow> max a b = b"
by simp
lemma max_left[simp]: "\<n... |
namespace nat
variables {x y z : ℕ}
lemma le_add_of_le_right (h : x ≤ y) :
x ≤ y + z :=
by transitivity;
[apply nat.le_add_right, apply nat.add_le_add_right h]
lemma le_add_of_le_left (h : x ≤ z) :
x ≤ y + z :=
by transitivity;
[apply nat.le_add_left, apply nat.add_le_add_left h]
end nat
|
import data.nat.prime
import data.nat.parity
import tactic
open nat
lemma eq_two_of_prime_and_even
{n : ℕ}
(hn : even n)
(hn' : nat.prime n)
: n = 2 :=
begin
symmetry,
rw ← prime_dvd_prime_iff_eq prime_two hn',
exact even_iff_two_dvd.mp hn
end
-- 2ª demostración
-- ===============
lemma eq_two_of_prime... |
TYPE point
INTEGER :: i, j
END TYPE
TYPE(POINT) :: PV = POINT(1.0,2.0)
END PROGRAM
|
lemma to_fract_0 [simp]: "to_fract 0 = 0" |
inductive Expr where
| nat : Nat → Expr
| plus : Expr → Expr → Expr
| bool : Bool → Expr
| and : Expr → Expr → Expr
inductive Ty where
| nat
| bool
deriving DecidableEq
inductive HasType : Expr → Ty → Prop
| nat : HasType (.nat v) .nat
| plus : HasType a .nat → HasType b .nat → HasType (.plus a b... |
-- import all
-- import utils.util
-- import data_util.basic
-- import data_util.lean_step
-- import lean_step
-- -- #check times_cont_diff_at_of_subsingleto
-- #check continuous_linear_map.complete_space
-- #check abs_max_sub_max_le_abs
-- theorem triangle_inequality {α} [_inst_1 : normed_group α]
-- (g h : α) ... |
import linear_algebra.vandermonde
import linear_algebra.matrix.nondegenerate
import to_mathlib.polynomial.degree_lt_le
namespace matrix
open_locale big_operators matrix
open finset
lemma det_vandermonde_ne_zero_of_injective {R : Type*} [comm_ring R]
[is_domain R] {n : ℕ} (α : fin n ↪ R) : (vandermonde α).det ≠ 0 :=
b... |
lemma complex_cnj_inverse [simp]: "cnj (inverse x) = inverse (cnj x)" |
lemma emeasure_lfp'[consumes 1, case_names cont measurable]: assumes "P M" assumes cont: "sup_continuous F" assumes *: "\<And>M A. P M \<Longrightarrow> (\<And>N. P N \<Longrightarrow> Measurable.pred N A) \<Longrightarrow> Measurable.pred M (F A)" shows "emeasure M {x\<in>space M. lfp F x} = (SUP i. emeasure M {x\<in>... |
[STATEMENT]
lemma lazy_sequence_of_list_of_lazy_sequence [simp]:
"lazy_sequence_of_list (list_of_lazy_sequence xq) = xq"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. lazy_sequence_of_list (list_of_lazy_sequence xq) = xq
[PROOF STEP]
by (cases xq) simp_all |
abstract type Storage <: StaticInjection end
|
import Aesop
import Mathlib.Combinatorics.Pigeonhole
import Mathlib.Tactic.Linarith
import Mathlib.Tactic.LibrarySearch
/-!
# International Mathematical Olympiad 1964, Problem 4
Seventeen people correspond by mail with one another -- each one with
all the rest. In their letters only three different topics are
discuss... |
[STATEMENT]
theorem auth_shakey_anonymous:
assumes
A: "s\<^sub>0 \<Turnstile> s" and
B: "n \<notin> bad_id_shakey" and
C: "n \<notin> bad_shakey \<inter> (bad_id_password \<union> bad_id_pubkey)"
shows "\<langle>n, Key (Auth_ShaKey n)\<rangle> \<notin> spied s"
[PROOF STATE]
proof (prove)
goal (1 subgoa... |
Require Coq.Logic.Classical_Prop.
Require Import ProofCheckingEuclid.euclidean_axioms.
Require Import ProofCheckingEuclid.euclidean_defs.
Require Import ProofCheckingEuclid.lemma_collinear_ABC_ABD_BCD.
Section Euclid.
Context `{Ax:euclidean_neutral_ruler_compass}.
Lemma lemma_collinear_ABC_ABD_ABE_CDE :
forall A B ... |
Require Import Coq.Classes.RelationClasses Coq.Classes.Morphisms Coq.Relations.Relation_Definitions.
Lemma PER_valid_l {A} {R : relation A} {HS : Symmetric R} {HT : Transitive R} x y (H : R x y) : Proper R x.
Proof. hnf; etransitivity; eassumption || symmetry; eassumption. Qed.
Lemma PER_valid_r {A} {R : relation A} {... |
import data.rat.defs
import data.fintype.card
import data.polynomial.eval
import algebra.group.basic
import algebra.algebra.basic
import algebra.big_operators.intervals
import ring_theory.algebraic
import ring_theory.int.basic
-- This code is a perfect example of how *NOT* to use Lean
-- There are some `sorry`s becaus... |
/-
Copyright (c) 2021 OpenAI. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kunhao Zheng, Stanislas Polu, David Renshaw, OpenAI GPT-f
-/
import mathzoo.imports.miniF2F
open_locale nat rat real big_operators topological_space
theorem mathd_algebra_44
(s t : ℝ)
(h... |
Inductive bit : Type :=
| B0
| B1.
Inductive nybble : Type :=
| bits (b0 b1 b2 b3 : bit).
Check (bits B1 B0 B0 B0).
Definition all_zero (nb : nybble) : bool :=
match nb with
| (bits B0 B0 B0 B0) => true
| (bits _ _ _ _) => false
end.
Compute (all_zero (bits B1 B0 B1 B0)).
Compute (all_zero (bits ... |
theory TA_More2
imports TA.TA_More
begin
lemma collect_clock_pairs_concat:
"collect_clock_pairs (concat xxs) = (\<Union> x \<in> set xxs. collect_clock_pairs x)"
unfolding collect_clock_pairs_def by auto
end |
lemmas bounded_linear_mult_const = bounded_linear_mult_left [THEN bounded_linear_compose] |
/-
Copyright (c) 2021 OpenAI. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kunhao Zheng, Stanislas Polu, David Renshaw, OpenAI GPT-f
-/
import mathzoo.imports.miniF2F
open_locale nat rat real big_operators topological_space
theorem mathd_algebra_37
(x y : ℝ)
(h... |
[GOAL]
m : ℝ
hm : 1 < m
k : ℕ
⊢ Summable fun i => 1 / m ^ (i + (k + 1))!
[PROOFSTEP]
convert (summable_nat_add_iff (k + 1)).2 (LiouvilleNumber.summable hm)
[GOAL]
m : ℝ
hm : 1 < m
k x✝ : ℕ
⊢ 0 ≤ 1 / m ^ (x✝ + (k + 1))!
[PROOFSTEP]
positivity
[GOAL]
m : ℝ
hm : 1 < m
k : ℕ
⊢ 0 < 1 / m ^ (0 + (k + 1))!
[PROOFSTEP]
positiv... |
import pq_induction_principles
import minimal_sub_pq_gen_group
universe u
section pq_like_eq_equalizer
variables {G : Type u} [group G] --[inhabited Q]
lemma prod_in_free_gen_list (gen : set G) (x : list (free_gen_group_sub_pq gen)) (hx : of ((x.map of).prod) = (x.map (of ∘ of)).prod) : (x.map coe).prod ∈ (free_g... |
/-
Copyright (c) 2021 OpenAI. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kunhao Zheng, Stanislas Polu, David Renshaw, OpenAI GPT-f
-/
import mathzoo.imports.miniF2F
open_locale nat rat real big_operators topological_space
theorem mathd_algebra_513
(a b : ℝ)
(... |
informal statement Let $A$ be a nonempty set of real numbers which is bounded below. Let $-A$ be the set of all numbers $-x$, where $x \in A$. Prove that $\inf A=-\sup (-A)$.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}) :
... |
record category { ℓ₀ ℓ₁ } { k : Set ℓ₀ } (_⇒_ : k → k → Set ℓ₁) : Set (lsuc lzero ⊔ ℓ₀ ⊔ ℓ₁)
record groupoid { ℓ₀ ℓ₁ } { k : Set ℓ₀ } (_≈_ : k → k → Set ℓ₁) : Set (lsuc lzero ⊔ ℓ₀ ⊔ ℓ₁)
record groupoid { ℓ₀ ℓ₁ } { k } _≈_
where
coinductive
field
⦃ cat ⦄ : category _≈_
field
symmetry : ∀ { x y } → x ≈ y ... |
{-# OPTIONS --rewriting --confluence-check -v rewriting:80 #-}
open import Agda.Builtin.Equality
postulate
decorate : ∀{a} (A : Set a) → Set a
rewriteMe : ∀{a b} {A : Set a} {B : A → Set b}
→ decorate ((x : A) → B x) ≡ (decorate A → ∀ x → decorate (B x))
{-# BUILTIN REWRITE _≡_ #-}
{-# R... |
module Categories.Functor.Discrete where
open import Categories.Category
open import Categories.Functor
open import Categories.Agda
open import Categories.Categories
open import Categories.Support.PropositionalEquality
import Categories.Discrete as D
Discrete : ∀ {o} -> Functor (Sets o) (Categories o o _)
Discrete {o... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Lists defined in terms of Data.Star
------------------------------------------------------------------------
module Data.Star.List where
open import Data.Star
open import Data.Unit
open import Relation.Binary.S... |
State Before: q : ℚ
⊢ q * ↑q.den = ↑q.num State After: q : ℚ
⊢ q.num /. ↑q.den * (↑q.den /. 1) = q.num /. 1 Tactic: suffices (q.num /. ↑q.den) * (↑q.den /. 1) = q.num /. 1 by
conv => pattern (occs := 1)q ; (rw [← @num_den q])
simp only [coe_int_eq_divInt, coe_nat_eq_divInt, num_den] at this ⊢; assumption State Befo... |
import tactic.show_term
import tactic.tauto
open tactic
lemma ex1 {P Q R : Prop} (h₁ : Q → P) (h₂ : R) (h₃ : R → Q) : P ∧ R :=
by show_term { tauto }
#print ex1
example (x y : ℕ) (hx : x = 0) (hy : y = 1) : x + y = 1 :=
begin
show_term { rw hx, }, -- (id ((eq.refl (x + y = 1)).rec hx)).mpr ?m_1
show_term { rw h... |
import natural.definition
@[derive decidable_eq]
inductive Z
| pos (n : N) : Z
| neg_succ (n : N) : Z
namespace Z
instance : has_zero Z := ⟨ pos N.zero ⟩
theorem zero_eq_zero : pos N.zero = 0 := rfl
def one : Z := pos (N.succ 0)
instance : has_one Z := ⟨ Z.one ⟩
theorem one_eq_one : one = 1 := rfl
lemma reduce_... |
[GOAL]
⊢ size ≠ 0
[PROOFSTEP]
decide
[GOAL]
⊢ size ≠ 0
[PROOFSTEP]
decide
[GOAL]
⊢ size ≠ 0
[PROOFSTEP]
decide
[GOAL]
⊢ size ≠ 0
[PROOFSTEP]
decide
[GOAL]
n : ℕ
h : n < size
⊢ Nat.isValidChar ↑(UInt32.ofNat n).val
[PROOFSTEP]
rw [UInt32.val_eq_of_lt]
[GOAL]
n : ℕ
h : n < size
⊢ Nat.isValidChar n
n : ℕ h : n < size ⊢ n ... |
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 ≠ ... |
import data.complex.basic
import algebra.field
theorem cpge_group_3_a {G1 : Type*} [group G1] {G2 : Type*} [group G2]
(H : (subgroup G1)) (f : (G1 →* G2) ) : is_subgroup (f '' H) := sorry
|
From Coq Require Import
ssreflect
.
From ExtensibleCompiler.Theory Require Import
IndexedAlgebra
IndexedFunctor
IndexedSubFunctor
IndexedSum1
UniversalProperty
.
Local Open Scope SubFunctor.
Local Open Scope Sum1.
Class IndexedProofAlgebra (* cf. [iPAlgebra] *)
(Tag : Set) {I} F `... |
--=============================--
------ LÓGICA PROPOSICIONAL------
--=============================--
-- En lógica clásica, la doble negación de p y p son equivalentes
theorem iff_not_not {p : Prop} : ¬¬p ↔ p :=
Iff.intro
Classical.byContradiction
(fun hp : p => fun hnp : ¬p => (hnp hp))
theorem notfalse_iff_... |
### A Pluto.jl notebook ###
# v0.18.4
using Markdown
using InteractiveUtils
# ╔═╡ 89efa14e-b00c-11ec-09fe-15316ef94166
1+1
# ╔═╡ 00000000-0000-0000-0000-000000000001
PLUTO_PROJECT_TOML_CONTENTS = """
[deps]
"""
# ╔═╡ 00000000-0000-0000-0000-000000000002
PLUTO_MANIFEST_TOML_CONTENTS = """
# This file is machine-gene... |
module Main where
import Control.DeepSeq (NFData)
import Data.Complex (Complex((:+)))
import Data.Function (on)
test1 :: Int
test1 = undefined
test2 :: a -> a -> Complex a
test2 = (:+)
test25 :: NFData a => a
test25 = undefined
test3 :: (b -> b -> c) -> (a -> b) -> a -> a -> c
test3 = on
test4 :: IO ()
test4 = pu... |
lemma dist_add_cancel2 [simp]: "dist (b + a) (c + a) = dist b c" |
# Here . and , print and read an integer, not a character
Brainfuck := function(prog)
local pointer, stack, leftcells, rightcells, instr, stackptr, len,
output, input, jump, i, j, set, get;
input := InputTextUser();
output := OutputTextUser();
instr := 1;
pointer := 0;
leftcells := [ ];
rightcells := ... |
[GOAL]
⊢ φ 1 = 1
[PROOFSTEP]
simp [totient]
[GOAL]
n : ℕ
⊢ φ n = Nat.card ↑{m | m < n ∧ coprime n m}
[PROOFSTEP]
let e : {m | m < n ∧ n.coprime m} ≃ Finset.filter n.coprime (Finset.range n) :=
{ toFun := fun m => ⟨m, by simpa only [Finset.mem_filter, Finset.mem_range] using m.property⟩
invFun := fun m => ⟨m, by s... |
@[default_instance high] instance : HPow R Nat R where hPow a _ := a
example (x y : Nat) : (x + y) ^ 3 = x ^ 3 + y ^ 3 + 3 * (x * y ^ 2 + x ^ 2 * y) := sorry
|
#
# This file is part of the Actors.jl Julia package,
# MIT license, part of https://github.com/JuliaActors
#
using Actors, Test
@msg Msg A B C
@test supertype(A) == Msg
@test supertype(B) == Msg
@test supertype(C) == Msg
@msg D E F
@test supertype(D) == Any
@test supertype(E) == Any
@test supertype(F) == Any
|
import data.rat.basic tactic
-- prove one and delete the other
theorem some_reciprocal_is_zero : ∃ x : ℚ, 1 / x = 0 :=
begin
use 0,
norm_num -- exact dec_trivial would also work
end
--theorem no_reciprocal_is_zero : ¬ (∃ x : ℚ, 1 / x = 0) :=
--begin
-- sorry
--end |
class HasMulComm (α : Type u) [Mul α] : Prop where
mulComm : {a b : α} → a * b = b * a
class A (α : Type u) extends Mul α
attribute [instance] A.mk
class B (α : Type u) extends A α, HasMulComm α
attribute [instance] B.mk
example [Mul α] : A α := inferInstance
example [Mul α] [HasMulComm α] : A α := inferInstance... |
import data.real.basic
import .uwyo_sqrt2
import analysis.specific_limits
open_locale topological_space
open filter
lemma aux_0 (X : ℚ) (hX: 0 < X): ( X * X + 2) / (2 * X) - X = (2 - X * X) / (2 * X) :=
begin
set Y := X * X with hY,
have h1 : 2 - Y = 2 + Y - 2 * Y, linarith,
rw add_comm 2 Y at h1,
rw h1,
se... |
/-
Copyright (c) 2022 Jun Yoshida. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
-/
import Std.Classes.LawfulMonad
import Algdata.Data.Array.Lemmas
namespace Array
universe u v
variable {m : Type u → Type v} [Monad m] {α : Type u}
@[simp]
theorem modifyM_nil (n : Nat) (f... |
Prior to the 1913 – 14 NHA season , Ross refused to sign a contract for the Wanderers , requesting a salary increase . As one of the top players on the team , the Wanderers agreed to his demands of $ 1 @,@ 500 for the forthcoming season , in which he finished with four goals and nine points in eighteen games . The nex... |
[STATEMENT]
theorem FNTT_inv_IFNTT:
assumes "length numbers = n"
shows "FNTT (IFNTT numbers) = map ((*) (of_int_mod_ring (int n))) numbers"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. FNTT (IFNTT numbers) = map ((*) (of_int_mod_ring (int n))) numbers
[PROOF STEP]
by (simp add: FNTT_correct IFNTT_correct ass... |
(*begin hide*)
Require Import String. Open Scope string_scope.
Require Import Program.
From mathcomp Require Import ssreflect ssrnat ssrbool eqtype fintype.
Import ssreflect ssrnat ssrbool ssrfun eqtype fintype.
Set Implicit Arguments.
Unset Strict Implicit.
Import Prenex Implicits.
Add LoadPath "./" as Top.
Require... |
data Foo : Type where
Fee : Main.foo
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.