Datasets:
AI4M
/

text
stringlengths
0
3.34M
function postprocess(ev::CPEGWorkspace,X,x0) N = length(X) alt = zeros(N) cr = zeros(N) dr = zeros(N) for i = 1:N alt[i] = norm(X[i][1:3]) - ev.params.gravity.R dr[i],cr[i] = rangedistances(ev,X[i],x0) end return alt, dr, cr end function postprocess_scaled(ev::CPEGWorkspace,X,x0_s) X = unscale_X(ev.scale,X) x0 = x0_s/ev.scale.dscale alt, dr, cr = postprocess(ev,X,x0) return alt,dr,cr end # function processU(model::CPEGWorkspace,X,U) # N = length(X) # AoA = zeros(N-1) # bank = zeros(N-1) # for i = 1:N-1 # AoA[i] = (norm(U[i])) * deg2rad(20) # bank[i] = atan(U[i][1],U[i][2]) # end # return AoA, bank # end # function altitude(model,x) # return norm(x[1:3]) - model.evmodel.planet.R # end function anglebetween(r1,r2) dp = dot(normalize(r1),normalize(r2)) if dp >1.000000001 error("over 1 in angle between") end if dp>1 dp = 1 end return acos(dp) end function rangedistances(ev::CPEGWorkspace,x::StaticVector,x0::StaticVector) # first we get the angular momentum r0 = x0[1:3] v0 = x0[4:6] h = normalize(cross(r0,v0)) # R = model.evmodel.planet.R R = ev.params.gravity.R r = x[1:3] # downrange stuff r_dr = r - dot(r,h)*h θ_dr = anglebetween(r0,r_dr) dr = θ_dr*R # cross range stuff dr_r_r = r - r_dr θ_cr = anglebetween(r_dr,r) cr = dot(dr_r_r,h) > 0 ? θ_cr*R : -θ_cr*R return dr, cr end
identity : ty -> ty identity x = x
Sac River Auto is the Davis location of a 20 year old Sacramento business. They make the startling claim, We do not have any unsatisfied customers! If you do not see a particular vehicle, feel free to contact them at 5307581412 or [email protected]. They will inform you when a matching car arrives.
import numpy as np smash = ['Mario', 'DK', 'Link', 'Samus', 'Yoshi', 'Kirby', 'Fox', 'Pikachu'] print('1',smash) smash.append('Luigi') smash.append('Ness') smash.append('C. Falcon') smash.append('Jigglypuff') print('2',smash) smash.append(['Metal Mario', 'Polygon Team', 'Master Hand']) print('3',smash) smash = ['Original Roster'] + smash[8:] print('4',smash) def null_matrix(M,N): return [[0]*N]*M print('5', null_matrix(3,4)) bigMatrix = [[['?']*2]*3]*4 print('6', bigMatrix) mensualidad = {'Disney+': 7, 'Netflix': 8.99, 'Prime': 12.99} print('7', mensualidad) mensualidad.pop('Disney+') mensualidad['Blim'] = 109 mensualidad['Netflix'] = 139 mensualidad['Prime'] = 99 print('8', mensualidad) mensualidad['Tec'] = 20400 print('9', mensualidad) raw = np.arange(1,17,1) raw = raw.reshape(4,4) print('10', raw) raw11 = raw[:2,1:3] print('11', raw11) raw12 = raw[1:4,2:4] print('12', raw12) features,labels = raw[:4,:3],raw[:,3:] labels = labels.flatten() print('13') print('Features:\n',features) print('Label:\n',labels) zipped = list(zip(features,labels)) print('14',zipped) train,test = zipped[:3],zipped[3:] print('15') print('Test:\n',test) print('Train:\n',train) print('16','P(A|B)= 0.5') print('17') print('18','answer = -2x^4sin(x^2)+3x^2cos(x^2)') print('19','answer = x^2cos(x)+2xsin(x)+4x^3') print('20','f\'(x)=3x^2 +2xz + z^2 f\'(y)=3z^2 +2xz + x^2')
module Main import System countdown : (secs : Nat) -> IO () countdown Z = putStrLn "Lift Off!" countdown t@(S s) = do putStrLn (show t) usleep 1000000 countdown s
theory Poset_Types imports Main "HOL-Eisbach.Eisbach" begin locale carrier = fixes carrier :: "'a set" begin definition "member_of x \<equiv> x \<in> carrier" end locale poset = carrier + fixes le :: "'a \<Rightarrow> 'a \<Rightarrow> bool" assumes p_refl: "x \<in> carrier \<Longrightarrow> le x x" and p_trans: "x \<in> carrier \<Longrightarrow> y \<in> carrier \<Longrightarrow> z \<in> carrier \<Longrightarrow> le x y \<Longrightarrow> le y z \<Longrightarrow> le x z" and p_antisym: "x \<in> carrier \<Longrightarrow> y \<in> carrier \<Longrightarrow> le x y \<Longrightarrow> le y x \<Longrightarrow> x = y" typedef (overloaded) ('a) poset = " {(x, y). poset x y} :: ('a set \<times> ('a \<Rightarrow> 'a \<Rightarrow> bool)) set " apply (rule_tac x="({}, undefined)" in exI) apply (clarsimp) by (standard; clarsimp) setup_lifting type_definition_poset lift_definition leq :: "'a poset \<Rightarrow> ('a \<Rightarrow> 'a \<Rightarrow> bool)" is "\<lambda>P :: ('a set \<times> ('a \<Rightarrow> 'a \<Rightarrow> bool)) . snd P" done notation leq ("_ \<Ztypecolon> _ \<sqsubseteq> _" 50) lift_definition el :: "'a poset \<Rightarrow> ('a set)" is "\<lambda>P :: ('a set \<times> ('a \<Rightarrow> 'a \<Rightarrow> bool)) . fst P" done interpretation poset "(el x)" "(leq x)" apply (standard; transfer, clarsimp elim: poset.p_refl poset.p_trans poset.p_antisym) apply (transfer) apply (simp add: poset.p_refl) apply (metis poset.p_trans) by (metis poset.p_antisym) definition to_poset :: "'a set \<Rightarrow> ('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> 'a poset" where "to_poset A f = Abs_poset (A, f)" definition (in poset) witness :: "'a poset" where "witness \<equiv> (to_poset carrier le)" interpretation empty: poset "{}" "f" apply (standard; clarsimp) done interpretation nat_pos: poset "UNIV :: nat set" "(\<le>)" apply (standard; clarsimp) done interpretation discrete: poset "UNIV :: 'a set" "(=) :: 'a \<Rightarrow> 'a \<Rightarrow> bool" apply (standard) apply (clarsimp) apply (clarsimp) apply (erule sym) done context poset begin lemma leq_valid[simp]: "leq witness = le " unfolding witness_def using poset_axioms by (simp add: Abs_poset_inverse leq.rep_eq to_poset_def) lemma el_valid[simp]: "el witness = carrier " unfolding witness_def using poset_axioms by (simp add: Abs_poset_inverse el.rep_eq to_poset_def) sublocale op_poset: poset carrier "\<lambda>y x. le x y" apply (standard) apply (simp add: local.p_refl) apply (erule (4) local.p_trans) apply (erule (3) local.p_antisym) done end lemma discrete_leq_iff: "(discrete.witness \<Ztypecolon> x \<sqsubseteq> x) \<longleftrightarrow> x = x" apply (safe, rule p_refl, clarsimp) done lemma "nat_pos.witness \<Ztypecolon> x \<sqsubseteq> x" by (clarsimp) locale morphism = fr: carrier S + to: carrier S' for S :: "'a set" and S' :: "'b set" + fixes f :: "'a \<Rightarrow> 'b" assumes well_formed: "f ` S \<subseteq> S'" begin lemma maps_betw: "x \<in> S \<Longrightarrow> f x \<in> S'" using well_formed by blast definition "morphism_witness g P P' \<equiv> g = f \<and> P = S \<and> P' = S'" end locale poset_morphism = morphism "el P" "el P'" f for P P' f + assumes mono_ord: "x \<in> el P \<Longrightarrow> y \<in> el P \<Longrightarrow> leq P x y \<Longrightarrow> leq P' (f x) (f y)" begin sublocale is_morphism: morphism "(el P)" \<open>el P'\<close> f using morphism_axioms by blast end typedef (overloaded) ('a, 'b) poset_morphism = " {(p, f, p'). poset_morphism p p' f} :: ('a poset \<times> ('a \<Rightarrow> 'b) \<times> 'b poset) set" apply (clarsimp) apply (rule_tac x="discrete.witness" in exI) apply (rule_tac x="\<lambda>_. undefined" in exI) apply (rule_tac x="discrete.witness" in exI) apply (standard) apply (clarsimp) apply (clarsimp) done setup_lifting type_definition_poset_morphism lift_definition left :: "('a, 'b) poset_morphism \<Rightarrow> 'a poset" is "\<lambda>f :: ('a poset \<times> ('a \<Rightarrow> 'b) \<times> 'b poset) . fst f" done lift_definition right :: "('a, 'b) poset_morphism \<Rightarrow> 'b poset" is "\<lambda>f :: ('a poset \<times> ('a \<Rightarrow> 'b) \<times> 'b poset) . snd (snd f)" done lift_definition func :: "('a, 'b) poset_morphism \<Rightarrow> 'a \<Rightarrow> 'b" is "\<lambda>f :: ('a poset \<times> ('a \<Rightarrow> 'b) \<times> 'b poset) . fst (snd f)" done interpretation poset_morphism "(left x)" "(right x)" "func x" apply (standard; transfer; clarsimp) apply (meson morphism.maps_betw poset_morphism.axioms(1)) by (simp add: poset_morphism.mono_ord) interpretation id_morphism: poset_morphism P P id by (standard; clarsimp) lift_definition lift_poset_morphism :: "'a poset \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'b poset \<Rightarrow> ('a, 'b) poset_morphism" is "\<lambda>a f b. if poset_morphism a b f then (a, f, b) else Rep_poset_morphism (undefined)" apply (clarsimp) by (metis fst_conv func.rep_eq left.rep_eq poset_morphism_axioms right.rep_eq snd_conv) definition "compose_poset f g = lift_poset_morphism (left f) (func g o func f) (right g)" notation compose_poset (infixl "\<cdot>" 55) definition "compatible f g \<equiv> right f = left g" definition "mono_betw m P f P' \<equiv> left m = P \<and> right m = P' \<and> func m = f" notation mono_betw ("_ \<Ztypecolon> _ \<longrightarrow>\<^sub>_ _") lemma mono_betw_left[dest]: "mono_betw m P f P' \<Longrightarrow> left m = P" unfolding mono_betw_def by simp lemma mono_betw_right[dest]: "mono_betw m P f P' \<Longrightarrow> right m = P'" unfolding mono_betw_def by simp lemma mono_betw_func[dest]: "mono_betw m P f P' \<Longrightarrow> func m = f" unfolding mono_betw_def by simp lemma poset_morphism_compose: "poset_morphism a b f \<Longrightarrow> poset_morphism b c g \<Longrightarrow> poset_morphism a c (g \<circ> f)" apply (standard; clarsimp) apply (meson morphism.maps_betw poset_morphism.axioms(1)) by (meson morphism.maps_betw poset_morphism.axioms(1) poset_morphism.axioms(2) poset_morphism_axioms_def) lemma left_comp_iff[dest]: "compatible m m' \<Longrightarrow> mono_betw (m \<cdot> m') P f P' \<Longrightarrow> left m = P" apply (clarsimp simp: mono_betw_def) apply (clarsimp simp: compatible_def compose_poset_def, transfer) by (clarsimp simp:poset_morphism_compose ) lemma right_comp_iff[dest]: "compatible m m' \<Longrightarrow> mono_betw (m \<cdot> m') P f P' \<Longrightarrow> right m' = P'" apply (clarsimp simp: mono_betw_def) by (clarsimp simp: compatible_def compose_poset_def, transfer, clarsimp simp: poset_morphism_compose) lemma func_comp_iff[dest]: "compatible m m' \<Longrightarrow> mono_betw (m \<cdot> m') P f P' \<Longrightarrow> f = func m' o func m" apply (clarsimp simp: mono_betw_def) by (clarsimp simp: compatible_def compose_poset_def, transfer, clarsimp simp: poset_morphism_compose) lemma "morphism_witness m f P P' \<Longrightarrow> x \<in> P \<Longrightarrow> f x \<in> P'" apply (clarsimp simp: morphism_witness_def) by (simp add: maps_betw morphism_witness_def) locale two_posets = A: poset S le + B: poset S' le' for S S' le le' begin sublocale product_poset: poset "S \<times> S'" "(\<lambda>x y. le (fst x) (fst y) \<and> le' (snd x) (snd y))" apply (standard) apply (simp add: A.p_refl B.p_refl mem_Times_iff) apply (metis A.p_trans B.p_trans mem_Times_iff) using A.op_poset.p_antisym B.op_poset.p_antisym by force end interpretation two_posets "el P" "el P'" "leq P" "leq P'" by (standard) notation product_poset.witness (infixl \<open>\<times>\<^sub>P\<close> 50) term "nat_pos.witness \<times>\<^sub>P discrete.witness" end
Require Import Ashley.Axioms. Require Import Ashley.Category. Require Import Ashley.SetFunction. Instance Category_Category: Category (set_type Category) := { hom cat1 cat2 := Functor (struct cat1) (struct cat2); id cat := identity_functor (struct cat); compose c1 c2 c3 := compose_functor }. intros. unfold compose_functor. f_equal. Definition mapHomOff `(f: Functor) := @mapHom _ _ _ _ f. Check @mapHom. Definition mapHomOf1 `(A: Category) `(B: Category) (f: Functor A B) (o1 o2: objOf A) (m: homOf A o1 o2) : homOf B (mapObjOf f o1) (mapObjOf f o2) := @mapHom (objOf A) A (objOf B) B f o1 o2 m. Check mapHomOf1. Record R: Type := MkR {rT: Type; rV: rT}. Lemma test: forall (a b: R), a = b. intros. apply R_ind. intros. symmetry. apply R_ind. intros. f_equal. Lemma functor_equal: forall `(A: Category) `(B: Category) (f1: Functor A B) (f2: Functor A B), (mapObjOf f1 = mapObjOf f2) -> (forall (o1: objOf A) (o2: objOf A) (m : homOf A o1 o2), mapHomOf1 A B f1 o1 o2 m = mapHomOf1 A B f2 o1 o2 m) -> f1 = f2.
Formal statement is: lemma convex_Times: "convex s \<Longrightarrow> convex t \<Longrightarrow> convex (s \<times> t)" Informal statement is: If $s$ and $t$ are convex sets, then $s \times t$ is convex.
import tactic def square {A B : Type*} (R : A → B → Prop) : Prop := ∀ x₁ x₂ y₁ y₂, R x₁ y₁ → R x₂ y₁ → R x₂ y₂ → R x₁ y₂ structure edge (X Y : Type) : Type := ( R : X → Y → Prop ) ( square : square R ) namespace edge variables {X Y : Type} def le : edge X Y → edge X Y → Prop := λ e₁ e₂, ∃ (f : X → X) (g : Y → Y), ∀ x y, e₁.R (f x) y ↔ e₂.R x (g y) instance : preorder (edge X Y) := { le := le, le_refl := λ _, ⟨id, id, λ _ _, iff.rfl⟩, le_trans := λ a b c ⟨f₁, g₁, h₁⟩ ⟨f₂, g₂, h₂⟩, ⟨f₁ ∘ f₂, g₂ ∘ g₁, λ x y, (h₁ _ _).trans $ h₂ _ _⟩ } def of_fun (f : X → Y) : edge X Y := { R := λ x y, f x = y, square := λ _ _ _ _, by cc } lemma maximal_of_fun (f : X → Y) (E : edge X Y) (h : of_fun f ≤ E) : E ≤ of_fun f := begin rcases h with ⟨a, b, h⟩, refine ⟨a, b, _⟩, dsimp [of_fun] at *, end end edge
[STATEMENT] lemma set_times_mono3 [intro]: "a \<in> C \<Longrightarrow> a *o D \<subseteq> C * D" [PROOF STATE] proof (prove) goal (1 subgoal): 1. a \<in> C \<Longrightarrow> a *o D \<subseteq> C * D [PROOF STEP] by (auto simp add: elt_set_times_def set_times_def)
import data.real.basic def fn_lb (f : ℝ → ℝ) (a : ℝ) : Prop := ∀ x, a ≤ f x def fn_has_lb (f : ℝ → ℝ) := ∃ a, fn_lb f a variable f : ℝ → ℝ -- BEGIN example (h : ∀ a, ∃ x, f x < a) : ¬ fn_has_lb f := begin intro fnlb, cases fnlb with a fnlba, cases h a with x hx, have : f x ≥ a, from fnlba x, linarith, end -- END
module Example where open import Logic.Identity open import Base open import Category open import Product open import Terminal open import Unique import Iso infixr 30 _─→_ infixr 90 _∘_ data Name : Set where Zero : Name One : Name Half : Name data Obj : Set1 where obj : Name -> Obj mutual _─→'_ : Name -> Name -> Set x ─→' y = obj x ─→ obj y data _─→_ : Obj -> Obj -> Set where Idle : {A : Name} -> A ─→' A All : Zero ─→' One Start : Zero ─→' Half Turn : Half ─→' Half Back : One ─→' Half End : Half ─→' One id : {A : Obj} -> A ─→ A id {obj x} = Idle _∘_ : {A B C : Obj} -> B ─→ C -> A ─→ B -> A ─→ C f ∘ Idle = f Idle ∘ All = All Idle ∘ Start = Start Turn ∘ Start = Start End ∘ Start = All Idle ∘ Turn = Turn Turn ∘ Turn = Turn End ∘ Turn = End Idle ∘ Back = Back Turn ∘ Back = Back End ∘ Back = Idle Idle ∘ End = End idL : {A B : Obj}{f : A ─→ B} -> id ∘ f ≡ f idL {f = Idle } = refl idL {f = All } = refl idL {f = Start } = refl idL {f = Turn } = refl idL {f = Back } = refl idL {f = End } = refl idR : {A B : Obj}{f : A ─→ B} -> f ∘ id ≡ f idR {obj _} = refl assoc : {A B C D : Obj}{f : C ─→ D}{g : B ─→ C}{h : A ─→ B} -> (f ∘ g) ∘ h ≡ f ∘ (g ∘ h) assoc {f = _ }{g = _ }{h = Idle } = refl assoc {f = _ }{g = Idle}{h = All } = refl assoc {f = _ }{g = Idle}{h = Start} = refl assoc {f = Idle}{g = Turn}{h = Start} = refl assoc {f = Turn}{g = Turn}{h = Start} = refl assoc {f = End }{g = Turn}{h = Start} = refl assoc {f = Idle}{g = End }{h = Start} = refl assoc {f = _ }{g = Idle}{h = Turn } = refl assoc {f = Idle}{g = Turn}{h = Turn } = refl assoc {f = Turn}{g = Turn}{h = Turn } = refl assoc {f = End }{g = Turn}{h = Turn } = refl assoc {f = Idle}{g = End }{h = Turn } = refl assoc {f = _ }{g = Idle}{h = Back } = refl assoc {f = Idle}{g = Turn}{h = Back } = refl assoc {f = Turn}{g = Turn}{h = Back } = refl assoc {f = End }{g = Turn}{h = Back } = refl assoc {f = Idle}{g = End }{h = Back } = refl assoc {f = _ }{g = Idle}{h = End } = refl ℂ : Cat ℂ = cat Obj _─→_ id _∘_ (\{_}{_} -> Equiv) (\{_}{_}{_} -> cong2 _∘_) idL idR assoc open module T = Term ℂ open module I = Init ℂ open module S = Sum ℂ term : Terminal (obj One) term (obj Zero) = ? init : Initial (obj Zero) init = ?
using TropicalYao.Reversible using Test @testset "LogLikeNumbers" begin include("LogLikeNumbers/LogLikeNumbers.jl") end @testset "spinglass_gates" begin include("spinglass_gates.jl") end @testset "instructions" begin include("instructs.jl") end
function [db,f]=v_lpccc2db(cc,np,nc,c0) %V_LPCCC2DB Convert complex cepstrum to dB power spectrum DB=(CC,NP,NC) % % Inputs: cc(nf,n) Complex ceptral coefficients excluding c(0), one frame per row % np Size of output spectrum is np+1 [n] % Alternatively, np can be a vector of output frequencies in the range 0 to 0.5 % nc Highest cepstral coefficient to use [np or, if np is a vector, n] % Set nc=-1 to use n coefficients % c0(nf,1) Cepstral coefficient cc(0) [0] % % Outputs: db(nf,np+2) Power spectrum from DC to Nyquist in dB % f(1,np+2) Normalized frequencies (0 to 0.5) % % The "complex cepstral coefficients", cc(n), are the inverse discrete-time Fourier transform % of the log of the complex-valued spectrum. The cc(n) are real-valued and, for n<0, cc(n)=0. % The "real cepstral coeffcients", rc(n), are the inverse discrete-time Fourier transform % of the log of the magnitude spectrum; rc(0)=cc(0) and rc(n)=0.5*cc(n) for n~=0. % For highest speed, choose np to be a power of 2. % Copyright (C) Mike Brookes 1998-2014 % Version: $Id: v_lpccc2db.m 10865 2018-09-21 17:22:45Z dmb $ % % VOICEBOX is a MATLAB toolbox for speech processing. % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation; either version 2 of the License, or % (at your option) any later version. % % This program is distributed in the hope that it will be useful, % but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You can obtain a copy of the GNU General Public License from % http://www.gnu.org/copyleft/gpl.html or by writing to % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% [nf,mc]=size(cc); if nargin<2 || ~numel(np) if nargout np=mc; else np=128; end end k=10/log(10); if nargin>=3 && numel(nc)==1 && nc==-1 nc=mc; end if nargin<4 || ~numel(c0) c0=zeros(nf,1); end if numel(np)>1 || np(1)<1 if nargin<3 || ~numel(nc) nc=mc; end f=np(:)'; if nc==mc db=k*(2*[c0 cc]*cos(2*pi*(0:mc)'*f)); else db=k*(2*[c0 lpccc2cc(cc,nc)]*cos(2*pi*(0:nc)'*f)); end else if nargin<3 || ~numel(nc) nc=np; end if nc==mc db=k*(2*real(v_rfft([c0 cc].',2*np).')); else db=k*(2*real(v_rfft([c0 v_lpccc2cc(cc,nc)].',2*np).')); end f=linspace(0,0.5,np+1); end if ~nargout plot(f,db.'); xlabel('Normalized frequency f/f_s'); ylabel('Gain (dB)'); end
# Copyright (c) 2018-2021, Carnegie Mellon University # See LICENSE for details #F ExpFunc - ExpDiag element function. #F Class(ExpFunc, Lambda, rec( _isExpFunc := true, # this is not a ranked index function, not related to GT, # GT should not mess with it in the first place downRank := (self, loopid, ind) >> self, downRankFull := (self, inds) >> self, upRank := self >> self, upRankBy := (self, n) >> self, rotate := (self, n) >> self, split := (self, loopid, inner_its, outer_its) >> self, )); IsExpFunc := (obj) -> IsRec(obj) and IsBound(obj._isExpFunc) and obj._isExpFunc; #F ExpDiag(<func>, <d>) #F #F ExpDiag(ExpFunc( [a,b], sub(a,b) ), 3) #F #F corresponds to matrix: #F [ [ 1 -1 0 0 0 0 ], #F [ 0 0 1 -1 0 0 ], #F [ 0 0 0 0 1 -1 ] ] #F Class(ExpDiag, BaseMat, rec( _short_print := true, abbrevs := [ (L, d) -> Checked( IsExpFunc(L) and IsPosIntSym(d), [L, d] )], new := (self, L, d) >> SPL(WithBases(self, rec(element := L, TType := L.range(), d := d))).setDims(), #----------------------------------------------------------------------- dims := self >> [self.d, self.d*Length(self.element.vars)], #----------------------------------------------------------------------- isPermutation := self >> false, #----------------------------------------------------------------------- isReal := self >> let( t := self.element.range(), tt := Cond(IsVecT(t), t.t, t), tt <> TComplex and ObjId(tt)<>T_Complex), #----------------------------------------------------------------------- toAMat := abstract(), #----------------------------------------------------------------------- transpose := abstract(), conjTranspose := abstract(), inverse := abstract(), #----------------------------------------------------------------------- arithmeticCost := abstract(), sums := self >> self, rChildren := (self) >> [self.element, self.d], rSetChild := rSetChildFields("element", "d"), area := self >> self.d ));
Require Import compcert.lib.Coqlib. Require Import compcert.lib.Integers. Require Import compcert.lib.Floats. Require Import compcert.common.Values. Require Import compcert.common.Memory. Require Import Coq.micromega.Lia. Require Import VST.msl.eq_dec. Definition address : Type := (block * Z)%type. Instance EqDec_block: EqDec block := eq_block. Instance EqDec_address: EqDec address. Proof. intros [b1 z1] [b2 z2]. destruct (eq_dec b1 b2). destruct (Z.eq_dec z1 z2). left; congruence. right; congruence. right; congruence. Qed. Instance EqDec_int: EqDec int := Int.eq_dec. Instance EqDec_float: EqDec float := Float.eq_dec. Instance EqDec_val: EqDec val. Proof. hnf. decide equality. apply Int.eq_dec. apply Int64.eq_dec. apply Float.eq_dec. apply Float32.eq_dec. apply Ptrofs.eq_dec. (* apply Int.eq_dec.*) apply eq_block. Qed. Definition adr_range (base: address) (size: Z) (loc: address) : Prop := match base, loc with | (b, ofs) , (b', ofs') => b=b' /\ (ofs <= ofs' < ofs + size) end. Lemma adr_range_dec: forall base n loc, {adr_range base n loc} + {~adr_range base n loc}. Proof. unfold adr_range; intros. destruct base as [b z]; destruct loc as [b' z']. destruct (eq_block b b'). subst b'. destruct (zle z z'). destruct (zlt z' (z+n)). left; auto. right; intros [? ?]; lia. right; intros [? ?]; lia. right; intros [? ?]; lia. Qed. (* Definition size_chunk (chunk: memory_chunk) : Z := match chunk with | Mint8signed => 1 | Mint8unsigned => 1 | Mint16signed => 2 | Mint16unsigned => 2 | Mint32 => 4 | Mfloat32 => 4 | Mfloat64 => 8 | Mfloat64al32 => 4 end. *) Remark size_chunk_pos: forall chunk1, size_chunk chunk1 > 0. Proof. destruct chunk1; simpl; lia. Qed. Lemma zero_in_chunk: forall ch, 0 <= 0 < size_chunk ch. Proof. intros; generalize (size_chunk_pos ch); lia. Qed. #[export] Hint Resolve zero_in_chunk : mem. Definition range_overlap (base1: address) (sz1: Z) (base2: address) (sz2: Z) : Prop := exists loc, adr_range base1 sz1 loc /\ adr_range base2 sz2 loc. Definition adr_add (loc: address) (ofs: Z) : address := (fst loc, snd loc + ofs). Definition val2adr (v: val) (l: address) : Prop := (* match v with Vptr b ofs => l = (b, Int.unsigned ofs) | _ => False end.*) match v with Vptr b ofs => l = (b, Ptrofs.unsigned ofs) | _ => False end. Lemma adr_range_non_zero: forall l1 n l2, adr_range l1 n l2 -> n > 0. Proof. intros. unfold adr_range in H. destruct l1, l2. destruct (zlt 0 n); lia. Qed. Lemma adr_range_shift_1: forall bl ofs n l, adr_range (bl, ofs + 1) (Z.of_nat n) l -> adr_range (bl, ofs) (Z.of_nat (S n)) l. Proof. intros. destruct l. unfold adr_range in *. rewrite Nat2Z.inj_succ. destruct H. repeat split; auto; lia. Qed. Lemma adr_range_S_split: forall bl ofs n l, adr_range (bl, ofs) (Z.of_nat (S n)) l -> adr_range (bl, ofs + 1) (Z.of_nat n) l \/ l = (bl, ofs). Proof. intros. destruct l. unfold adr_range in *. rewrite Nat2Z.inj_succ in H. destruct H. subst bl. destruct (zlt ofs z); [left | right]. + split; auto; lia. + f_equal; lia. Qed.
module Test.Accumulate import Accumulate %access export assertEq : Eq a => String -> (given : a) -> (expected : a) -> IO () assertEq label g e = putStrLn $ if g == e then label ++ ": Test Passed" else label ++ ": Test Failed" testEmptyListDoesNothing : IO () testEmptyListDoesNothing = assertEq "empty list does nothing" (accumulate (\x => x) []) (the (List Int) []) testIdentityFunctionDoesNothing : IO () testIdentityFunctionDoesNothing = assertEq "identity function does nothing" (accumulate (\x => x) [1,2,3]) [1,2,3] testSquareFunctionDoublesInput : IO () testSquareFunctionDoublesInput = assertEq "square function doubles input" (accumulate (\x => x * x) [1,2,3]) [1,4,9] testCubeFunctionTriplesInput : IO () testCubeFunctionTriplesInput = assertEq "cube function triples input" (accumulate (\x => x * x * x) [1,2,3]) [1,8,27] testIncrementFunctionAddsOneToAllInput : IO () testIncrementFunctionAddsOneToAllInput = assertEq "increment function adds 1 to input" (accumulate (\x => x + 1) [1,2,3]) [2,3,4] testDecrementFunctionAddsOneToAllInput : IO () testDecrementFunctionAddsOneToAllInput = assertEq "decrement function subtracts 1 from input" (accumulate (\x => x - 1) [1,2,3]) (the (List Int) [0,1,2]) runTests : IO () runTests = do testEmptyListDoesNothing testIdentityFunctionDoesNothing testSquareFunctionDoublesInput testCubeFunctionTriplesInput testIncrementFunctionAddsOneToAllInput testDecrementFunctionAddsOneToAllInput
section \<open>Monad-Plus Class\<close> theory Monad_Plus imports Monad begin hide_const (open) Fixrec.mplus class plusU = tycon + fixes plusU :: "udom\<cdot>'a \<rightarrow> udom\<cdot>'a \<rightarrow> udom\<cdot>'a::tycon" class functor_plus = plusU + "functor" + assumes fmapU_plusU [coerce_simp]: "fmapU\<cdot>f\<cdot>(plusU\<cdot>a\<cdot>b) = plusU\<cdot>(fmapU\<cdot>f\<cdot>a)\<cdot>(fmapU\<cdot>f\<cdot>b)" assumes plusU_assoc: "plusU\<cdot>(plusU\<cdot>a\<cdot>b)\<cdot>c = plusU\<cdot>a\<cdot>(plusU\<cdot>b\<cdot>c)" class monad_plus = plusU + monad + assumes bindU_plusU: "bindU\<cdot>(plusU\<cdot>xs\<cdot>ys)\<cdot>k = plusU\<cdot>(bindU\<cdot>xs\<cdot>k)\<cdot>(bindU\<cdot>ys\<cdot>k)" assumes plusU_assoc': "plusU\<cdot>(plusU\<cdot>a\<cdot>b)\<cdot>c = plusU\<cdot>a\<cdot>(plusU\<cdot>b\<cdot>c)" instance monad_plus \<subseteq> functor_plus by standard (simp_all only: fmapU_eq_bindU bindU_plusU plusU_assoc') definition fplus :: "'a\<cdot>'f::functor_plus \<rightarrow> 'a\<cdot>'f \<rightarrow> 'a\<cdot>'f" where "fplus = coerce\<cdot>(plusU :: udom\<cdot>'f \<rightarrow> _)" lemma fmap_fplus: fixes f :: "'a \<rightarrow> 'b" and a b :: "'a\<cdot>'f::functor_plus" shows "fmap\<cdot>f\<cdot>(fplus\<cdot>a\<cdot>b) = fplus\<cdot>(fmap\<cdot>f\<cdot>a)\<cdot>(fmap\<cdot>f\<cdot>b)" unfolding fmap_def fplus_def by (simp add: coerce_simp) lemma fplus_assoc: fixes a b c :: "'a\<cdot>'f::functor_plus" shows "fplus\<cdot>(fplus\<cdot>a\<cdot>b)\<cdot>c = fplus\<cdot>a\<cdot>(fplus\<cdot>b\<cdot>c)" unfolding fplus_def by (simp add: coerce_simp plusU_assoc) abbreviation mplus :: "'a\<cdot>'m::monad_plus \<rightarrow> 'a\<cdot>'m \<rightarrow> 'a\<cdot>'m" where "mplus \<equiv> fplus" lemmas mplus_def = fplus_def [where 'f="'m::monad_plus" for f] lemmas fmap_mplus = fmap_fplus [where 'f="'m::monad_plus" for f] lemmas mplus_assoc = fplus_assoc [where 'f="'m::monad_plus" for f] lemma bind_mplus: fixes a b :: "'a\<cdot>'m::monad_plus" shows "bind\<cdot>(mplus\<cdot>a\<cdot>b)\<cdot>k = mplus\<cdot>(bind\<cdot>a\<cdot>k)\<cdot>(bind\<cdot>b\<cdot>k)" unfolding bind_def mplus_def by (simp add: coerce_simp bindU_plusU) end
[STATEMENT] lemma pairwise_disjnt_imp_sunflower: "pairwise disjnt F \<Longrightarrow> sunflower F" [PROOF STATE] proof (prove) goal (1 subgoal): 1. pairwise disjnt F \<Longrightarrow> sunflower F [PROOF STEP] unfolding sunflower_def [PROOF STATE] proof (prove) goal (1 subgoal): 1. pairwise disjnt F \<Longrightarrow> \<forall>x. (\<exists>A B. A \<in> F \<and> B \<in> F \<and> A \<noteq> B \<and> x \<in> A \<and> x \<in> B) \<longrightarrow> (\<forall>A. A \<in> F \<longrightarrow> x \<in> A) [PROOF STEP] by (metis disjnt_insert1 mk_disjoint_insert pairwiseD)
Formal statement is: lemma eventually_nhdsin: "eventually P (nhdsin X a) \<longleftrightarrow> a \<notin> topspace X \<or> (\<exists>S. openin X S \<and> a \<in> S \<and> (\<forall>x\<in>S. P x))" Informal statement is: The predicate $P$ holds eventually in the neighborhood filter of $a$ in $X$ if and only if $a$ is not in the topological space $X$ or there exists an open set $S$ in $X$ such that $a$ is in $S$ and $P$ holds for all $x$ in $S$.
{-# OPTIONS --without-K --safe #-} open import Categories.Category.Core using (Category) module Categories.Diagram.Coequalizer {o ℓ e} (𝒞 : Category o ℓ e) where open Category 𝒞 open HomReasoning open Equiv open import Categories.Morphism 𝒞 open import Categories.Morphism.Reasoning 𝒞 open import Level open import Function using (_$_) private variable A B C : Obj h i j k : A ⇒ B record IsCoequalizer {E} (f g : A ⇒ B) (arr : B ⇒ E) : Set (o ⊔ ℓ ⊔ e) where field equality : arr ∘ f ≈ arr ∘ g coequalize : {h : B ⇒ C} → h ∘ f ≈ h ∘ g → E ⇒ C universal : {h : B ⇒ C} {eq : h ∘ f ≈ h ∘ g} → h ≈ coequalize eq ∘ arr unique : {h : B ⇒ C} {i : E ⇒ C} {eq : h ∘ f ≈ h ∘ g} → h ≈ i ∘ arr → i ≈ coequalize eq unique′ : (eq eq′ : h ∘ f ≈ h ∘ g) → coequalize eq ≈ coequalize eq′ unique′ eq eq′ = unique universal id-coequalize : id ≈ coequalize equality id-coequalize = unique (⟺ identityˡ) coequalize-resp-≈ : ∀ {eq : h ∘ f ≈ h ∘ g} {eq′ : i ∘ f ≈ i ∘ g} → h ≈ i → coequalize eq ≈ coequalize eq′ coequalize-resp-≈ {h = h} {i = i} {eq = eq} {eq′ = eq′} h≈i = unique $ begin i ≈˘⟨ h≈i ⟩ h ≈⟨ universal ⟩ coequalize eq ∘ arr ∎ coequalize-resp-≈′ : (eq : h ∘ f ≈ h ∘ g) → (eq′ : i ∘ f ≈ i ∘ g) → h ≈ i → j ≈ coequalize eq → k ≈ coequalize eq′ → j ≈ k coequalize-resp-≈′ {j = j} {k = k} eq eq′ h≈i eqj eqk = begin j ≈⟨ eqj ⟩ coequalize eq ≈⟨ coequalize-resp-≈ h≈i ⟩ coequalize eq′ ≈˘⟨ eqk ⟩ k ∎ -- This could be proved via duality, but is easier to just write by hand, -- as it makes the dependency graph a lot cleaner. IsCoequalizer⇒Epi : IsCoequalizer h i j → Epi j IsCoequalizer⇒Epi coeq _ _ eq = coequalize-resp-≈′ (extendˡ equality) (extendˡ equality) eq (unique refl) (unique refl) where open IsCoequalizer coeq record Coequalizer (f g : A ⇒ B) : Set (o ⊔ ℓ ⊔ e) where field {obj} : Obj arr : B ⇒ obj isCoequalizer : IsCoequalizer f g arr open IsCoequalizer isCoequalizer public Coequalizer⇒Epi : (e : Coequalizer h i) → Epi (Coequalizer.arr e) Coequalizer⇒Epi coeq = IsCoequalizer⇒Epi isCoequalizer where open Coequalizer coeq -- Proving this via duality arguments is kind of annoying, as ≅ does not behave nicely in -- concert with op. up-to-iso : (coe₁ coe₂ : Coequalizer h i) → Coequalizer.obj coe₁ ≅ Coequalizer.obj coe₂ up-to-iso coe₁ coe₂ = record { from = repack coe₁ coe₂ ; to = repack coe₂ coe₁ ; iso = record { isoˡ = repack-cancel coe₂ coe₁ ; isoʳ = repack-cancel coe₁ coe₂ } } where open Coequalizer repack : (coe₁ coe₂ : Coequalizer h i) → obj coe₁ ⇒ obj coe₂ repack coe₁ coe₂ = coequalize coe₁ (equality coe₂) repack∘ : (coe₁ coe₂ coe₃ : Coequalizer h i) → repack coe₂ coe₃ ∘ repack coe₁ coe₂ ≈ repack coe₁ coe₃ repack∘ coe₁ coe₂ coe₃ = unique coe₁ (⟺ (glueTrianglesˡ (⟺ (universal coe₂)) (⟺ (universal coe₁)))) -- unique e₃ (⟺ (glueTrianglesʳ (⟺ (universal e₃)) (⟺ (universal e₂)))) repack-cancel : (e₁ e₂ : Coequalizer h i) → repack e₁ e₂ ∘ repack e₂ e₁ ≈ id repack-cancel coe₁ coe₂ = repack∘ coe₂ coe₁ coe₂ ○ ⟺ (id-coequalize coe₂) IsCoequalizer⇒Coequalizer : IsCoequalizer h i k → Coequalizer h i IsCoequalizer⇒Coequalizer {k = k} is-coe = record { arr = k ; isCoequalizer = is-coe }
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov, Heather Macbeth, Sébastien Gouëzel -/ import analysis.calculus.times_cont_diff import tactic.ring_exp import analysis.normed_space.banach import topology.local_homeomorph /-! # Inverse function theorem In this file we prove the inverse function theorem. It says that if a map `f : E → F` has an invertible strict derivative `f'` at `a`, then it is locally invertible, and the inverse function has derivative `f' ⁻¹`. We define `has_strict_deriv_at.to_local_homeomorph` that repacks a function `f` with a `hf : has_strict_fderiv_at f f' a`, `f' : E ≃L[𝕜] F`, into a `local_homeomorph`. The `to_fun` of this `local_homeomorph` is `defeq` to `f`, so one can apply theorems about `local_homeomorph` to `hf.to_local_homeomorph f`, and get statements about `f`. Then we define `has_strict_fderiv_at.local_inverse` to be the `inv_fun` of this `local_homeomorph`, and prove two versions of the inverse function theorem: * `has_strict_fderiv_at.to_local_inverse`: if `f` has an invertible derivative `f'` at `a` in the strict sense (`hf`), then `hf.local_inverse f f' a` has derivative `f'.symm` at `f a` in the strict sense; * `has_strict_fderiv_at.to_local_left_inverse`: if `f` has an invertible derivative `f'` at `a` in the strict sense and `g` is locally left inverse to `f` near `a`, then `g` has derivative `f'.symm` at `f a` in the strict sense. In the one-dimensional case we reformulate these theorems in terms of `has_strict_deriv_at` and `f'⁻¹`. We also reformulate the theorems in terms of `times_cont_diff`, to give that `C^k` (respectively, smooth) inputs give `C^k` (smooth) inverses. These versions require that continuous differentiability implies strict differentiability; this is false over a general field, true over `ℝ` or `ℂ` and implemented here assuming `is_R_or_C 𝕂`. Some related theorems, providing the derivative and higher regularity assuming that we already know the inverse function, are formulated in `fderiv.lean`, `deriv.lean`, and `times_cont_diff.lean`. ## Notations In the section about `approximates_linear_on` we introduce some `local notation` to make formulas shorter: * by `N` we denote `∥f'⁻¹∥`; * by `g` we denote the auxiliary contracting map `x ↦ x + f'.symm (y - f x)` used to prove that `{x | f x = y}` is nonempty. ## Tags derivative, strictly differentiable, continuously differentiable, smooth, inverse function -/ open function set filter metric open_locale topological_space classical nnreal noncomputable theory variables {𝕜 : Type*} [nondiscrete_normed_field 𝕜] variables {E : Type*} [normed_group E] [normed_space 𝕜 E] variables {F : Type*} [normed_group F] [normed_space 𝕜 F] variables {G : Type*} [normed_group G] [normed_space 𝕜 G] variables {G' : Type*} [normed_group G'] [normed_space 𝕜 G'] variables {ε : ℝ} open asymptotics filter metric set open continuous_linear_map (id) /-! ### Non-linear maps close to affine maps In this section we study a map `f` such that `∥f x - f y - f' (x - y)∥ ≤ c * ∥x - y∥` on an open set `s`, where `f' : E →L[𝕜] F` is a continuous linear map and `c` is suitably small. Maps of this type behave like `f a + f' (x - a)` near each `a ∈ s`. When `f'` is onto, we show that `f` is locally onto. When `f'` is a continuous linear equiv, we show that `f` is a homeomorphism between `s` and `f '' s`. More precisely, we define `approximates_linear_on.to_local_homeomorph` to be a `local_homeomorph` with `to_fun = f`, `source = s`, and `target = f '' s`. Maps of this type naturally appear in the proof of the inverse function theorem (see next section), and `approximates_linear_on.to_local_homeomorph` will imply that the locally inverse function exists. We define this auxiliary notion to split the proof of the inverse function theorem into small lemmas. This approach makes it possible - to prove a lower estimate on the size of the domain of the inverse function; - to reuse parts of the proofs in the case if a function is not strictly differentiable. E.g., for a function `f : E × F → G` with estimates on `f x y₁ - f x y₂` but not on `f x₁ y - f x₂ y`. -/ /-- We say that `f` approximates a continuous linear map `f'` on `s` with constant `c`, if `∥f x - f y - f' (x - y)∥ ≤ c * ∥x - y∥` whenever `x, y ∈ s`. This predicate is defined to facilitate the splitting of the inverse function theorem into small lemmas. Some of these lemmas can be useful, e.g., to prove that the inverse function is defined on a specific set. -/ def approximates_linear_on (f : E → F) (f' : E →L[𝕜] F) (s : set E) (c : ℝ≥0) : Prop := ∀ (x ∈ s) (y ∈ s), ∥f x - f y - f' (x - y)∥ ≤ c * ∥x - y∥ namespace approximates_linear_on variables [cs : complete_space E] {f : E → F} /-! First we prove some properties of a function that `approximates_linear_on` a (not necessarily invertible) continuous linear map. -/ section variables {f' : E →L[𝕜] F} {s t : set E} {c c' : ℝ≥0} theorem mono_num (hc : c ≤ c') (hf : approximates_linear_on f f' s c) : approximates_linear_on f f' s c' := λ x hx y hy, le_trans (hf x hx y hy) (mul_le_mul_of_nonneg_right hc $ norm_nonneg _) theorem mono_set (hst : s ⊆ t) (hf : approximates_linear_on f f' t c) : approximates_linear_on f f' s c := λ x hx y hy, hf x (hst hx) y (hst hy) lemma lipschitz_sub (hf : approximates_linear_on f f' s c) : lipschitz_with c (λ x : s, f x - f' x) := begin refine lipschitz_with.of_dist_le_mul (λ x y, _), rw [dist_eq_norm, subtype.dist_eq, dist_eq_norm], convert hf x x.2 y y.2 using 2, rw [f'.map_sub], abel end protected lemma lipschitz (hf : approximates_linear_on f f' s c) : lipschitz_with (nnnorm f' + c) (s.restrict f) := by simpa only [restrict_apply, add_sub_cancel'_right] using (f'.lipschitz.restrict s).add hf.lipschitz_sub protected lemma continuous (hf : approximates_linear_on f f' s c) : continuous (s.restrict f) := hf.lipschitz.continuous protected lemma continuous_on (hf : approximates_linear_on f f' s c) : continuous_on f s := continuous_on_iff_continuous_restrict.2 hf.continuous end section locally_onto /-! We prove that a function which is linearly approximated by a continuous linear map with a nonlinear right inverse is locally onto. This will apply to the case where the approximating map is a linear equivalence, for the local inverse theorem, but also whenever the approximating map is onto, by Banach's open mapping theorem. -/ include cs variables {s : set E} {c : ℝ≥0} {f' : E →L[𝕜] F} /-- If a function is linearly approximated by a continuous linear map with a (possibly nonlinear) right inverse, then it is locally onto: a ball of an explicit radius is included in the image of the map. -/ theorem surj_on_closed_ball_of_nonlinear_right_inverse (hf : approximates_linear_on f f' s c) (f'symm : f'.nonlinear_right_inverse) {ε : ℝ} {b : E} (ε0 : 0 ≤ ε) (hε : closed_ball b ε ⊆ s) : surj_on f (closed_ball b ε) (closed_ball (f b) (((f'symm.nnnorm : ℝ)⁻¹ - c) * ε)) := begin assume y hy, cases le_or_lt (f'symm.nnnorm : ℝ) ⁻¹ c with hc hc, { refine ⟨b, by simp [ε0], _⟩, have : dist y (f b) ≤ 0 := (mem_closed_ball.1 hy).trans (mul_nonpos_of_nonpos_of_nonneg (by linarith) ε0), simp only [dist_le_zero] at this, rw this }, have If' : (0 : ℝ) < f'symm.nnnorm, by { rw [← inv_pos], exact (nnreal.coe_nonneg _).trans_lt hc }, have Icf' : (c : ℝ) * f'symm.nnnorm < 1, by rwa [inv_eq_one_div, lt_div_iff If'] at hc, have Jf' : (f'symm.nnnorm : ℝ) ≠ 0 := ne_of_gt If', have Jcf' : (1 : ℝ) - c * f'symm.nnnorm ≠ 0, by { apply ne_of_gt, linarith }, /- We have to show that `y` can be written as `f x` for some `x ∈ closed_ball b ε`. The idea of the proof is to apply the Banach contraction principle to the map `g : x ↦ x + f'symm (y - f x)`, as a fixed point of this map satisfies `f x = y`. When `f'symm` is a genuine linear inverse, `g` is a contracting map. In our case, since `f'symm` is nonlinear, this map is not contracting (it is not even continuous), but still the proof of the contraction theorem holds: `uₙ = gⁿ b` is a Cauchy sequence, converging exponentially fast to the desired point `x`. Instead of appealing to general results, we check this by hand. The main point is that `f (u n)` becomes exponentially close to `y`, and therefore `dist (u (n+1)) (u n)` becomes exponentally small, making it possible to get an inductive bound on `dist (u n) b`, from which one checks that `u n` stays in the ball on which one has a control. Therefore, the bound can be checked at the next step, and so on inductively. -/ set g := λ x, x + f'symm (y - f x) with hg, set u := λ (n : ℕ), g ^[n] b with hu, have usucc : ∀ n, u (n + 1) = g (u n), by simp [hu, ← iterate_succ_apply' g _ b], -- First bound: if `f z` is close to `y`, then `g z` is close to `z` (i.e., almost a fixed point). have A : ∀ z, dist (g z) z ≤ f'symm.nnnorm * dist (f z) y, { assume z, rw [dist_eq_norm, hg, add_sub_cancel', dist_eq_norm'], exact f'symm.bound _ }, -- Second bound: if `z` and `g z` are in the set with good control, then `f (g z)` becomes closer -- to `y` than `f z` was (this uses the linear approximation property, and is the reason for the -- choice of the formula for `g`). have B : ∀ z ∈ closed_ball b ε, g z ∈ closed_ball b ε → dist (f (g z)) y ≤ c * f'symm.nnnorm * dist (f z) y, { assume z hz hgz, set v := f'symm (y - f z) with hv, calc dist (f (g z)) y = ∥f (z + v) - y∥ : by rw [dist_eq_norm] ... = ∥f (z + v) - f z - f' v + f' v - (y - f z)∥ : by { congr' 1, abel } ... = ∥f (z + v) - f z - f' ((z + v) - z)∥ : by simp only [continuous_linear_map.nonlinear_right_inverse.right_inv, add_sub_cancel', sub_add_cancel] ... ≤ c * ∥(z + v) - z∥ : hf _ (hε hgz) _ (hε hz) ... ≤ c * (f'symm.nnnorm * dist (f z) y) : begin apply mul_le_mul_of_nonneg_left _ (nnreal.coe_nonneg c), simpa [hv, dist_eq_norm'] using f'symm.bound (y - f z), end ... = c * f'symm.nnnorm * dist (f z) y : by ring }, -- Third bound: a complicated bound on `dist w b` (that will show up in the induction) is enough -- to check that `w` is in the ball on which one has controls. Will be used to check that `u n` -- belongs to this ball for all `n`. have C : ∀ (n : ℕ) (w : E), dist w b ≤ f'symm.nnnorm * (1 - (c * f'symm.nnnorm)^n) / (1 - c * f'symm.nnnorm) * dist (f b) y → w ∈ closed_ball b ε, { assume n w hw, apply hw.trans, rw [div_mul_eq_mul_div, div_le_iff], swap, { linarith }, calc (f'symm.nnnorm : ℝ) * (1 - (c * f'symm.nnnorm) ^ n) * dist (f b) y = f'symm.nnnorm * dist (f b) y * (1 - (c * f'symm.nnnorm) ^ n) : by ring ... ≤ f'symm.nnnorm * dist (f b) y * 1 : begin apply mul_le_mul_of_nonneg_left _ (mul_nonneg (nnreal.coe_nonneg _) dist_nonneg), rw [sub_le_self_iff], exact pow_nonneg (mul_nonneg (nnreal.coe_nonneg _) (nnreal.coe_nonneg _)) _, end ... ≤ f'symm.nnnorm * (((f'symm.nnnorm : ℝ)⁻¹ - c) * ε) : by { rw [mul_one], exact mul_le_mul_of_nonneg_left (mem_closed_ball'.1 hy) (nnreal.coe_nonneg _) } ... = ε * (1 - c * f'symm.nnnorm) : by { field_simp, ring } }, /- Main inductive control: `f (u n)` becomes exponentially close to `y`, and therefore `dist (u (n+1)) (u n)` becomes exponentally small, making it possible to get an inductive bound on `dist (u n) b`, from which one checks that `u n` remains in the ball on which we have estimates. -/ have D : ∀ (n : ℕ), dist (f (u n)) y ≤ (c * f'symm.nnnorm)^n * dist (f b) y ∧ dist (u n) b ≤ f'symm.nnnorm * (1 - (c * f'symm.nnnorm)^n) / (1 - c * f'symm.nnnorm) * dist (f b) y, { assume n, induction n with n IH, { simp [hu, le_refl] }, rw usucc, have Ign : dist (g (u n)) b ≤ f'symm.nnnorm * (1 - (c * f'symm.nnnorm)^n.succ) / (1 - c * f'symm.nnnorm) * dist (f b) y := calc dist (g (u n)) b ≤ dist (g (u n)) (u n) + dist (u n) b : dist_triangle _ _ _ ... ≤ f'symm.nnnorm * dist (f (u n)) y + dist (u n) b : add_le_add (A _) (le_refl _) ... ≤ f'symm.nnnorm * ((c * f'symm.nnnorm)^n * dist (f b) y) + f'symm.nnnorm * (1 - (c * f'symm.nnnorm)^n) / (1 - c * f'symm.nnnorm) * dist (f b) y : add_le_add (mul_le_mul_of_nonneg_left IH.1 (nnreal.coe_nonneg _)) IH.2 ... = f'symm.nnnorm * (1 - (c * f'symm.nnnorm)^n.succ) / (1 - c * f'symm.nnnorm) * dist (f b) y : by { field_simp [Jcf'], ring_exp }, refine ⟨_, Ign⟩, calc dist (f (g (u n))) y ≤ c * f'symm.nnnorm * dist (f (u n)) y : B _ (C n _ IH.2) (C n.succ _ Ign) ... ≤ (c * f'symm.nnnorm) * ((c * f'symm.nnnorm)^n * dist (f b) y) : mul_le_mul_of_nonneg_left IH.1 (mul_nonneg (nnreal.coe_nonneg _) (nnreal.coe_nonneg _)) ... = (c * f'symm.nnnorm) ^ n.succ * dist (f b) y : by ring_exp }, -- Deduce from the inductive bound that `uₙ` is a Cauchy sequence, therefore converging. have : cauchy_seq u, { have : ∀ (n : ℕ), dist (u n) (u (n+1)) ≤ f'symm.nnnorm * dist (f b) y * (c * f'symm.nnnorm)^n, { assume n, calc dist (u n) (u (n+1)) = dist (g (u n)) (u n) : by rw [usucc, dist_comm] ... ≤ f'symm.nnnorm * dist (f (u n)) y : A _ ... ≤ f'symm.nnnorm * ((c * f'symm.nnnorm)^n * dist (f b) y) : mul_le_mul_of_nonneg_left (D n).1 (nnreal.coe_nonneg _) ... = f'symm.nnnorm * dist (f b) y * (c * f'symm.nnnorm)^n : by ring }, exact cauchy_seq_of_le_geometric _ _ Icf' this }, obtain ⟨x, hx⟩ : ∃ x, tendsto u at_top (𝓝 x) := cauchy_seq_tendsto_of_complete this, -- As all the `uₙ` belong to the ball `closed_ball b ε`, so does their limit `x`. have xmem : x ∈ closed_ball b ε := is_closed_ball.mem_of_tendsto hx (eventually_of_forall (λ n, C n _ (D n).2)), refine ⟨x, xmem, _⟩, -- It remains to check that `f x = y`. This follows from continuity of `f` on `closed_ball b ε` -- and from the fact that `f uₙ` is converging to `y` by construction. have hx' : tendsto u at_top (𝓝[closed_ball b ε] x), { simp only [nhds_within, tendsto_inf, hx, true_and, ge_iff_le, tendsto_principal], exact eventually_of_forall (λ n, C n _ (D n).2) }, have T1 : tendsto (λ n, f (u n)) at_top (𝓝 (f x)) := (hf.continuous_on.mono hε x xmem).tendsto.comp hx', have T2 : tendsto (λ n, f (u n)) at_top (𝓝 y), { rw tendsto_iff_dist_tendsto_zero, refine squeeze_zero (λ n, dist_nonneg) (λ n, (D n).1) _, simpa using (tendsto_pow_at_top_nhds_0_of_lt_1 (mul_nonneg (nnreal.coe_nonneg _) (nnreal.coe_nonneg _)) Icf').mul tendsto_const_nhds }, exact tendsto_nhds_unique T1 T2, end lemma open_image (hf : approximates_linear_on f f' s c) (f'symm : f'.nonlinear_right_inverse) (hs : is_open s) (hc : subsingleton F ∨ c < f'symm.nnnorm⁻¹) : is_open (f '' s) := begin cases hc with hE hc, { resetI, apply is_open_discrete }, simp only [is_open_iff_mem_nhds, nhds_basis_closed_ball.mem_iff, ball_image_iff] at hs ⊢, intros x hx, rcases hs x hx with ⟨ε, ε0, hε⟩, refine ⟨(f'symm.nnnorm⁻¹ - c) * ε, mul_pos (sub_pos.2 hc) ε0, _⟩, exact (hf.surj_on_closed_ball_of_nonlinear_right_inverse f'symm (le_of_lt ε0) hε).mono hε (subset.refl _) end lemma image_mem_nhds (hf : approximates_linear_on f f' s c) (f'symm : f'.nonlinear_right_inverse) {x : E} (hs : s ∈ 𝓝 x) (hc : subsingleton F ∨ c < f'symm.nnnorm⁻¹) : f '' s ∈ 𝓝 (f x) := begin obtain ⟨t, hts, ht, xt⟩ : ∃ t ⊆ s, is_open t ∧ x ∈ t := _root_.mem_nhds_iff.1 hs, have := is_open.mem_nhds ((hf.mono_set hts).open_image f'symm ht hc) (mem_image_of_mem _ xt), exact mem_of_superset this (image_subset _ hts), end lemma map_nhds_eq (hf : approximates_linear_on f f' s c) (f'symm : f'.nonlinear_right_inverse) {x : E} (hs : s ∈ 𝓝 x) (hc : subsingleton F ∨ c < f'symm.nnnorm⁻¹) : map f (𝓝 x) = 𝓝 (f x) := begin refine le_antisymm ((hf.continuous_on x (mem_of_mem_nhds hs)).continuous_at hs) (le_map (λ t ht, _)), have : f '' (s ∩ t) ∈ 𝓝 (f x) := (hf.mono_set (inter_subset_left s t)).image_mem_nhds f'symm (inter_mem hs ht) hc, exact mem_of_superset this (image_subset _ (inter_subset_right _ _)), end end locally_onto /-! From now on we assume that `f` approximates an invertible continuous linear map `f : E ≃L[𝕜] F`. We also assume that either `E = {0}`, or `c < ∥f'⁻¹∥⁻¹`. We use `N` as an abbreviation for `∥f'⁻¹∥`. -/ variables {f' : E ≃L[𝕜] F} {s : set E} {c : ℝ≥0} local notation `N` := nnnorm (f'.symm : F →L[𝕜] E) protected lemma antilipschitz (hf : approximates_linear_on f (f' : E →L[𝕜] F) s c) (hc : subsingleton E ∨ c < N⁻¹) : antilipschitz_with (N⁻¹ - c)⁻¹ (s.restrict f) := begin cases hc with hE hc, { haveI : subsingleton s := ⟨λ x y, subtype.eq $ @subsingleton.elim _ hE _ _⟩, exact antilipschitz_with.of_subsingleton }, convert (f'.antilipschitz.restrict s).add_lipschitz_with hf.lipschitz_sub hc, simp [restrict] end protected lemma injective (hf : approximates_linear_on f (f' : E →L[𝕜] F) s c) (hc : subsingleton E ∨ c < N⁻¹) : injective (s.restrict f) := (hf.antilipschitz hc).injective protected lemma inj_on (hf : approximates_linear_on f (f' : E →L[𝕜] F) s c) (hc : subsingleton E ∨ c < N⁻¹) : inj_on f s := inj_on_iff_injective.2 $ hf.injective hc /-- A map approximating a linear equivalence on a set defines a local equivalence on this set. Should not be used outside of this file, because it is superseded by `to_local_homeomorph` below. This is a first step towards the inverse function. -/ def to_local_equiv (hf : approximates_linear_on f (f' : E →L[𝕜] F) s c) (hc : subsingleton E ∨ c < N⁻¹) : local_equiv E F := (hf.inj_on hc).to_local_equiv _ _ /-- The inverse function is continuous on `f '' s`. Use properties of `local_homeomorph` instead. -/ lemma inverse_continuous_on (hf : approximates_linear_on f (f' : E →L[𝕜] F) s c) (hc : subsingleton E ∨ c < N⁻¹) : continuous_on (hf.to_local_equiv hc).symm (f '' s) := begin apply continuous_on_iff_continuous_restrict.2, refine ((hf.antilipschitz hc).to_right_inv_on' _ (hf.to_local_equiv hc).right_inv').continuous, exact (λ x hx, (hf.to_local_equiv hc).map_target hx) end include cs section variables (f s) /-- Given a function `f` that approximates a linear equivalence on an open set `s`, returns a local homeomorph with `to_fun = f` and `source = s`. -/ def to_local_homeomorph (hf : approximates_linear_on f (f' : E →L[𝕜] F) s c) (hc : subsingleton E ∨ c < N⁻¹) (hs : is_open s) : local_homeomorph E F := { to_local_equiv := hf.to_local_equiv hc, open_source := hs, open_target := hf.open_image f'.to_nonlinear_right_inverse hs (by rwa f'.to_linear_equiv.to_equiv.subsingleton_congr at hc), continuous_to_fun := hf.continuous_on, continuous_inv_fun := hf.inverse_continuous_on hc } end @[simp] lemma to_local_homeomorph_coe (hf : approximates_linear_on f (f' : E →L[𝕜] F) s c) (hc : subsingleton E ∨ c < N⁻¹) (hs : is_open s) : (hf.to_local_homeomorph f s hc hs : E → F) = f := rfl @[simp] lemma to_local_homeomorph_source (hf : approximates_linear_on f (f' : E →L[𝕜] F) s c) (hc : subsingleton E ∨ c < N⁻¹) (hs : is_open s) : (hf.to_local_homeomorph f s hc hs).source = s := rfl @[simp] lemma to_local_homeomorph_target (hf : approximates_linear_on f (f' : E →L[𝕜] F) s c) (hc : subsingleton E ∨ c < N⁻¹) (hs : is_open s) : (hf.to_local_homeomorph f s hc hs).target = f '' s := rfl lemma closed_ball_subset_target (hf : approximates_linear_on f (f' : E →L[𝕜] F) s c) (hc : subsingleton E ∨ c < N⁻¹) (hs : is_open s) {b : E} (ε0 : 0 ≤ ε) (hε : closed_ball b ε ⊆ s) : closed_ball (f b) ((N⁻¹ - c) * ε) ⊆ (hf.to_local_homeomorph f s hc hs).target := (hf.surj_on_closed_ball_of_nonlinear_right_inverse f'.to_nonlinear_right_inverse ε0 hε).mono hε (subset.refl _) end approximates_linear_on /-! ### Inverse function theorem Now we prove the inverse function theorem. Let `f : E → F` be a map defined on a complete vector space `E`. Assume that `f` has an invertible derivative `f' : E ≃L[𝕜] F` at `a : E` in the strict sense. Then `f` approximates `f'` in the sense of `approximates_linear_on` on an open neighborhood of `a`, and we can apply `approximates_linear_on.to_local_homeomorph` to construct the inverse function. -/ namespace has_strict_fderiv_at /-- If `f` has derivative `f'` at `a` in the strict sense and `c > 0`, then `f` approximates `f'` with constant `c` on some neighborhood of `a`. -/ lemma approximates_deriv_on_nhds {f : E → F} {f' : E →L[𝕜] F} {a : E} (hf : has_strict_fderiv_at f f' a) {c : ℝ≥0} (hc : subsingleton E ∨ 0 < c) : ∃ s ∈ 𝓝 a, approximates_linear_on f f' s c := begin cases hc with hE hc, { refine ⟨univ, is_open.mem_nhds is_open_univ trivial, λ x hx y hy, _⟩, simp [@subsingleton.elim E hE x y] }, have := hf.def hc, rw [nhds_prod_eq, filter.eventually, mem_prod_same_iff] at this, rcases this with ⟨s, has, hs⟩, exact ⟨s, has, λ x hx y hy, hs (mk_mem_prod hx hy)⟩ end lemma map_nhds_eq_of_surj [complete_space E] [complete_space F] {f : E → F} {f' : E →L[𝕜] F} {a : E} (hf : has_strict_fderiv_at f (f' : E →L[𝕜] F) a) (h : f'.range = ⊤) : map f (𝓝 a) = 𝓝 (f a) := begin let f'symm := f'.nonlinear_right_inverse_of_surjective h, set c : ℝ≥0 := f'symm.nnnorm⁻¹ / 2 with hc, have f'symm_pos : 0 < f'symm.nnnorm := f'.nonlinear_right_inverse_of_surjective_nnnorm_pos h, have cpos : 0 < c, by simp [hc, nnreal.half_pos, nnreal.inv_pos, f'symm_pos], obtain ⟨s, s_nhds, hs⟩ : ∃ s ∈ 𝓝 a, approximates_linear_on f f' s c := hf.approximates_deriv_on_nhds (or.inr cpos), apply hs.map_nhds_eq f'symm s_nhds (or.inr (nnreal.half_lt_self _)), simp [ne_of_gt f'symm_pos], end variables [cs : complete_space E] {f : E → F} {f' : E ≃L[𝕜] F} {a : E} lemma approximates_deriv_on_open_nhds (hf : has_strict_fderiv_at f (f' : E →L[𝕜] F) a) : ∃ (s : set E) (hs : a ∈ s ∧ is_open s), approximates_linear_on f (f' : E →L[𝕜] F) s ((nnnorm (f'.symm : F →L[𝕜] E))⁻¹ / 2) := begin refine ((nhds_basis_opens a).exists_iff _).1 _, exact (λ s t, approximates_linear_on.mono_set), exact (hf.approximates_deriv_on_nhds $ f'.subsingleton_or_nnnorm_symm_pos.imp id $ λ hf', nnreal.half_pos $ nnreal.inv_pos.2 $ hf') end include cs variable (f) /-- Given a function with an invertible strict derivative at `a`, returns a `local_homeomorph` with `to_fun = f` and `a ∈ source`. This is a part of the inverse function theorem. The other part `has_strict_fderiv_at.to_local_inverse` states that the inverse function of this `local_homeomorph` has derivative `f'.symm`. -/ def to_local_homeomorph (hf : has_strict_fderiv_at f (f' : E →L[𝕜] F) a) : local_homeomorph E F := approximates_linear_on.to_local_homeomorph f (classical.some hf.approximates_deriv_on_open_nhds) (classical.some_spec hf.approximates_deriv_on_open_nhds).snd (f'.subsingleton_or_nnnorm_symm_pos.imp id $ λ hf', nnreal.half_lt_self $ ne_of_gt $ nnreal.inv_pos.2 $ hf') (classical.some_spec hf.approximates_deriv_on_open_nhds).fst.2 variable {f} @[simp] lemma to_local_homeomorph_coe (hf : has_strict_fderiv_at f (f' : E →L[𝕜] F) a) : (hf.to_local_homeomorph f : E → F) = f := rfl lemma mem_to_local_homeomorph_source (hf : has_strict_fderiv_at f (f' : E →L[𝕜] F) a) : a ∈ (hf.to_local_homeomorph f).source := (classical.some_spec hf.approximates_deriv_on_open_nhds).fst.1 lemma image_mem_to_local_homeomorph_target (hf : has_strict_fderiv_at f (f' : E →L[𝕜] F) a) : f a ∈ (hf.to_local_homeomorph f).target := (hf.to_local_homeomorph f).map_source hf.mem_to_local_homeomorph_source lemma map_nhds_eq_of_equiv (hf : has_strict_fderiv_at f (f' : E →L[𝕜] F) a) : map f (𝓝 a) = 𝓝 (f a) := (hf.to_local_homeomorph f).map_nhds_eq hf.mem_to_local_homeomorph_source variables (f f' a) /-- Given a function `f` with an invertible derivative, returns a function that is locally inverse to `f`. -/ def local_inverse (hf : has_strict_fderiv_at f (f' : E →L[𝕜] F) a) : F → E := (hf.to_local_homeomorph f).symm variables {f f' a} lemma local_inverse_def (hf : has_strict_fderiv_at f (f' : E →L[𝕜] F) a) : hf.local_inverse f _ _ = (hf.to_local_homeomorph f).symm := rfl lemma eventually_left_inverse (hf : has_strict_fderiv_at f (f' : E →L[𝕜] F) a) : ∀ᶠ x in 𝓝 a, hf.local_inverse f f' a (f x) = x := (hf.to_local_homeomorph f).eventually_left_inverse hf.mem_to_local_homeomorph_source @[simp] lemma eventually_right_inverse (hf : has_strict_fderiv_at f (f' : E →L[𝕜] F) a) : ∀ᶠ y in 𝓝 (f a), f (hf.local_inverse f f' a y) = y := (hf.to_local_homeomorph f).eventually_right_inverse' hf.mem_to_local_homeomorph_source lemma local_inverse_continuous_at (hf : has_strict_fderiv_at f (f' : E →L[𝕜] F) a) : continuous_at (hf.local_inverse f f' a) (f a) := (hf.to_local_homeomorph f).continuous_at_symm hf.image_mem_to_local_homeomorph_target lemma local_inverse_tendsto (hf : has_strict_fderiv_at f (f' : E →L[𝕜] F) a) : tendsto (hf.local_inverse f f' a) (𝓝 $ f a) (𝓝 a) := (hf.to_local_homeomorph f).tendsto_symm hf.mem_to_local_homeomorph_source lemma local_inverse_unique (hf : has_strict_fderiv_at f (f' : E →L[𝕜] F) a) {g : F → E} (hg : ∀ᶠ x in 𝓝 a, g (f x) = x) : ∀ᶠ y in 𝓝 (f a), g y = local_inverse f f' a hf y := eventually_eq_of_left_inv_of_right_inv hg hf.eventually_right_inverse $ (hf.to_local_homeomorph f).tendsto_symm hf.mem_to_local_homeomorph_source /-- If `f` has an invertible derivative `f'` at `a` in the sense of strict differentiability `(hf)`, then the inverse function `hf.local_inverse f` has derivative `f'.symm` at `f a`. -/ theorem to_local_inverse (hf : has_strict_fderiv_at f (f' : E →L[𝕜] F) a) : has_strict_fderiv_at (hf.local_inverse f f' a) (f'.symm : F →L[𝕜] E) (f a) := (hf.to_local_homeomorph f).has_strict_fderiv_at_symm hf.image_mem_to_local_homeomorph_target $ by simpa [← local_inverse_def] using hf /-- If `f : E → F` has an invertible derivative `f'` at `a` in the sense of strict differentiability and `g (f x) = x` in a neighborhood of `a`, then `g` has derivative `f'.symm` at `f a`. For a version assuming `f (g y) = y` and continuity of `g` at `f a` but not `[complete_space E]` see `of_local_left_inverse`. -/ theorem to_local_left_inverse (hf : has_strict_fderiv_at f (f' : E →L[𝕜] F) a) {g : F → E} (hg : ∀ᶠ x in 𝓝 a, g (f x) = x) : has_strict_fderiv_at g (f'.symm : F →L[𝕜] E) (f a) := hf.to_local_inverse.congr_of_eventually_eq $ (hf.local_inverse_unique hg).mono $ λ _, eq.symm end has_strict_fderiv_at /-- If a function has an invertible strict derivative at all points, then it is an open map. -/ lemma open_map_of_strict_fderiv_equiv [complete_space E] {f : E → F} {f' : E → E ≃L[𝕜] F} (hf : ∀ x, has_strict_fderiv_at f (f' x : E →L[𝕜] F) x) : is_open_map f := is_open_map_iff_nhds_le.2 $ λ x, (hf x).map_nhds_eq_of_equiv.ge /-! ### Inverse function theorem, 1D case In this case we prove a version of the inverse function theorem for maps `f : 𝕜 → 𝕜`. We use `continuous_linear_equiv.units_equiv_aut` to translate `has_strict_deriv_at f f' a` and `f' ≠ 0` into `has_strict_fderiv_at f (_ : 𝕜 ≃L[𝕜] 𝕜) a`. -/ namespace has_strict_deriv_at variables [cs : complete_space 𝕜] {f : 𝕜 → 𝕜} {f' a : 𝕜} (hf : has_strict_deriv_at f f' a) (hf' : f' ≠ 0) include cs variables (f f' a) /-- A function that is inverse to `f` near `a`. -/ @[reducible] def local_inverse : 𝕜 → 𝕜 := (hf.has_strict_fderiv_at_equiv hf').local_inverse _ _ _ variables {f f' a} lemma map_nhds_eq : map f (𝓝 a) = 𝓝 (f a) := (hf.has_strict_fderiv_at_equiv hf').map_nhds_eq_of_equiv theorem to_local_inverse : has_strict_deriv_at (hf.local_inverse f f' a hf') f'⁻¹ (f a) := (hf.has_strict_fderiv_at_equiv hf').to_local_inverse theorem to_local_left_inverse {g : 𝕜 → 𝕜} (hg : ∀ᶠ x in 𝓝 a, g (f x) = x) : has_strict_deriv_at g f'⁻¹ (f a) := (hf.has_strict_fderiv_at_equiv hf').to_local_left_inverse hg end has_strict_deriv_at /-- If a function has a non-zero strict derivative at all points, then it is an open map. -/ lemma open_map_of_strict_deriv [complete_space 𝕜] {f f' : 𝕜 → 𝕜} (hf : ∀ x, has_strict_deriv_at f (f' x) x) (h0 : ∀ x, f' x ≠ 0) : is_open_map f := is_open_map_iff_nhds_le.2 $ λ x, ((hf x).map_nhds_eq (h0 x)).ge /-! ### Inverse function theorem, smooth case -/ namespace times_cont_diff_at variables {𝕂 : Type*} [is_R_or_C 𝕂] variables {E' : Type*} [normed_group E'] [normed_space 𝕂 E'] variables {F' : Type*} [normed_group F'] [normed_space 𝕂 F'] variables [complete_space E'] (f : E' → F') {f' : E' ≃L[𝕂] F'} {a : E'} /-- Given a `times_cont_diff` function over `𝕂` (which is `ℝ` or `ℂ`) with an invertible derivative at `a`, returns a `local_homeomorph` with `to_fun = f` and `a ∈ source`. -/ def to_local_homeomorph {n : with_top ℕ} (hf : times_cont_diff_at 𝕂 n f a) (hf' : has_fderiv_at f (f' : E' →L[𝕂] F') a) (hn : 1 ≤ n) : local_homeomorph E' F' := (hf.has_strict_fderiv_at' hf' hn).to_local_homeomorph f variable {f} @[simp] lemma to_local_homeomorph_coe {n : with_top ℕ} (hf : times_cont_diff_at 𝕂 n f a) (hf' : has_fderiv_at f (f' : E' →L[𝕂] F') a) (hn : 1 ≤ n) : (hf.to_local_homeomorph f hf' hn : E' → F') = f := rfl lemma mem_to_local_homeomorph_source {n : with_top ℕ} (hf : times_cont_diff_at 𝕂 n f a) (hf' : has_fderiv_at f (f' : E' →L[𝕂] F') a) (hn : 1 ≤ n) : a ∈ (hf.to_local_homeomorph f hf' hn).source := (hf.has_strict_fderiv_at' hf' hn).mem_to_local_homeomorph_source lemma image_mem_to_local_homeomorph_target {n : with_top ℕ} (hf : times_cont_diff_at 𝕂 n f a) (hf' : has_fderiv_at f (f' : E' →L[𝕂] F') a) (hn : 1 ≤ n) : f a ∈ (hf.to_local_homeomorph f hf' hn).target := (hf.has_strict_fderiv_at' hf' hn).image_mem_to_local_homeomorph_target /-- Given a `times_cont_diff` function over `𝕂` (which is `ℝ` or `ℂ`) with an invertible derivative at `a`, returns a function that is locally inverse to `f`. -/ def local_inverse {n : with_top ℕ} (hf : times_cont_diff_at 𝕂 n f a) (hf' : has_fderiv_at f (f' : E' →L[𝕂] F') a) (hn : 1 ≤ n) : F' → E' := (hf.has_strict_fderiv_at' hf' hn).local_inverse f f' a lemma local_inverse_apply_image {n : with_top ℕ} (hf : times_cont_diff_at 𝕂 n f a) (hf' : has_fderiv_at f (f' : E' →L[𝕂] F') a) (hn : 1 ≤ n) : hf.local_inverse hf' hn (f a) = a := (hf.has_strict_fderiv_at' hf' hn).local_inverse_apply_image /-- Given a `times_cont_diff` function over `𝕂` (which is `ℝ` or `ℂ`) with an invertible derivative at `a`, the inverse function (produced by `times_cont_diff.to_local_homeomorph`) is also `times_cont_diff`. -/ lemma to_local_inverse {n : with_top ℕ} (hf : times_cont_diff_at 𝕂 n f a) (hf' : has_fderiv_at f (f' : E' →L[𝕂] F') a) (hn : 1 ≤ n) : times_cont_diff_at 𝕂 n (hf.local_inverse hf' hn) (f a) := begin have := hf.local_inverse_apply_image hf' hn, apply (hf.to_local_homeomorph f hf' hn).times_cont_diff_at_symm (image_mem_to_local_homeomorph_target hf hf' hn), { convert hf' }, { convert hf } end end times_cont_diff_at
--Examples of how to work with groups in Lean -- TODO -- order of element -- order of group -- some standard theorems about finite groups -- making a subgroup -- making a quotient group -- isomorphism theorems -- relevant files: import algebra.group.basic -- stuff like mul_self_iff_eq_one, mul_inv_eq_iff_eq_mul etc import algebra.group.hom -- unbundled group homs import data.equiv.basic import bundled_group_homs import group_theory.quotient_group import data.set.basic import slice_lattice /- e.g. class is_group_hom [group α] [group β] (f : α → β) : Prop := (map_mul : ∀ a b : α, f (a * b) = f a * f b) -/ import group_theory.perm.sign -- signature of a permutation import group_theory.subgroup -- subgroups /- /-- `s` is a subgroup: a set containing 1 and closed under multiplication and inverse. -/ class is_subgroup (s : set α) extends is_submonoid s : Prop := (inv_mem {a} : a ∈ s → a⁻¹ ∈ s) class normal_subgroup [group α] (s : set α) extends is_subgroup s : Prop := (normal : ∀ n ∈ s, ∀ g : α, g * n * g⁻¹ ∈ s) -/ import group_theory.quotient_group -- quotient groups import bundled_subgroup -- This gives us four functions subgroup.carrier, subgroup.one_mem, -- subgroup.mul_mem and subgroup.inv_mem. They each eat a term -- of type `subgroup <something>` and spit out the relevant set or proof. -- a variable G, plus proof it's a group. -- Subsets of a type are already bundled: they're called `set G`. -- There's a map from `subgroup G` to `set G` which just sends -- a subgroup `H` to its carrier set `H.carrier`; this is -- subgroup.carrier. Let's make Lean apply it by default whenever -- it's expecting a set and we give it a subgroup. import bundled_quotients namespace subgroup variables {G : Type*} [group G] -- Two subgroups with same underlying subset are the same subgroup. @[extensionality] def ext (H K : subgroup G) (h : (H : set G) = K) : H = K := by cases H; cases K; cases h; refl -- Do you know what a partial order is? You can look it up on Wikipedia. -- It's not hard to check that the set of subsets of a set is a partial order. -- Because `set G` is already well-established in mathlib, it is unsurprising to -- see that it has already been given the structure of a partial order. example : partial_order (set G) := by apply_instance -- that proof works because `partial_order` is like `group`, it's a typeclass, -- so we expect Lean to keep track of the proofs. This example just gets the proof -- that `set G` is a partial order from its big database of proofs. -- We would like a partial order on the sub*groups* of G, not just the subsets. -- So we have a map `subgroup G` -> `set G` and we would like to "pull back" the -- structure of a partial order on the target of that map, of partial order on the source. -- Can this be done? "pullback" in Lean is called `comap` -- the computer science name for it. -- Can you put a partial order on `subgroup G` by pulling it back from the one on `set G`? -- Or can you do it directly? You'll have to prove the axioms for a partial order. theorem carrier_injective : function.injective (subgroup.carrier : subgroup G → set G) := by ext instance : partial_order (subgroup G) := { le := λ H K, (H : set G) ⊆ K, le_refl := begin intro, simp, end, le_trans := λ _ _ _, set.subset.trans, le_antisymm := λ H K h1 h2, ext H K $ set.subset.antisymm h1 h2 } -- If you do it directly you'll have to define the inequality you want, which will look something like this: -- λ H K, H.carrier ⊆ K.carrier ; and then you'll have to prove all the theorems. If you pull it back you -- won't need to prove the theorems. theorem le {G : Type*} [group G] {H K : subgroup G} : H ≤ K ↔ ∀ x: G, x ∈ H → x ∈ K := iff.rfl open lattice -- so let's work up to lattices. "inf H K" is just H intersect K -- but we need to check it's a subgroup. example (X : Type) (A B : set X) : A ∩ B ⊆ A := set.inter_subset_left A B protected def inf (H K : subgroup G) : subgroup G := { carrier := H.carrier ∩ K.carrier, one_mem := begin -- unfold has_inter.inter, -- unfold set.inter, split, apply subgroup.one_mem, apply subgroup.one_mem, end, mul_mem := begin intros, split, apply subgroup.mul_mem, unfold has_inter.inter at a_1, unfold set.inter at a_1, cases a_1 with Hh Hk, assumption, cases a_2 with Hh Hk, assumption, apply subgroup.mul_mem, cases a_1 with Hh Hk, assumption, cases a_2 with Hh Hk, assumption, end, inv_mem := begin intros, cases a_1 with Hh Hk, split, apply subgroup.inv_mem, assumption, apply subgroup.inv_mem, assumption, end } -- notation for inf is ⊓ (\glb) and as you can see from the definition of "carrier" above (the carrier -- is the underlying set), it's just the intersection. `inf` stands for "infimum" and -- "glb" for "greatest lower bound", -- both rather pretentious names for the intersection. instance : has_inf (subgroup G) := ⟨subgroup.inf⟩ -- half way to a lattice is a semilattice_inf: there are some axioms you need to check though. instance subgroup.semilattice_inf : semilattice_inf (subgroup G) := { inf := (⊓), inf_le_left := begin intros, show a.carrier ∩ b.carrier ⊆ a.carrier, simp, --exact set.inter_subset_left _ _, --unfold lattice.has_inf.inf, --unfold subgroup.inf, end, inf_le_right := begin intros, show a.carrier ∩ b.carrier ⊆ b.carrier, simp, end, le_inf := begin intros a b c, intros hab hac, change a.carrier ⊆ b.carrier at hab, change a.carrier ⊆ c.carrier at hac, show a.carrier ⊆ b.carrier ∩ c.carrier, simp, split, assumption, assumption, end, ..subgroup.partial_order} def top : subgroup G := { carrier := set.univ, one_mem := set.mem_univ _, mul_mem := λ _ _ _ _, set.mem_univ _, inv_mem := λ _ _, set.mem_univ _ } instance subgroup.has_top : has_top (subgroup G) := ⟨top⟩ def bot : subgroup G := { carrier := {1}, one_mem := begin apply set.mem_singleton end, mul_mem := begin intros a b ha hb, rw set.mem_singleton_iff at ha hb ⊢, rw [ha, hb, mul_one], end, inv_mem := begin intros a ha, rw set.mem_singleton_iff at ha ⊢, rw ha, simp, end } instance subgroup.has_bot : has_bot (subgroup G) := ⟨bot⟩ -- Lean has quotients by normal subgroups. -- old style method example (G : Type*) [group G] (N : set G) [normal_subgroup N] := quotient_group.quotient N -- This is G/N. Lean guesses G from N. -- We want to make a term of type `equiv X Y` where X and Y are two collections of -- subgroups and the `equiv` is this -- strong kind of bijection -- a map from X to Y, and a map from Y to X, and two proofs, -- namely that the composite maps X->Y->X and Y->X->Y are the relevant identity maps. -- To do this we need to make the two sets. First the variables we're going to have: variables {N : subgroup G} (h : is_normal_subgroup N) -- Now notation for the quotient: local notation `Q` := quotient_group.quotient' h -- Now the first set (or "type", as Nicola Gambino would say). example := subgroup Q -- That's the subgroups of G/N. The other set is the subgroups of G which contain N. instance subtype.has_bot : has_bot {H : subgroup G // N ≤ H} := ⟨⟨N, le_refl N⟩⟩ def Inf (X : set (subgroup G)) : subgroup G := { carrier := Inf (set.image subgroup.carrier X), one_mem := begin unfold Inf, unfold has_Inf.Inf, unfold complete_lattice.Inf, intro t, intro ht, rcases ht with ⟨J, hJ, rfl⟩, exact J.one_mem, end, mul_mem := begin intros a b ha hb, -- unfolding to find out what goal meant now all deleted intros H hH, replace ha := ha H hH, replace hb := hb H hH, rcases hH with ⟨J, hJ, rfl⟩, exact J.mul_mem ha hb end, inv_mem := begin intros a ha H hH, replace ha := ha H hH, rcases hH with ⟨J, hJ, rfl⟩, exact J.inv_mem ha, end } instance subgroup.has_Inf : has_Inf (subgroup G) := ⟨Inf⟩ def sup (H K : subgroup G) : subgroup G := Inf {X | H ≤ X ∧ K ≤ X} instance : has_sup (subgroup G) := ⟨sup⟩ def Sup (X : set (subgroup G)) : subgroup G := Inf {K | ∀ H : X, H.val ≤ K} instance subgroup.has_Sup : has_Sup (subgroup G) := ⟨Sup⟩ instance subgroup.semilattice_sup : semilattice_sup (subgroup G) := { sup := sup, le_sup_left := begin intros a b, rw le, intros x hx xX xXh, rcases xXh with ⟨J, hJ, rfl⟩, cases hJ with aJ bJ, change a.carrier ⊆ J.carrier at aJ, change x ∈ a.carrier at hx, apply aJ, assumption, end, le_sup_right := begin intros, rw le, intros x hx xX xXh, rcases xXh with ⟨J, hJ, rfl⟩, cases hJ with aJ bJ, change b.carrier ⊆ J.carrier at bJ, change x ∈ b.carrier at hx, apply bJ, assumption, end, sup_le := begin intros a b c, rw le, intro hac, rw le, intro hbc, rw le, unfold lattice.has_sup.sup, unfold sup, intros x aorb, sorry end, ..subgroup.partial_order} instance subgroup.lattice : lattice (subgroup G) := { ..subgroup.semilattice_sup, ..subgroup.semilattice_inf} lemma le_top (H : subgroup G) : H ≤ ⊤ := begin rw le, intros x xh, unfold lattice.has_top.top, end instance subgroup.order_top : order_top (subgroup G) := {le_top := le_top, ..subgroup.partial_order, ..subgroup.has_top, } lemma bot_le (H : subgroup G) : ⊥ ≤ H := begin rw le, intros x xbot, unfold lattice.has_bot.bot at xbot, sorry end instance subgroup.order_bot : order_bot (subgroup G) := {bot_le := bot_le, ..subgroup.partial_order, ..subgroup.has_bot} instance subgroup.bounded_lattice : bounded_lattice (subgroup G) := {..subgroup.lattice, ..subgroup.order_top, ..subgroup.order_bot} instance subtype.has_Inf : has_Inf ({H : subgroup G // N ≤ H}) := ⟨ λ X, ⟨Inf (set.image subtype.val X), begin sorry end ⟩ ⟩ instance : complete_lattice (subgroup G) := { le_Sup := begin intros s a has, rw le, intros x hxa, unfold has_Sup.Sup, unfold Sup, intros t ht, rcases ht with ⟨J, hJ, rfl⟩, sorry end, Sup_le := begin intros s a b, unfold has_Sup.Sup, unfold Sup, intros j hJ, sorry end, Inf_le := begin intros, unfold has_Inf.Inf, sorry end, le_Inf := begin intros s a ha, unfold has_Inf.Inf, sorry end, ..subgroup.bounded_lattice, ..subgroup.has_Sup, ..subgroup.has_Inf} /- class complete_lattice (α : Type u) extends bounded_lattice α, has_Sup α, has_Inf α := (le_Sup : ∀s, ∀a∈s, a ≤ Sup s) (Sup_le : ∀s a, (∀b∈s, b ≤ a) → Sup s ≤ a) (Inf_le : ∀s, ∀a∈s, Inf s ≤ a) (le_Inf : ∀s a, (∀b∈s, a ≤ b) → a ≤ Inf s) -/ end subgroup variables {G : Type*} [group G] {H : Type*} [group H] namespace monoid_hom def map (f : G →* H) (K : subgroup G) : subgroup H := { carrier := f '' K, one_mem := begin use 1, split, apply subgroup.one_mem, apply monoid_hom.map_one, end, mul_mem := begin rintro j k ⟨j', hj', rfl⟩ ⟨k', hk', rfl⟩, rw [← monoid_hom.map_mul f j' k'], unfold set.image, dsimp, use j'*k', split, apply subgroup.mul_mem, assumption, assumption, refl, end, inv_mem := begin rintro j ⟨j', hj', rfl⟩, unfold set.image, dsimp, use j'⁻¹, split, apply subgroup.inv_mem, assumption, apply f.map_inv, end } def comap (f : G →* H) (K : subgroup H) : subgroup G := { carrier := f ⁻¹' K, one_mem := begin unfold set.preimage, dsimp, rw monoid_hom.map_one f, apply subgroup.one_mem, end, mul_mem := begin intros, unfold set.preimage, dsimp, rw monoid_hom.map_mul f, apply subgroup.mul_mem, assumption, assumption, end, inv_mem := begin intros, unfold set.preimage, dsimp, rw f.map_inv, apply subgroup.inv_mem, assumption, end } -- We haven't make the kernel of a bundled hom into a bundled subgroup! def ker (f : G →* H) : subgroup G := { carrier := {g : G | f g = 1}, one_mem := begin dsimp, apply monoid_hom.map_one, end, mul_mem := begin dsimp, intros, rw [monoid_hom.map_mul, a_1, a_2], simp, end, inv_mem := begin dsimp, intros, rw [f.map_inv, a_1], simp, end } def mem_ker (f : G →* H) (x : G) : x ∈ f.ker ↔ f x = 1 := iff.rfl theorem ker_normal (f : G →* H) : is_normal_subgroup (ker f) := begin constructor, -- see what you can do -- might not be logically necessary but it might also be good -- practice :-) intros n hn g, change n ∈ ker f at hn, rw mem_ker f n at hn, show g * n * g⁻¹ ∈ ker f, rw [mem_ker f (g * n * g⁻¹), mul_assoc g n g⁻¹, group_hom.map_mul f g (n * g⁻¹)], rw [group_hom.map_mul f n g⁻¹, hn, one_mul], rw [← group_hom.map_mul], simp, end theorem ker_mk' {G : Type*} [group G] {N : subgroup G} (h : is_normal_subgroup N) : ker (quotient_group.mk' h) = N := begin letI : normal_subgroup N.carrier := h, apply subgroup.ext, convert quotient_group.ker_mk N.carrier, ext, rw [monoid_hom.ker, is_group_hom.mem_ker], refl, end -- one lemma you'll need to prove that your map in the correspondence below is well-defined. lemma ker_sub_comap (f : G →* H) (X : subgroup H): f.ker ≤ f.comap X := begin intro g, intro h, have h2 : f g = 1, exact h, show f g ∈ X, rw h2, exact X.one_mem, end end monoid_hom -- OK here is the main theorem. First variables. variables {N : subgroup G} (hN : is_normal_subgroup N) -- notation Q for the quotient group G/N local notation `Q` := quotient_group.quotient' hN -- the kernel of the projection is N open monoid_hom open quotient_group -- hey this Wikipedia page is great: -- https://en.wikipedia.org/wiki/Correspondence_theorem_(group_theory) lemma mem_of_map_mem {K : subgroup G} (HK : N ≤ K) (x : G) (hx : ⇑(mk' hN) x ∈ (quotient_group.mk' hN).map K) : x ∈ K := begin cases hx with k hxk, cases hxk with kK hxkx, let f := (mk' hN), have hxkone : f (x*k⁻¹) = 1, calc f(x*k⁻¹) = f(x)*f(k⁻¹) : by apply f.map_mul ... = f(k)*f(k⁻¹) : by rw hxkx ... = f(k*k⁻¹) : by rw f.map_mul ... = f(1) : by rw mul_inv_self ... = 1 : f.map_one, rw ←mem_ker at hxkone, rw ker_mk' at hxkone, have hfh : x*k⁻¹ ∈ K, apply HK, assumption, convert K.mul_mem hfh kK, rw mul_assoc, rw inv_mul_self k, rw mul_one, end /-- Correspondence theorem for group theory -- first version -/ def correspondence : {H : subgroup G // N ≤ H} ≃ (subgroup Q) := { to_fun := λ HN, (quotient_group.mk' hN).map HN.1, inv_fun := λ K, ⟨(quotient_group.mk' hN).comap K, begin rw subgroup.le, intro g, intro hg, show (quotient_group.mk' hN) g ∈ K, rw ←(ker_mk' hN) at hg, rw mem_ker at hg, rw hg, exact K.one_mem, end⟩, left_inv := begin rintro ⟨K, HK⟩, dsimp, apply subtype.ext.2, dsimp, rw subgroup.ext_iff, intro x, split, intro hx, change (quotient_group.mk' hN) x ∈ (map (mk' hN)) K at hx, apply mem_of_map_mem hN, assumption, assumption, -- f is (mk' hN) -- f(x) ∈ F(K) => ∃ k ∈ K st. f(x) = f(k) -- K is a subgroup => k⁻¹ exists ∈ K -- K.inv_mem kK -- f(x) = f(k) => f(x)f(k⁻¹) = f(k)f(k⁻¹) => f(xk⁻¹) = f(1) = 1 change, group_hom.map_mul, -- So xk⁻¹ ∈ ker f ⊆ K -- But K is closed under multiplication and xk⁻¹ * k = x, so x ∈ K. intro hx, show (quotient_group.mk' hN) x ∈ (map (mk' hN)) K, exact set.mem_image_of_mem (λ (a : G), ⇑(mk' hN) a) hx, end, right_inv := begin intro K, dsimp, rw subgroup.ext_iff, intro x, split, intro hx, cases hx with k hxk, cases hxk with kK hxkx, change (quotient_group.mk' hN) k ∈ K at kK, rw hxkx at kK, assumption, intro hx, have hxk := mk'.surjective hN x, cases hxk with g hxkx, use g, split, show (quotient_group.mk' hN) g ∈ K, rwa hxkx, assumption, --cases -- x ∈ K => ∃ j ∈ F⁻¹(K) st. f(j)=x (surjectivity) -- So f(j) ∈ F(F⁻¹(K)) => x ∈ F(F⁻¹(K)) end } -- That theorem above (I know it says definition, that's because the functions are data) is a first -- version of the correspondence theorem. It says that there's a bijection of sets: -- subgroups of G containing N <-> subgroups of Q=G/N -- The next thing to do is to check that the correspondence respects ⊓, but I haven't quite decided -- the best way to formalise that... -- H (containing N) is a normal subgroup of G iff H/N is a normal subgroup of G/N theorem normal_iff_normal (hN : is_normal_subgroup N) (H : subgroup G) (hH : N ≤ H) : is_normal_subgroup H ↔ is_normal_subgroup (correspondence hN ⟨H, hH⟩) := begin split, intro nsH, rw is_normal_subgroup_def at nsH ⊢, intros, --have NnormH : ∀ n : G, n ∈ N → ∀ h : G, h ∈ H → h * n * h⁻¹ ∈ N, -- exact normal_is_subgroup hN hH, --have hHNG : quotient' NnormH ≤ quotient' hN, error : failed to synthesize type class instance for have j := mk'.surjective hN g, cases j with t ht, have k := mk'.surjective hN n, cases k with l hl, have linH : l ∈ H, apply mem_of_map_mem hN hH, rw hl, apply a, have : t * l * t⁻¹ ∈ H, apply nsH, assumption, rw [←ht, ←hl], rw [←group_hom.map_mul, ←group_hom.map_inv, ←group_hom.map_mul], use t * l * t⁻¹, split, assumption, refl, -- hN : N is a normal subgroup of G, hsH : H is a normal subgroup of G -- Then H/N is a subgroup of G/N : hHNG -- So gN*hN*g⁻¹N=ghg⁻¹N : by the group rule for quoitients -- ghg⁻¹N ∈ H/N : nsH -- note H/N = ⇑(correspondence hN) ⟨H, hH⟩ intro nscH, rw is_normal_subgroup_def at nscH ⊢, intros, have that : ⇑(mk' hN) n ∈ (correspondence hN) ⟨H, hH⟩, use n, split, assumption, refl, have := nscH (mk' hN n) that (mk' hN g), rw [←group_hom.map_mul, ←group_hom.map_inv, ←group_hom.map_mul] at this, apply mem_of_map_mem hN hH, assumption, end lemma mem_mem_inf (H₁ H₂ : subgroup G) (t : G): t ∈ H₁ ⊓ H₂ → t ∈ H₁ := begin intro tH, change t ∈ H₁.carrier, cases tH, assumption, end lemma mem_inf_mem (H₁ H₂ : subgroup G) (t : G): t ∈ H₁ ⊓ H₂ → t ∈ H₂ := begin intro tH, change t ∈ H₂.carrier, cases tH, assumption, end theorem correspondence.le_iff (hN : is_normal_subgroup N) (H₁ H₂ : subgroup G) (h1 : N ≤ H₁) (h2 : N ≤ H₂) : correspondence hN ⟨H₁, h1⟩ ⊓ correspondence hN ⟨H₂, h2⟩ = correspondence hN ⟨H₁ ⊓ H₂, lattice.le_inf h1 h2⟩ := begin rw subgroup.ext_iff, intros, have j := mk'.surjective hN x, cases j with t ht, rw ←ht, have : N ≤ H₁ ⊓ H₂, change N.carrier ⊆ H₁.carrier ∩ H₂.carrier, simp, split, assumption, assumption, split, intro xh, cases xh with xh1 xh2, use t, split, apply mem_of_map_mem hN this, use t, split, split, apply mem_of_map_mem hN h1, assumption, apply mem_of_map_mem hN h2, assumption, refl, refl, intro xh, have htt : t ∈ H₁ ⊓ H₂, apply mem_of_map_mem hN this, apply xh, split, have htt1 : t ∈ H₁, apply mem_mem_inf H₁ H₂, assumption, use t, split, assumption, refl, have htt1 : t ∈ H₂, apply mem_inf_mem H₁ H₂, assumption, use t, split, assumption, refl, end theorem correspondence.inf_iff (hN : is_normal_subgroup N) (H₁ H₂ : subgroup G) (h1 : N ≤ H₁) (h2 : N ≤ H₂) : correspondence hN ⟨H₁, h1⟩ ≤ correspondence hN ⟨H₂, h2⟩ ↔ H₁ ≤ H₂ := begin split, intro hh, rw subgroup.le at hh ⊢, intros x xh, have that : ⇑(mk' hN) x ∈ (correspondence hN) ⟨H₁, h1⟩, use x, split, assumption, refl, have := hh (mk' hN x) that, apply mem_of_map_mem hN h2, assumption, intro hh, rw subgroup.le at hh ⊢, intros x xh, have j := mk'.surjective hN x, cases j with t ht, rw ←ht at xh, have xhh : t ∈ H₁, apply mem_of_map_mem hN h1, assumption, have := hh t xhh, rw ←ht, use t, split, assumption, refl, end theorem correspondence.top (hN : is_normal_subgroup N) : correspondence hN ⟨⊤, λ _ _, set.mem_univ _⟩ = ⊤ := begin rw subgroup.ext_iff, intro, have hT : N ≤ ⊤, apply subgroup.le_top, have j := mk'.surjective hN x, cases j with t ht, rw ← ht, split, intro hx, apply mem_of_map_mem hN hT t, apply hx, intro hx, use t, split, assumption, refl, end --int.coe_nat_inj' : ∀ {m n : ℕ}, ↑m = ↑n ↔ m = n
Formal statement is: lemma fmeasurableD2: "A \<in> fmeasurable M \<Longrightarrow> emeasure M A \<noteq> top" Informal statement is: If $A$ is $f$-measurable, then $A$ has finite measure.
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Algebra.Semigroup.Base where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Foundations.Equiv.HalfAdjoint open import Cubical.Foundations.HLevels open import Cubical.Foundations.Isomorphism open import Cubical.Foundations.Univalence open import Cubical.Foundations.Transport open import Cubical.Foundations.SIP open import Cubical.Data.Sigma open import Cubical.Reflection.StrictEquiv open import Cubical.Structures.Axioms open import Cubical.Structures.Auto open import Cubical.Structures.Record open Iso private variable ℓ : Level -- Semigroups as a record, inspired by the Agda standard library: -- -- https://github.com/agda/agda-stdlib/blob/master/src/Algebra/Bundles.agda#L48 -- https://github.com/agda/agda-stdlib/blob/master/src/Algebra/Structures.agda#L50 -- -- Note that as we are using Path for all equations the IsMagma record -- would only contain isSet A if we had it. record IsSemigroup {A : Type ℓ} (_·_ : A → A → A) : Type ℓ where constructor issemigroup field is-set : isSet A assoc : (x y z : A) → x · (y · z) ≡ (x · y) · z record SemigroupStr (A : Type ℓ) : Type (ℓ-suc ℓ) where constructor semigroupstr field _·_ : A → A → A isSemigroup : IsSemigroup _·_ infixl 7 _·_ open IsSemigroup isSemigroup public Semigroup : Type (ℓ-suc ℓ) Semigroup = TypeWithStr _ SemigroupStr semigroup : (A : Type ℓ) (_·_ : A → A → A) (h : IsSemigroup _·_) → Semigroup semigroup A _·_ h = A , semigroupstr _·_ h record SemigroupEquiv (M N : Semigroup {ℓ}) (e : ⟨ M ⟩ ≃ ⟨ N ⟩) : Type ℓ where constructor semigroupequiv -- Shorter qualified names private module M = SemigroupStr (snd M) module N = SemigroupStr (snd N) field isHom : (x y : ⟨ M ⟩) → equivFun e (x M.· y) ≡ equivFun e x N.· equivFun e y open SemigroupStr open IsSemigroup open SemigroupEquiv -- Develop some theory about Semigroups using various general results -- that are stated using Σ-types. For this we define Semigroup as a -- nested Σ-type, prove that it's equivalent to the above record -- definition and then transport results along this equivalence. module SemigroupΣTheory {ℓ} where RawSemigroupStructure : Type ℓ → Type ℓ RawSemigroupStructure X = X → X → X RawSemigroupEquivStr = AutoEquivStr RawSemigroupStructure rawSemigroupUnivalentStr : UnivalentStr _ RawSemigroupEquivStr rawSemigroupUnivalentStr = autoUnivalentStr RawSemigroupStructure SemigroupAxioms : (A : Type ℓ) → RawSemigroupStructure A → Type ℓ SemigroupAxioms A _·_ = isSet A × ((x y z : A) → x · (y · z) ≡ (x · y) · z) SemigroupStructure : Type ℓ → Type ℓ SemigroupStructure = AxiomsStructure RawSemigroupStructure SemigroupAxioms SemigroupΣ : Type (ℓ-suc ℓ) SemigroupΣ = TypeWithStr ℓ SemigroupStructure isPropSemigroupAxioms : (A : Type ℓ) (_·_ : RawSemigroupStructure A) → isProp (SemigroupAxioms A _·_) isPropSemigroupAxioms _ _ = isPropΣ isPropIsSet λ isSetA → isPropΠ3 λ _ _ _ → isSetA _ _ SemigroupEquivStr : StrEquiv SemigroupStructure ℓ SemigroupEquivStr = AxiomsEquivStr RawSemigroupEquivStr SemigroupAxioms SemigroupAxiomsIsoIsSemigroup : {A : Type ℓ} (_·_ : RawSemigroupStructure A) → Iso (SemigroupAxioms A _·_) (IsSemigroup _·_) fun (SemigroupAxiomsIsoIsSemigroup s) (x , y) = issemigroup x y inv (SemigroupAxiomsIsoIsSemigroup s) M = is-set M , assoc M rightInv (SemigroupAxiomsIsoIsSemigroup s) _ = refl leftInv (SemigroupAxiomsIsoIsSemigroup s) _ = refl SemigroupAxioms≡IsSemigroup : {A : Type ℓ} (_·_ : RawSemigroupStructure A) → SemigroupAxioms _ _·_ ≡ IsSemigroup _·_ SemigroupAxioms≡IsSemigroup s = isoToPath (SemigroupAxiomsIsoIsSemigroup s) Semigroup→SemigroupΣ : Semigroup → SemigroupΣ Semigroup→SemigroupΣ (A , semigroupstr _·_ isSemigroup) = A , _·_ , SemigroupAxiomsIsoIsSemigroup _ .inv isSemigroup SemigroupΣ→Semigroup : SemigroupΣ → Semigroup SemigroupΣ→Semigroup (A , _·_ , isSemigroupΣ) = semigroup A _·_ (SemigroupAxiomsIsoIsSemigroup _ .fun isSemigroupΣ) SemigroupIsoSemigroupΣ : Iso Semigroup SemigroupΣ SemigroupIsoSemigroupΣ = iso Semigroup→SemigroupΣ SemigroupΣ→Semigroup (λ _ → refl) (λ _ → refl) semigroupUnivalentStr : UnivalentStr SemigroupStructure SemigroupEquivStr semigroupUnivalentStr = axiomsUnivalentStr _ isPropSemigroupAxioms rawSemigroupUnivalentStr SemigroupΣPath : (M N : SemigroupΣ) → (M ≃[ SemigroupEquivStr ] N) ≃ (M ≡ N) SemigroupΣPath = SIP semigroupUnivalentStr SemigroupEquivΣ : (M N : Semigroup) → Type ℓ SemigroupEquivΣ M N = Semigroup→SemigroupΣ M ≃[ SemigroupEquivStr ] Semigroup→SemigroupΣ N SemigroupIsoΣPath : {M N : Semigroup} → Iso (Σ[ e ∈ ⟨ M ⟩ ≃ ⟨ N ⟩ ] SemigroupEquiv M N e) (SemigroupEquivΣ M N) fun SemigroupIsoΣPath (e , x) = e , isHom x inv SemigroupIsoΣPath (e , h) = e , semigroupequiv h rightInv SemigroupIsoΣPath _ = refl leftInv SemigroupIsoΣPath _ = refl SemigroupPath : (M N : Semigroup) → (Σ[ e ∈ ⟨ M ⟩ ≃ ⟨ N ⟩ ] SemigroupEquiv M N e) ≃ (M ≡ N) SemigroupPath M N = Σ[ e ∈ ⟨ M ⟩ ≃ ⟨ N ⟩ ] SemigroupEquiv M N e ≃⟨ strictIsoToEquiv SemigroupIsoΣPath ⟩ SemigroupEquivΣ M N ≃⟨ SemigroupΣPath _ _ ⟩ Semigroup→SemigroupΣ M ≡ Semigroup→SemigroupΣ N ≃⟨ isoToEquiv (invIso (congIso SemigroupIsoSemigroupΣ)) ⟩ M ≡ N ■ -- We now extract the important results from the above module isPropIsSemigroup : {A : Type ℓ} (_·_ : A → A → A) → isProp (IsSemigroup _·_) isPropIsSemigroup _·_ = subst isProp (SemigroupΣTheory.SemigroupAxioms≡IsSemigroup _·_) (SemigroupΣTheory.isPropSemigroupAxioms _ _·_) SemigroupPath : (M N : Semigroup {ℓ}) → (Σ[ e ∈ ⟨ M ⟩ ≃ ⟨ N ⟩ ] SemigroupEquiv M N e) ≃ (M ≡ N) SemigroupPath {ℓ = ℓ} = SIP (autoUnivalentRecord (autoRecordSpec (SemigroupStr {ℓ}) SemigroupEquiv (fields: data[ _·_ ∣ isHom ] prop[ isSemigroup ∣ (λ _ → isPropIsSemigroup _) ])) _ _)
[GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A c1 c2 : NumDenSameDeg 𝒜 x hdeg : c1.deg = c2.deg hnum : ↑c1.num = ↑c2.num hden : ↑c1.den = ↑c2.den ⊢ c1 = c2 [PROOFSTEP] rcases c1 with ⟨i1, ⟨n1, hn1⟩, ⟨d1, hd1⟩, h1⟩ [GOAL] case mk.mk.mk ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A c2 : NumDenSameDeg 𝒜 x i1 : ι n1 : A hn1 : n1 ∈ 𝒜 i1 d1 : A hd1 : d1 ∈ 𝒜 i1 h1 : ↑{ val := d1, property := hd1 } ∈ x hdeg : { deg := i1, num := { val := n1, property := hn1 }, den := { val := d1, property := hd1 }, den_mem := h1 }.deg = c2.deg hnum : ↑{ deg := i1, num := { val := n1, property := hn1 }, den := { val := d1, property := hd1 }, den_mem := h1 }.num = ↑c2.num hden : ↑{ deg := i1, num := { val := n1, property := hn1 }, den := { val := d1, property := hd1 }, den_mem := h1 }.den = ↑c2.den ⊢ { deg := i1, num := { val := n1, property := hn1 }, den := { val := d1, property := hd1 }, den_mem := h1 } = c2 [PROOFSTEP] rcases c2 with ⟨i2, ⟨n2, hn2⟩, ⟨d2, hd2⟩, h2⟩ [GOAL] case mk.mk.mk.mk.mk.mk ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A i1 : ι n1 : A hn1 : n1 ∈ 𝒜 i1 d1 : A hd1 : d1 ∈ 𝒜 i1 h1 : ↑{ val := d1, property := hd1 } ∈ x i2 : ι n2 : A hn2 : n2 ∈ 𝒜 i2 d2 : A hd2 : d2 ∈ 𝒜 i2 h2 : ↑{ val := d2, property := hd2 } ∈ x hdeg : { deg := i1, num := { val := n1, property := hn1 }, den := { val := d1, property := hd1 }, den_mem := h1 }.deg = { deg := i2, num := { val := n2, property := hn2 }, den := { val := d2, property := hd2 }, den_mem := h2 }.deg hnum : ↑{ deg := i1, num := { val := n1, property := hn1 }, den := { val := d1, property := hd1 }, den_mem := h1 }.num = ↑{ deg := i2, num := { val := n2, property := hn2 }, den := { val := d2, property := hd2 }, den_mem := h2 }.num hden : ↑{ deg := i1, num := { val := n1, property := hn1 }, den := { val := d1, property := hd1 }, den_mem := h1 }.den = ↑{ deg := i2, num := { val := n2, property := hn2 }, den := { val := d2, property := hd2 }, den_mem := h2 }.den ⊢ { deg := i1, num := { val := n1, property := hn1 }, den := { val := d1, property := hd1 }, den_mem := h1 } = { deg := i2, num := { val := n2, property := hn2 }, den := { val := d2, property := hd2 }, den_mem := h2 } [PROOFSTEP] dsimp only [Subtype.coe_mk] at * [GOAL] case mk.mk.mk.mk.mk.mk ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A i1 : ι n1 : A hn1 : n1 ∈ 𝒜 i1 d1 : A hd1 : d1 ∈ 𝒜 i1 h1 : ↑{ val := d1, property := hd1 } ∈ x i2 : ι n2 : A hn2 : n2 ∈ 𝒜 i2 d2 : A hd2 : d2 ∈ 𝒜 i2 h2 : ↑{ val := d2, property := hd2 } ∈ x hdeg : i1 = i2 hnum : n1 = n2 hden : d1 = d2 ⊢ { deg := i1, num := { val := n1, property := hn1 }, den := { val := d1, property := hd1 }, den_mem := h1 } = { deg := i2, num := { val := n2, property := hn2 }, den := { val := d2, property := hd2 }, den_mem := h2 } [PROOFSTEP] subst hdeg hnum hden [GOAL] case mk.mk.mk.mk.mk.mk ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A i1 : ι n1 : A hn1 : n1 ∈ 𝒜 i1 d1 : A hd1 : d1 ∈ 𝒜 i1 h1 : ↑{ val := d1, property := hd1 } ∈ x hn2 : n1 ∈ 𝒜 i1 hd2 : d1 ∈ 𝒜 i1 h2 : ↑{ val := d1, property := hd2 } ∈ x ⊢ { deg := i1, num := { val := n1, property := hn1 }, den := { val := d1, property := hd1 }, den_mem := h1 } = { deg := i1, num := { val := n1, property := hn2 }, den := { val := d1, property := hd2 }, den_mem := h2 } [PROOFSTEP] congr [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A c : NumDenSameDeg 𝒜 x n : ℕ ⊢ ↑(GradedMonoid.GMonoid.gnpow n c.den) ∈ x [PROOFSTEP] induction' n with n ih [GOAL] case zero ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A c : NumDenSameDeg 𝒜 x ⊢ ↑(GradedMonoid.GMonoid.gnpow Nat.zero c.den) ∈ x [PROOFSTEP] simpa only [Nat.zero_eq, coe_gnpow, pow_zero] using Submonoid.one_mem _ [GOAL] case succ ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A c : NumDenSameDeg 𝒜 x n : ℕ ih : ↑(GradedMonoid.GMonoid.gnpow n c.den) ∈ x ⊢ ↑(GradedMonoid.GMonoid.gnpow (Nat.succ n) c.den) ∈ x [PROOFSTEP] simpa only [pow_succ', coe_gnpow] using x.mul_mem ih c.den_mem [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A z : HomogeneousLocalization 𝒜 x n : ℕ c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } ⊢ Setoid.r ((fun x_1 => x_1 ^ n) c1) ((fun x_1 => x_1 ^ n) c2) [PROOFSTEP] change Localization.mk _ _ = Localization.mk _ _ [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A z : HomogeneousLocalization 𝒜 x n : ℕ c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } ⊢ Localization.mk ↑((fun x_1 => x_1 ^ n) c1).num { val := ↑((fun x_1 => x_1 ^ n) c1).den, property := (_ : ↑((fun x_1 => x_1 ^ n) c1).den ∈ x) } = Localization.mk ↑((fun x_1 => x_1 ^ n) c2).num { val := ↑((fun x_1 => x_1 ^ n) c2).den, property := (_ : ↑((fun x_1 => x_1 ^ n) c2).den ∈ x) } [PROOFSTEP] simp only [num_pow, den_pow] [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A z : HomogeneousLocalization 𝒜 x n : ℕ c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } ⊢ Localization.mk (↑c1.num ^ n) { val := ↑c1.den ^ n, property := (_ : (fun x_1 => x_1 ∈ x) (↑c1.den ^ n)) } = Localization.mk (↑c2.num ^ n) { val := ↑c2.den ^ n, property := (_ : (fun x_1 => x_1 ∈ x) (↑c2.den ^ n)) } [PROOFSTEP] convert congr_arg (fun z : at x => z ^ n) h [GOAL] case h.e'_2 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A z : HomogeneousLocalization 𝒜 x n : ℕ c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } ⊢ Localization.mk (↑c1.num ^ n) { val := ↑c1.den ^ n, property := (_ : (fun x_1 => x_1 ∈ x) (↑c1.den ^ n)) } = Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } ^ n [PROOFSTEP] erw [Localization.mk_pow] [GOAL] case h.e'_3 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A z : HomogeneousLocalization 𝒜 x n : ℕ c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } ⊢ Localization.mk (↑c2.num ^ n) { val := ↑c2.den ^ n, property := (_ : (fun x_1 => x_1 ∈ x) (↑c2.den ^ n)) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } ^ n [PROOFSTEP] erw [Localization.mk_pow] [GOAL] case h.e'_2 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A z : HomogeneousLocalization 𝒜 x n : ℕ c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } ⊢ Localization.mk (↑c1.num ^ n) { val := ↑c1.den ^ n, property := (_ : (fun x_1 => x_1 ∈ x) (↑c1.den ^ n)) } = Localization.mk (↑c1.num ^ n) ({ val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } ^ n) [PROOFSTEP] rfl [GOAL] case h.e'_3 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A z : HomogeneousLocalization 𝒜 x n : ℕ c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } ⊢ Localization.mk (↑c2.num ^ n) { val := ↑c2.den ^ n, property := (_ : (fun x_1 => x_1 ∈ x) (↑c2.den ^ n)) } = Localization.mk (↑c2.num ^ n) ({ val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } ^ n) [PROOFSTEP] rfl [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁹ : AddCommMonoid ι inst✝⁸ : DecidableEq ι inst✝⁷ : CommRing R inst✝⁶ : CommRing A inst✝⁵ : Algebra R A 𝒜 : ι → Submodule R A inst✝⁴ : GradedAlgebra 𝒜 x : Submonoid A α : Type u_4 inst✝³ : SMul α R inst✝² : SMul α A inst✝¹ : IsScalarTower α R A inst✝ : IsScalarTower α A A m : α c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } ⊢ Setoid.r ((fun x_1 => m • x_1) c1) ((fun x_1 => m • x_1) c2) [PROOFSTEP] change Localization.mk _ _ = Localization.mk _ _ [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁹ : AddCommMonoid ι inst✝⁸ : DecidableEq ι inst✝⁷ : CommRing R inst✝⁶ : CommRing A inst✝⁵ : Algebra R A 𝒜 : ι → Submodule R A inst✝⁴ : GradedAlgebra 𝒜 x : Submonoid A α : Type u_4 inst✝³ : SMul α R inst✝² : SMul α A inst✝¹ : IsScalarTower α R A inst✝ : IsScalarTower α A A m : α c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } ⊢ Localization.mk ↑((fun x_1 => m • x_1) c1).num { val := ↑((fun x_1 => m • x_1) c1).den, property := (_ : ↑((fun x_1 => m • x_1) c1).den ∈ x) } = Localization.mk ↑((fun x_1 => m • x_1) c2).num { val := ↑((fun x_1 => m • x_1) c2).den, property := (_ : ↑((fun x_1 => m • x_1) c2).den ∈ x) } [PROOFSTEP] simp only [num_smul, den_smul] [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁹ : AddCommMonoid ι inst✝⁸ : DecidableEq ι inst✝⁷ : CommRing R inst✝⁶ : CommRing A inst✝⁵ : Algebra R A 𝒜 : ι → Submodule R A inst✝⁴ : GradedAlgebra 𝒜 x : Submonoid A α : Type u_4 inst✝³ : SMul α R inst✝² : SMul α A inst✝¹ : IsScalarTower α R A inst✝ : IsScalarTower α A A m : α c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } ⊢ Localization.mk ↑(m • c1.num) { val := ↑c1.den, property := (_ : (fun x_1 => x_1 ∈ x) ↑c1.den) } = Localization.mk ↑(m • c2.num) { val := ↑c2.den, property := (_ : (fun x_1 => x_1 ∈ x) ↑c2.den) } [PROOFSTEP] convert congr_arg (fun z : at x => m • z) h [GOAL] case h.e'_2 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁹ : AddCommMonoid ι inst✝⁸ : DecidableEq ι inst✝⁷ : CommRing R inst✝⁶ : CommRing A inst✝⁵ : Algebra R A 𝒜 : ι → Submodule R A inst✝⁴ : GradedAlgebra 𝒜 x : Submonoid A α : Type u_4 inst✝³ : SMul α R inst✝² : SMul α A inst✝¹ : IsScalarTower α R A inst✝ : IsScalarTower α A A m : α c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } ⊢ Localization.mk ↑(m • c1.num) { val := ↑c1.den, property := (_ : (fun x_1 => x_1 ∈ x) ↑c1.den) } = m • Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } [PROOFSTEP] rw [Localization.smul_mk] [GOAL] case h.e'_3 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁹ : AddCommMonoid ι inst✝⁸ : DecidableEq ι inst✝⁷ : CommRing R inst✝⁶ : CommRing A inst✝⁵ : Algebra R A 𝒜 : ι → Submodule R A inst✝⁴ : GradedAlgebra 𝒜 x : Submonoid A α : Type u_4 inst✝³ : SMul α R inst✝² : SMul α A inst✝¹ : IsScalarTower α R A inst✝ : IsScalarTower α A A m : α c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } ⊢ Localization.mk ↑(m • c2.num) { val := ↑c2.den, property := (_ : (fun x_1 => x_1 ∈ x) ↑c2.den) } = m • Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } [PROOFSTEP] rw [Localization.smul_mk] [GOAL] case h.e'_2 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁹ : AddCommMonoid ι inst✝⁸ : DecidableEq ι inst✝⁷ : CommRing R inst✝⁶ : CommRing A inst✝⁵ : Algebra R A 𝒜 : ι → Submodule R A inst✝⁴ : GradedAlgebra 𝒜 x : Submonoid A α : Type u_4 inst✝³ : SMul α R inst✝² : SMul α A inst✝¹ : IsScalarTower α R A inst✝ : IsScalarTower α A A m : α c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } ⊢ Localization.mk ↑(m • c1.num) { val := ↑c1.den, property := (_ : (fun x_1 => x_1 ∈ x) ↑c1.den) } = Localization.mk (m • ↑c1.num) { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } [PROOFSTEP] rfl [GOAL] case h.e'_3 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁹ : AddCommMonoid ι inst✝⁸ : DecidableEq ι inst✝⁷ : CommRing R inst✝⁶ : CommRing A inst✝⁵ : Algebra R A 𝒜 : ι → Submodule R A inst✝⁴ : GradedAlgebra 𝒜 x : Submonoid A α : Type u_4 inst✝³ : SMul α R inst✝² : SMul α A inst✝¹ : IsScalarTower α R A inst✝ : IsScalarTower α A A m : α c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } ⊢ Localization.mk ↑(m • c2.num) { val := ↑c2.den, property := (_ : (fun x_1 => x_1 ∈ x) ↑c2.den) } = Localization.mk (m • ↑c2.num) { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } [PROOFSTEP] rfl [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁹ : AddCommMonoid ι inst✝⁸ : DecidableEq ι inst✝⁷ : CommRing R inst✝⁶ : CommRing A inst✝⁵ : Algebra R A 𝒜 : ι → Submodule R A inst✝⁴ : GradedAlgebra 𝒜 x : Submonoid A α : Type u_4 inst✝³ : SMul α R inst✝² : SMul α A inst✝¹ : IsScalarTower α R A inst✝ : IsScalarTower α A A y : HomogeneousLocalization 𝒜 x n : α ⊢ val (n • y) = n • val y [PROOFSTEP] induction y using Quotient.inductionOn [GOAL] case h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁹ : AddCommMonoid ι inst✝⁸ : DecidableEq ι inst✝⁷ : CommRing R inst✝⁶ : CommRing A inst✝⁵ : Algebra R A 𝒜 : ι → Submodule R A inst✝⁴ : GradedAlgebra 𝒜 x : Submonoid A α : Type u_4 inst✝³ : SMul α R inst✝² : SMul α A inst✝¹ : IsScalarTower α R A inst✝ : IsScalarTower α A A n : α a✝ : NumDenSameDeg 𝒜 x ⊢ val (n • Quotient.mk (Setoid.ker (embedding 𝒜 x)) a✝) = n • val (Quotient.mk (Setoid.ker (embedding 𝒜 x)) a✝) [PROOFSTEP] change Localization.mk _ _ = n • Localization.mk _ _ [GOAL] case h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁹ : AddCommMonoid ι inst✝⁸ : DecidableEq ι inst✝⁷ : CommRing R inst✝⁶ : CommRing A inst✝⁵ : Algebra R A 𝒜 : ι → Submodule R A inst✝⁴ : GradedAlgebra 𝒜 x : Submonoid A α : Type u_4 inst✝³ : SMul α R inst✝² : SMul α A inst✝¹ : IsScalarTower α R A inst✝ : IsScalarTower α A A n : α a✝ : NumDenSameDeg 𝒜 x ⊢ Localization.mk ↑((fun x_1 => n • x_1) a✝).num { val := ↑((fun x_1 => n • x_1) a✝).den, property := (_ : ↑((fun x_1 => n • x_1) a✝).den ∈ x) } = n • Localization.mk ↑a✝.num { val := ↑a✝.den, property := (_ : ↑a✝.den ∈ x) } [PROOFSTEP] dsimp only [GOAL] case h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁹ : AddCommMonoid ι inst✝⁸ : DecidableEq ι inst✝⁷ : CommRing R inst✝⁶ : CommRing A inst✝⁵ : Algebra R A 𝒜 : ι → Submodule R A inst✝⁴ : GradedAlgebra 𝒜 x : Submonoid A α : Type u_4 inst✝³ : SMul α R inst✝² : SMul α A inst✝¹ : IsScalarTower α R A inst✝ : IsScalarTower α A A n : α a✝ : NumDenSameDeg 𝒜 x ⊢ Localization.mk ↑(n • a✝).num { val := ↑(n • a✝).den, property := (_ : ↑(n • a✝).den ∈ x) } = n • Localization.mk ↑a✝.num { val := ↑a✝.den, property := (_ : ↑a✝.den ∈ x) } [PROOFSTEP] rw [Localization.smul_mk] [GOAL] case h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁹ : AddCommMonoid ι inst✝⁸ : DecidableEq ι inst✝⁷ : CommRing R inst✝⁶ : CommRing A inst✝⁵ : Algebra R A 𝒜 : ι → Submodule R A inst✝⁴ : GradedAlgebra 𝒜 x : Submonoid A α : Type u_4 inst✝³ : SMul α R inst✝² : SMul α A inst✝¹ : IsScalarTower α R A inst✝ : IsScalarTower α A A n : α a✝ : NumDenSameDeg 𝒜 x ⊢ Localization.mk ↑(n • a✝).num { val := ↑(n • a✝).den, property := (_ : ↑(n • a✝).den ∈ x) } = Localization.mk (n • ↑a✝.num) { val := ↑a✝.den, property := (_ : ↑a✝.den ∈ x) } [PROOFSTEP] congr 1 [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } ⊢ Setoid.r (-c1) (-c2) [PROOFSTEP] change Localization.mk _ _ = Localization.mk _ _ [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } ⊢ Localization.mk ↑(-c1).num { val := ↑(-c1).den, property := (_ : ↑(-c1).den ∈ x) } = Localization.mk ↑(-c2).num { val := ↑(-c2).den, property := (_ : ↑(-c2).den ∈ x) } [PROOFSTEP] simp only [num_neg, den_neg, ← Localization.neg_mk] [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } ⊢ -Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : (fun x_1 => x_1 ∈ x) ↑c1.den) } = -Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : (fun x_1 => x_1 ∈ x) ↑c2.den) } [PROOFSTEP] exact congr_arg Neg.neg h [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } c3 c4 : NumDenSameDeg 𝒜 x h' : Localization.mk ↑c3.num { val := ↑c3.den, property := (_ : ↑c3.den ∈ x) } = Localization.mk ↑c4.num { val := ↑c4.den, property := (_ : ↑c4.den ∈ x) } ⊢ Setoid.r ((fun x_1 x_2 => x_1 + x_2) c1 c3) ((fun x_1 x_2 => x_1 + x_2) c2 c4) [PROOFSTEP] change Localization.mk _ _ = Localization.mk _ _ [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } c3 c4 : NumDenSameDeg 𝒜 x h' : Localization.mk ↑c3.num { val := ↑c3.den, property := (_ : ↑c3.den ∈ x) } = Localization.mk ↑c4.num { val := ↑c4.den, property := (_ : ↑c4.den ∈ x) } ⊢ Localization.mk ↑((fun x_1 x_2 => x_1 + x_2) c1 c3).num { val := ↑((fun x_1 x_2 => x_1 + x_2) c1 c3).den, property := (_ : ↑((fun x_1 x_2 => x_1 + x_2) c1 c3).den ∈ x) } = Localization.mk ↑((fun x_1 x_2 => x_1 + x_2) c2 c4).num { val := ↑((fun x_1 x_2 => x_1 + x_2) c2 c4).den, property := (_ : ↑((fun x_1 x_2 => x_1 + x_2) c2 c4).den ∈ x) } [PROOFSTEP] simp only [num_add, den_add, ← Localization.add_mk] [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } c3 c4 : NumDenSameDeg 𝒜 x h' : Localization.mk ↑c3.num { val := ↑c3.den, property := (_ : ↑c3.den ∈ x) } = Localization.mk ↑c4.num { val := ↑c4.den, property := (_ : ↑c4.den ∈ x) } ⊢ Localization.mk (↑c1.den * ↑c3.num + ↑c3.den * ↑c1.num) { val := ↑c1.den * ↑c3.den, property := (_ : (fun x_1 => x_1 ∈ x) (↑c1.den * ↑c3.den)) } = Localization.mk (↑c2.den * ↑c4.num + ↑c4.den * ↑c2.num) { val := ↑c2.den * ↑c4.den, property := (_ : (fun x_1 => x_1 ∈ x) (↑c2.den * ↑c4.den)) } [PROOFSTEP] convert congr_arg₂ (· + ·) h h' [GOAL] case h.e'_2 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } c3 c4 : NumDenSameDeg 𝒜 x h' : Localization.mk ↑c3.num { val := ↑c3.den, property := (_ : ↑c3.den ∈ x) } = Localization.mk ↑c4.num { val := ↑c4.den, property := (_ : ↑c4.den ∈ x) } ⊢ Localization.mk (↑c1.den * ↑c3.num + ↑c3.den * ↑c1.num) { val := ↑c1.den * ↑c3.den, property := (_ : (fun x_1 => x_1 ∈ x) (↑c1.den * ↑c3.den)) } = Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } + Localization.mk ↑c3.num { val := ↑c3.den, property := (_ : ↑c3.den ∈ x) } [PROOFSTEP] erw [Localization.add_mk] [GOAL] case h.e'_3 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } c3 c4 : NumDenSameDeg 𝒜 x h' : Localization.mk ↑c3.num { val := ↑c3.den, property := (_ : ↑c3.den ∈ x) } = Localization.mk ↑c4.num { val := ↑c4.den, property := (_ : ↑c4.den ∈ x) } ⊢ Localization.mk (↑c2.den * ↑c4.num + ↑c4.den * ↑c2.num) { val := ↑c2.den * ↑c4.den, property := (_ : (fun x_1 => x_1 ∈ x) (↑c2.den * ↑c4.den)) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } + Localization.mk ↑c4.num { val := ↑c4.den, property := (_ : ↑c4.den ∈ x) } [PROOFSTEP] erw [Localization.add_mk] [GOAL] case h.e'_2 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } c3 c4 : NumDenSameDeg 𝒜 x h' : Localization.mk ↑c3.num { val := ↑c3.den, property := (_ : ↑c3.den ∈ x) } = Localization.mk ↑c4.num { val := ↑c4.den, property := (_ : ↑c4.den ∈ x) } ⊢ Localization.mk (↑c1.den * ↑c3.num + ↑c3.den * ↑c1.num) { val := ↑c1.den * ↑c3.den, property := (_ : (fun x_1 => x_1 ∈ x) (↑c1.den * ↑c3.den)) } = Localization.mk (↑{ val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } * ↑c3.num + ↑{ val := ↑c3.den, property := (_ : ↑c3.den ∈ x) } * ↑c1.num) ({ val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } * { val := ↑c3.den, property := (_ : ↑c3.den ∈ x) }) [PROOFSTEP] rfl [GOAL] case h.e'_3 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } c3 c4 : NumDenSameDeg 𝒜 x h' : Localization.mk ↑c3.num { val := ↑c3.den, property := (_ : ↑c3.den ∈ x) } = Localization.mk ↑c4.num { val := ↑c4.den, property := (_ : ↑c4.den ∈ x) } ⊢ Localization.mk (↑c2.den * ↑c4.num + ↑c4.den * ↑c2.num) { val := ↑c2.den * ↑c4.den, property := (_ : (fun x_1 => x_1 ∈ x) (↑c2.den * ↑c4.den)) } = Localization.mk (↑{ val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } * ↑c4.num + ↑{ val := ↑c4.den, property := (_ : ↑c4.den ∈ x) } * ↑c2.num) ({ val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } * { val := ↑c4.den, property := (_ : ↑c4.den ∈ x) }) [PROOFSTEP] rfl [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } c3 c4 : NumDenSameDeg 𝒜 x h' : Localization.mk ↑c3.num { val := ↑c3.den, property := (_ : ↑c3.den ∈ x) } = Localization.mk ↑c4.num { val := ↑c4.den, property := (_ : ↑c4.den ∈ x) } ⊢ Setoid.r ((fun x_1 x_2 => x_1 * x_2) c1 c3) ((fun x_1 x_2 => x_1 * x_2) c2 c4) [PROOFSTEP] change Localization.mk _ _ = Localization.mk _ _ [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } c3 c4 : NumDenSameDeg 𝒜 x h' : Localization.mk ↑c3.num { val := ↑c3.den, property := (_ : ↑c3.den ∈ x) } = Localization.mk ↑c4.num { val := ↑c4.den, property := (_ : ↑c4.den ∈ x) } ⊢ Localization.mk ↑((fun x_1 x_2 => x_1 * x_2) c1 c3).num { val := ↑((fun x_1 x_2 => x_1 * x_2) c1 c3).den, property := (_ : ↑((fun x_1 x_2 => x_1 * x_2) c1 c3).den ∈ x) } = Localization.mk ↑((fun x_1 x_2 => x_1 * x_2) c2 c4).num { val := ↑((fun x_1 x_2 => x_1 * x_2) c2 c4).den, property := (_ : ↑((fun x_1 x_2 => x_1 * x_2) c2 c4).den ∈ x) } [PROOFSTEP] simp only [num_mul, den_mul] [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } c3 c4 : NumDenSameDeg 𝒜 x h' : Localization.mk ↑c3.num { val := ↑c3.den, property := (_ : ↑c3.den ∈ x) } = Localization.mk ↑c4.num { val := ↑c4.den, property := (_ : ↑c4.den ∈ x) } ⊢ Localization.mk (↑c1.num * ↑c3.num) { val := ↑c1.den * ↑c3.den, property := (_ : (fun x_1 => x_1 ∈ x) (↑c1.den * ↑c3.den)) } = Localization.mk (↑c2.num * ↑c4.num) { val := ↑c2.den * ↑c4.den, property := (_ : (fun x_1 => x_1 ∈ x) (↑c2.den * ↑c4.den)) } [PROOFSTEP] convert congr_arg₂ (· * ·) h h' [GOAL] case h.e'_2 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } c3 c4 : NumDenSameDeg 𝒜 x h' : Localization.mk ↑c3.num { val := ↑c3.den, property := (_ : ↑c3.den ∈ x) } = Localization.mk ↑c4.num { val := ↑c4.den, property := (_ : ↑c4.den ∈ x) } ⊢ Localization.mk (↑c1.num * ↑c3.num) { val := ↑c1.den * ↑c3.den, property := (_ : (fun x_1 => x_1 ∈ x) (↑c1.den * ↑c3.den)) } = Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } * Localization.mk ↑c3.num { val := ↑c3.den, property := (_ : ↑c3.den ∈ x) } [PROOFSTEP] erw [Localization.mk_mul] [GOAL] case h.e'_3 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } c3 c4 : NumDenSameDeg 𝒜 x h' : Localization.mk ↑c3.num { val := ↑c3.den, property := (_ : ↑c3.den ∈ x) } = Localization.mk ↑c4.num { val := ↑c4.den, property := (_ : ↑c4.den ∈ x) } ⊢ Localization.mk (↑c2.num * ↑c4.num) { val := ↑c2.den * ↑c4.den, property := (_ : (fun x_1 => x_1 ∈ x) (↑c2.den * ↑c4.den)) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } * Localization.mk ↑c4.num { val := ↑c4.den, property := (_ : ↑c4.den ∈ x) } [PROOFSTEP] erw [Localization.mk_mul] [GOAL] case h.e'_2 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } c3 c4 : NumDenSameDeg 𝒜 x h' : Localization.mk ↑c3.num { val := ↑c3.den, property := (_ : ↑c3.den ∈ x) } = Localization.mk ↑c4.num { val := ↑c4.den, property := (_ : ↑c4.den ∈ x) } ⊢ Localization.mk (↑c1.num * ↑c3.num) { val := ↑c1.den * ↑c3.den, property := (_ : (fun x_1 => x_1 ∈ x) (↑c1.den * ↑c3.den)) } = Localization.mk (↑c1.num * ↑c3.num) ({ val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } * { val := ↑c3.den, property := (_ : ↑c3.den ∈ x) }) [PROOFSTEP] rfl [GOAL] case h.e'_3 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A c1 c2 : NumDenSameDeg 𝒜 x h : Localization.mk ↑c1.num { val := ↑c1.den, property := (_ : ↑c1.den ∈ x) } = Localization.mk ↑c2.num { val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } c3 c4 : NumDenSameDeg 𝒜 x h' : Localization.mk ↑c3.num { val := ↑c3.den, property := (_ : ↑c3.den ∈ x) } = Localization.mk ↑c4.num { val := ↑c4.den, property := (_ : ↑c4.den ∈ x) } ⊢ Localization.mk (↑c2.num * ↑c4.num) { val := ↑c2.den * ↑c4.den, property := (_ : (fun x_1 => x_1 ∈ x) (↑c2.den * ↑c4.den)) } = Localization.mk (↑c2.num * ↑c4.num) ({ val := ↑c2.den, property := (_ : ↑c2.den ∈ x) } * { val := ↑c4.den, property := (_ : ↑c4.den ∈ x) }) [PROOFSTEP] rfl [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A y1 y2 : HomogeneousLocalization 𝒜 x ⊢ val (y1 + y2) = val y1 + val y2 [PROOFSTEP] induction y1 using Quotient.inductionOn [GOAL] case h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A y2 : HomogeneousLocalization 𝒜 x a✝ : NumDenSameDeg 𝒜 x ⊢ val (Quotient.mk (Setoid.ker (embedding 𝒜 x)) a✝ + y2) = val (Quotient.mk (Setoid.ker (embedding 𝒜 x)) a✝) + val y2 [PROOFSTEP] induction y2 using Quotient.inductionOn [GOAL] case h.h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A a✝¹ a✝ : NumDenSameDeg 𝒜 x ⊢ val (Quotient.mk (Setoid.ker (embedding 𝒜 x)) a✝¹ + Quotient.mk (Setoid.ker (embedding 𝒜 x)) a✝) = val (Quotient.mk (Setoid.ker (embedding 𝒜 x)) a✝¹) + val (Quotient.mk (Setoid.ker (embedding 𝒜 x)) a✝) [PROOFSTEP] change Localization.mk _ _ = Localization.mk _ _ + Localization.mk _ _ [GOAL] case h.h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A a✝¹ a✝ : NumDenSameDeg 𝒜 x ⊢ Localization.mk ↑((fun x_1 x_2 => x_1 + x_2) a✝¹ a✝).num { val := ↑((fun x_1 x_2 => x_1 + x_2) a✝¹ a✝).den, property := (_ : ↑((fun x_1 x_2 => x_1 + x_2) a✝¹ a✝).den ∈ x) } = Localization.mk ↑a✝¹.num { val := ↑a✝¹.den, property := (_ : ↑a✝¹.den ∈ x) } + Localization.mk ↑a✝.num { val := ↑a✝.den, property := (_ : ↑a✝.den ∈ x) } [PROOFSTEP] dsimp only [GOAL] case h.h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A a✝¹ a✝ : NumDenSameDeg 𝒜 x ⊢ Localization.mk ↑(a✝¹ + a✝).num { val := ↑(a✝¹ + a✝).den, property := (_ : ↑(a✝¹ + a✝).den ∈ x) } = Localization.mk ↑a✝¹.num { val := ↑a✝¹.den, property := (_ : ↑a✝¹.den ∈ x) } + Localization.mk ↑a✝.num { val := ↑a✝.den, property := (_ : ↑a✝.den ∈ x) } [PROOFSTEP] rw [Localization.add_mk] [GOAL] case h.h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A a✝¹ a✝ : NumDenSameDeg 𝒜 x ⊢ Localization.mk ↑(a✝¹ + a✝).num { val := ↑(a✝¹ + a✝).den, property := (_ : ↑(a✝¹ + a✝).den ∈ x) } = Localization.mk (↑{ val := ↑a✝¹.den, property := (_ : ↑a✝¹.den ∈ x) } * ↑a✝.num + ↑{ val := ↑a✝.den, property := (_ : ↑a✝.den ∈ x) } * ↑a✝¹.num) ({ val := ↑a✝¹.den, property := (_ : ↑a✝¹.den ∈ x) } * { val := ↑a✝.den, property := (_ : ↑a✝.den ∈ x) }) [PROOFSTEP] rfl [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A y1 y2 : HomogeneousLocalization 𝒜 x ⊢ val (y1 * y2) = val y1 * val y2 [PROOFSTEP] induction y1 using Quotient.inductionOn [GOAL] case h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A y2 : HomogeneousLocalization 𝒜 x a✝ : NumDenSameDeg 𝒜 x ⊢ val (Quotient.mk (Setoid.ker (embedding 𝒜 x)) a✝ * y2) = val (Quotient.mk (Setoid.ker (embedding 𝒜 x)) a✝) * val y2 [PROOFSTEP] induction y2 using Quotient.inductionOn [GOAL] case h.h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A a✝¹ a✝ : NumDenSameDeg 𝒜 x ⊢ val (Quotient.mk (Setoid.ker (embedding 𝒜 x)) a✝¹ * Quotient.mk (Setoid.ker (embedding 𝒜 x)) a✝) = val (Quotient.mk (Setoid.ker (embedding 𝒜 x)) a✝¹) * val (Quotient.mk (Setoid.ker (embedding 𝒜 x)) a✝) [PROOFSTEP] change Localization.mk _ _ = Localization.mk _ _ * Localization.mk _ _ [GOAL] case h.h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A a✝¹ a✝ : NumDenSameDeg 𝒜 x ⊢ Localization.mk ↑((fun x_1 x_2 => x_1 * x_2) a✝¹ a✝).num { val := ↑((fun x_1 x_2 => x_1 * x_2) a✝¹ a✝).den, property := (_ : ↑((fun x_1 x_2 => x_1 * x_2) a✝¹ a✝).den ∈ x) } = Localization.mk ↑a✝¹.num { val := ↑a✝¹.den, property := (_ : ↑a✝¹.den ∈ x) } * Localization.mk ↑a✝.num { val := ↑a✝.den, property := (_ : ↑a✝.den ∈ x) } [PROOFSTEP] dsimp only [GOAL] case h.h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A a✝¹ a✝ : NumDenSameDeg 𝒜 x ⊢ Localization.mk ↑(a✝¹ * a✝).num { val := ↑(a✝¹ * a✝).den, property := (_ : ↑(a✝¹ * a✝).den ∈ x) } = Localization.mk ↑a✝¹.num { val := ↑a✝¹.den, property := (_ : ↑a✝¹.den ∈ x) } * Localization.mk ↑a✝.num { val := ↑a✝.den, property := (_ : ↑a✝.den ∈ x) } [PROOFSTEP] rw [Localization.mk_mul] [GOAL] case h.h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A a✝¹ a✝ : NumDenSameDeg 𝒜 x ⊢ Localization.mk ↑(a✝¹ * a✝).num { val := ↑(a✝¹ * a✝).den, property := (_ : ↑(a✝¹ * a✝).den ∈ x) } = Localization.mk (↑a✝¹.num * ↑a✝.num) ({ val := ↑a✝¹.den, property := (_ : ↑a✝¹.den ∈ x) } * { val := ↑a✝.den, property := (_ : ↑a✝.den ∈ x) }) [PROOFSTEP] rfl [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A y : HomogeneousLocalization 𝒜 x ⊢ val (-y) = -val y [PROOFSTEP] induction y using Quotient.inductionOn [GOAL] case h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A a✝ : NumDenSameDeg 𝒜 x ⊢ val (-Quotient.mk (Setoid.ker (embedding 𝒜 x)) a✝) = -val (Quotient.mk (Setoid.ker (embedding 𝒜 x)) a✝) [PROOFSTEP] change Localization.mk _ _ = -Localization.mk _ _ [GOAL] case h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A a✝ : NumDenSameDeg 𝒜 x ⊢ Localization.mk ↑(-a✝).num { val := ↑(-a✝).den, property := (_ : ↑(-a✝).den ∈ x) } = -Localization.mk ↑a✝.num { val := ↑a✝.den, property := (_ : ↑a✝.den ∈ x) } [PROOFSTEP] dsimp only [GOAL] case h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A a✝ : NumDenSameDeg 𝒜 x ⊢ Localization.mk ↑(-a✝).num { val := ↑(-a✝).den, property := (_ : ↑(-a✝).den ∈ x) } = -Localization.mk ↑a✝.num { val := ↑a✝.den, property := (_ : ↑a✝.den ∈ x) } [PROOFSTEP] rw [Localization.neg_mk] [GOAL] case h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A a✝ : NumDenSameDeg 𝒜 x ⊢ Localization.mk ↑(-a✝).num { val := ↑(-a✝).den, property := (_ : ↑(-a✝).den ∈ x) } = Localization.mk (-↑a✝.num) { val := ↑a✝.den, property := (_ : ↑a✝.den ∈ x) } [PROOFSTEP] rfl [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A y1 y2 : HomogeneousLocalization 𝒜 x ⊢ val (y1 - y2) = val y1 - val y2 [PROOFSTEP] rw [show y1 - y2 = y1 + -y2 from rfl, add_val, neg_val] [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A y1 y2 : HomogeneousLocalization 𝒜 x ⊢ val y1 + -val y2 = val y1 - val y2 [PROOFSTEP] rfl [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A y : HomogeneousLocalization 𝒜 x n : ℕ ⊢ val (y ^ n) = val y ^ n [PROOFSTEP] induction y using Quotient.inductionOn [GOAL] case h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A n : ℕ a✝ : NumDenSameDeg 𝒜 x ⊢ val (Quotient.mk (Setoid.ker (embedding 𝒜 x)) a✝ ^ n) = val (Quotient.mk (Setoid.ker (embedding 𝒜 x)) a✝) ^ n [PROOFSTEP] change Localization.mk _ _ = Localization.mk _ _ ^ n [GOAL] case h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A n : ℕ a✝ : NumDenSameDeg 𝒜 x ⊢ Localization.mk ↑((fun x_1 => x_1 ^ n) a✝).num { val := ↑((fun x_1 => x_1 ^ n) a✝).den, property := (_ : ↑((fun x_1 => x_1 ^ n) a✝).den ∈ x) } = Localization.mk ↑a✝.num { val := ↑a✝.den, property := (_ : ↑a✝.den ∈ x) } ^ n [PROOFSTEP] rw [Localization.mk_pow] [GOAL] case h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A n : ℕ a✝ : NumDenSameDeg 𝒜 x ⊢ Localization.mk ↑((fun x_1 => x_1 ^ n) a✝).num { val := ↑((fun x_1 => x_1 ^ n) a✝).den, property := (_ : ↑((fun x_1 => x_1 ^ n) a✝).den ∈ x) } = Localization.mk (↑a✝.num ^ n) ({ val := ↑a✝.den, property := (_ : ↑a✝.den ∈ x) } ^ n) [PROOFSTEP] dsimp only [GOAL] case h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A n : ℕ a✝ : NumDenSameDeg 𝒜 x ⊢ Localization.mk ↑(a✝ ^ n).num { val := ↑(a✝ ^ n).den, property := (_ : ↑(a✝ ^ n).den ∈ x) } = Localization.mk (↑a✝.num ^ n) ({ val := ↑a✝.den, property := (_ : ↑a✝.den ∈ x) } ^ n) [PROOFSTEP] congr 1 [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A n : ℕ ⊢ val (Nat.unaryCast n) = ↑n [PROOFSTEP] induction n [GOAL] case zero ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A ⊢ val (Nat.unaryCast Nat.zero) = ↑Nat.zero [PROOFSTEP] simp [Nat.unaryCast, zero_val, one_val, *] [GOAL] case succ ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A n✝ : ℕ n_ih✝ : val (Nat.unaryCast n✝) = ↑n✝ ⊢ val (Nat.unaryCast (Nat.succ n✝)) = ↑(Nat.succ n✝) [PROOFSTEP] simp [Nat.unaryCast, zero_val, one_val, *] [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A n : ℤ ⊢ val (Int.castDef n) = ↑n [PROOFSTEP] cases n [GOAL] case ofNat ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A a✝ : ℕ ⊢ val (Int.castDef (Int.ofNat a✝)) = ↑(Int.ofNat a✝) [PROOFSTEP] simp [Int.castDef, zero_val, one_val, *] [GOAL] case negSucc ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A a✝ : ℕ ⊢ val (Int.castDef (Int.negSucc a✝)) = ↑(Int.negSucc a✝) [PROOFSTEP] simp [Int.castDef, zero_val, one_val, *] [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A f : HomogeneousLocalization 𝒜 x ⊢ val f = Localization.mk (num f) { val := den f, property := (_ : den f ∈ x) } [PROOFSTEP] have := Quotient.out_eq' f [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A f : HomogeneousLocalization 𝒜 x this : Quotient.mk'' (Quotient.out' f) = f ⊢ val f = Localization.mk (num f) { val := den f, property := (_ : den f ∈ x) } [PROOFSTEP] apply_fun HomogeneousLocalization.val at this [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A f : HomogeneousLocalization 𝒜 x this : val (Quotient.mk'' (Quotient.out' f)) = val f ⊢ val f = Localization.mk (num f) { val := den f, property := (_ : den f ∈ x) } [PROOFSTEP] rw [← this] [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A f : HomogeneousLocalization 𝒜 x this : val (Quotient.mk'' (Quotient.out' f)) = val f ⊢ val (Quotient.mk'' (Quotient.out' f)) = Localization.mk (num f) { val := den f, property := (_ : den f ∈ x) } [PROOFSTEP] rfl [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A f g : HomogeneousLocalization 𝒜 x h : val f = val g ⊢ f = g [PROOFSTEP] induction f using Quotient.inductionOn' [GOAL] case h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A g : HomogeneousLocalization 𝒜 x a✝ : NumDenSameDeg 𝒜 x h : val (Quotient.mk'' a✝) = val g ⊢ Quotient.mk'' a✝ = g [PROOFSTEP] induction g using Quotient.inductionOn' [GOAL] case h.h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A a✝¹ a✝ : NumDenSameDeg 𝒜 x h : val (Quotient.mk'' a✝¹) = val (Quotient.mk'' a✝) ⊢ Quotient.mk'' a✝¹ = Quotient.mk'' a✝ [PROOFSTEP] rw [Quotient.eq''] [GOAL] case h.h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁵ : AddCommMonoid ι inst✝⁴ : DecidableEq ι inst✝³ : CommRing R inst✝² : CommRing A inst✝¹ : Algebra R A 𝒜 : ι → Submodule R A inst✝ : GradedAlgebra 𝒜 x : Submonoid A a✝¹ a✝ : NumDenSameDeg 𝒜 x h : val (Quotient.mk'' a✝¹) = val (Quotient.mk'' a✝) ⊢ Setoid.r a✝¹ a✝ [PROOFSTEP] simpa only [Quotient.liftOn'_mk] using h [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 h1 : IsUnit (val f) ⊢ IsUnit f [PROOFSTEP] rcases h1 with ⟨⟨a, b, eq0, eq1⟩, eq2 : a = f.val⟩ [GOAL] case intro.mk ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 a b : at Ideal.primeCompl 𝔭 eq0 : a * b = 1 eq1 : b * a = 1 eq2 : a = val f ⊢ IsUnit f [PROOFSTEP] rw [eq2] at eq0 eq1 [GOAL] case intro.mk ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 a b : at Ideal.primeCompl 𝔭 eq0 : val f * b = 1 eq1 : b * val f = 1 eq2 : a = val f ⊢ IsUnit f [PROOFSTEP] clear a eq2 [GOAL] case intro.mk ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 b : at Ideal.primeCompl 𝔭 eq0 : val f * b = 1 eq1 : b * val f = 1 ⊢ IsUnit f [PROOFSTEP] induction' b using Localization.induction_on with data [GOAL] case intro.mk.H ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 b : at Ideal.primeCompl 𝔭 eq0✝ : val f * b = 1 eq1✝ : b * val f = 1 data : A × { x // x ∈ Ideal.primeCompl 𝔭 } eq0 : val f * Localization.mk data.fst data.snd = 1 eq1 : Localization.mk data.fst data.snd * val f = 1 ⊢ IsUnit f [PROOFSTEP] rcases data with ⟨a, ⟨b, hb⟩⟩ [GOAL] case intro.mk.H.mk.mk ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 b✝ : at Ideal.primeCompl 𝔭 eq0✝ : val f * b✝ = 1 eq1✝ : b✝ * val f = 1 a b : A hb : b ∈ Ideal.primeCompl 𝔭 eq0 : val f * Localization.mk (a, { val := b, property := hb }).fst (a, { val := b, property := hb }).snd = 1 eq1 : Localization.mk (a, { val := b, property := hb }).fst (a, { val := b, property := hb }).snd * val f = 1 ⊢ IsUnit f [PROOFSTEP] dsimp only at eq0 eq1 [GOAL] case intro.mk.H.mk.mk ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 b✝ : at Ideal.primeCompl 𝔭 eq0✝ : val f * b✝ = 1 eq1✝ : b✝ * val f = 1 a b : A hb : b ∈ Ideal.primeCompl 𝔭 eq0 : val f * Localization.mk a { val := b, property := hb } = 1 eq1 : Localization.mk a { val := b, property := hb } * val f = 1 ⊢ IsUnit f [PROOFSTEP] have b_f_den_not_mem : b * f.den ∈ 𝔭.primeCompl := fun r => Or.elim (Ideal.IsPrime.mem_or_mem inferInstance r) (hb ·) (f.den_mem ·) [GOAL] case intro.mk.H.mk.mk ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 b✝ : at Ideal.primeCompl 𝔭 eq0✝ : val f * b✝ = 1 eq1✝ : b✝ * val f = 1 a b : A hb : b ∈ Ideal.primeCompl 𝔭 eq0 : val f * Localization.mk a { val := b, property := hb } = 1 eq1 : Localization.mk a { val := b, property := hb } * val f = 1 b_f_den_not_mem : b * den f ∈ Ideal.primeCompl 𝔭 ⊢ IsUnit f [PROOFSTEP] rw [f.eq_num_div_den, Localization.mk_mul, show (⟨b, hb⟩ : 𝔭.primeCompl) * ⟨f.den, _⟩ = ⟨b * f.den, _⟩ from rfl, show (1 : Localization.AtPrime 𝔭) = Localization.mk 1 1 by erw [Localization.mk_self 1], Localization.mk_eq_mk', IsLocalization.eq] at eq1 [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 b✝ : at Ideal.primeCompl 𝔭 eq0✝ : val f * b✝ = 1 eq1✝ : b✝ * val f = 1 a b : A hb : b ∈ Ideal.primeCompl 𝔭 eq0 : val f * Localization.mk a { val := b, property := hb } = 1 eq1 : Localization.mk (a * num f) { val := b * den f, property := (_ : ↑{ val := b, property := hb } * ↑{ val := den f, property := (_ : den f ∈ Ideal.primeCompl 𝔭) } ∈ Ideal.primeCompl 𝔭) } = 1 b_f_den_not_mem : b * den f ∈ Ideal.primeCompl 𝔭 ⊢ 1 = Localization.mk 1 1 [PROOFSTEP] erw [Localization.mk_self 1] [GOAL] case intro.mk.H.mk.mk ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 b✝ : at Ideal.primeCompl 𝔭 eq0✝ : val f * b✝ = 1 eq1✝ : b✝ * val f = 1 a b : A hb : b ∈ Ideal.primeCompl 𝔭 eq0 : val f * Localization.mk a { val := b, property := hb } = 1 eq1 : ∃ c, ↑c * (↑1 * (a * num f)) = ↑c * (↑{ val := b * den f, property := (_ : ↑{ val := b, property := hb } * ↑{ val := den f, property := (_ : den f ∈ Ideal.primeCompl 𝔭) } ∈ Ideal.primeCompl 𝔭) } * 1) b_f_den_not_mem : b * den f ∈ Ideal.primeCompl 𝔭 ⊢ IsUnit f [PROOFSTEP] rcases eq1 with ⟨⟨c, hc⟩, eq1⟩ [GOAL] case intro.mk.H.mk.mk.intro.mk ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 b✝ : at Ideal.primeCompl 𝔭 eq0✝ : val f * b✝ = 1 eq1✝ : b✝ * val f = 1 a b : A hb : b ∈ Ideal.primeCompl 𝔭 eq0 : val f * Localization.mk a { val := b, property := hb } = 1 b_f_den_not_mem : b * den f ∈ Ideal.primeCompl 𝔭 c : A hc : c ∈ Ideal.primeCompl 𝔭 eq1 : ↑{ val := c, property := hc } * (↑1 * (a * num f)) = ↑{ val := c, property := hc } * (↑{ val := b * den f, property := (_ : ↑{ val := b, property := hb } * ↑{ val := den f, property := (_ : den f ∈ Ideal.primeCompl 𝔭) } ∈ Ideal.primeCompl 𝔭) } * 1) ⊢ IsUnit f [PROOFSTEP] change c * (1 * (a * f.num)) = _ at eq1 [GOAL] case intro.mk.H.mk.mk.intro.mk ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 b✝ : at Ideal.primeCompl 𝔭 eq0✝ : val f * b✝ = 1 eq1✝ : b✝ * val f = 1 a b : A hb : b ∈ Ideal.primeCompl 𝔭 eq0 : val f * Localization.mk a { val := b, property := hb } = 1 b_f_den_not_mem : b * den f ∈ Ideal.primeCompl 𝔭 c : A hc : c ∈ Ideal.primeCompl 𝔭 eq1 : c * (1 * (a * num f)) = ↑{ val := c, property := hc } * (↑{ val := b * den f, property := (_ : ↑{ val := b, property := hb } * ↑{ val := den f, property := (_ : den f ∈ Ideal.primeCompl 𝔭) } ∈ Ideal.primeCompl 𝔭) } * 1) ⊢ IsUnit f [PROOFSTEP] simp only [one_mul, mul_one] at eq1 [GOAL] case intro.mk.H.mk.mk.intro.mk ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 b✝ : at Ideal.primeCompl 𝔭 eq0✝ : val f * b✝ = 1 eq1✝ : b✝ * val f = 1 a b : A hb : b ∈ Ideal.primeCompl 𝔭 eq0 : val f * Localization.mk a { val := b, property := hb } = 1 b_f_den_not_mem : b * den f ∈ Ideal.primeCompl 𝔭 c : A hc : c ∈ Ideal.primeCompl 𝔭 eq1 : c * (a * num f) = c * (b * den f) ⊢ IsUnit f [PROOFSTEP] have mem1 : c * (a * f.num) ∈ 𝔭.primeCompl := eq1.symm ▸ fun r => Or.elim (Ideal.IsPrime.mem_or_mem inferInstance r) (by tauto) (by tauto) [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 b✝ : at Ideal.primeCompl 𝔭 eq0✝ : val f * b✝ = 1 eq1✝ : b✝ * val f = 1 a b : A hb : b ∈ Ideal.primeCompl 𝔭 eq0 : val f * Localization.mk a { val := b, property := hb } = 1 b_f_den_not_mem : b * den f ∈ Ideal.primeCompl 𝔭 c : A hc : c ∈ Ideal.primeCompl 𝔭 eq1 : c * (a * num f) = c * (b * den f) r : c * (b * den f) ∈ ↑𝔭 ⊢ c ∈ 𝔭 → False [PROOFSTEP] tauto [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 b✝ : at Ideal.primeCompl 𝔭 eq0✝ : val f * b✝ = 1 eq1✝ : b✝ * val f = 1 a b : A hb : b ∈ Ideal.primeCompl 𝔭 eq0 : val f * Localization.mk a { val := b, property := hb } = 1 b_f_den_not_mem : b * den f ∈ Ideal.primeCompl 𝔭 c : A hc : c ∈ Ideal.primeCompl 𝔭 eq1 : c * (a * num f) = c * (b * den f) r : c * (b * den f) ∈ ↑𝔭 ⊢ b * den f ∈ 𝔭 → False [PROOFSTEP] tauto [GOAL] case intro.mk.H.mk.mk.intro.mk ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 b✝ : at Ideal.primeCompl 𝔭 eq0✝ : val f * b✝ = 1 eq1✝ : b✝ * val f = 1 a b : A hb : b ∈ Ideal.primeCompl 𝔭 eq0 : val f * Localization.mk a { val := b, property := hb } = 1 b_f_den_not_mem : b * den f ∈ Ideal.primeCompl 𝔭 c : A hc : c ∈ Ideal.primeCompl 𝔭 eq1 : c * (a * num f) = c * (b * den f) mem1 : c * (a * num f) ∈ Ideal.primeCompl 𝔭 ⊢ IsUnit f [PROOFSTEP] have mem2 : f.num ∉ 𝔭 := by contrapose! mem1 erw [Classical.not_not] exact Ideal.mul_mem_left _ _ (Ideal.mul_mem_left _ _ mem1) [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 b✝ : at Ideal.primeCompl 𝔭 eq0✝ : val f * b✝ = 1 eq1✝ : b✝ * val f = 1 a b : A hb : b ∈ Ideal.primeCompl 𝔭 eq0 : val f * Localization.mk a { val := b, property := hb } = 1 b_f_den_not_mem : b * den f ∈ Ideal.primeCompl 𝔭 c : A hc : c ∈ Ideal.primeCompl 𝔭 eq1 : c * (a * num f) = c * (b * den f) mem1 : c * (a * num f) ∈ Ideal.primeCompl 𝔭 ⊢ ¬num f ∈ 𝔭 [PROOFSTEP] contrapose! mem1 [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 b✝ : at Ideal.primeCompl 𝔭 eq0✝ : val f * b✝ = 1 eq1✝ : b✝ * val f = 1 a b : A hb : b ∈ Ideal.primeCompl 𝔭 eq0 : val f * Localization.mk a { val := b, property := hb } = 1 b_f_den_not_mem : b * den f ∈ Ideal.primeCompl 𝔭 c : A hc : c ∈ Ideal.primeCompl 𝔭 eq1 : c * (a * num f) = c * (b * den f) mem1 : num f ∈ 𝔭 ⊢ ¬c * (a * num f) ∈ Ideal.primeCompl 𝔭 [PROOFSTEP] erw [Classical.not_not] [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 b✝ : at Ideal.primeCompl 𝔭 eq0✝ : val f * b✝ = 1 eq1✝ : b✝ * val f = 1 a b : A hb : b ∈ Ideal.primeCompl 𝔭 eq0 : val f * Localization.mk a { val := b, property := hb } = 1 b_f_den_not_mem : b * den f ∈ Ideal.primeCompl 𝔭 c : A hc : c ∈ Ideal.primeCompl 𝔭 eq1 : c * (a * num f) = c * (b * den f) mem1 : num f ∈ 𝔭 ⊢ c * (a * num f) ∈ ↑𝔭 [PROOFSTEP] exact Ideal.mul_mem_left _ _ (Ideal.mul_mem_left _ _ mem1) [GOAL] case intro.mk.H.mk.mk.intro.mk ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 b✝ : at Ideal.primeCompl 𝔭 eq0✝ : val f * b✝ = 1 eq1✝ : b✝ * val f = 1 a b : A hb : b ∈ Ideal.primeCompl 𝔭 eq0 : val f * Localization.mk a { val := b, property := hb } = 1 b_f_den_not_mem : b * den f ∈ Ideal.primeCompl 𝔭 c : A hc : c ∈ Ideal.primeCompl 𝔭 eq1 : c * (a * num f) = c * (b * den f) mem1 : c * (a * num f) ∈ Ideal.primeCompl 𝔭 mem2 : ¬num f ∈ 𝔭 ⊢ IsUnit f [PROOFSTEP] refine' ⟨⟨f, Quotient.mk'' ⟨f.deg, ⟨f.den, f.den_mem_deg⟩, ⟨f.num, f.num_mem_deg⟩, mem2⟩, _, _⟩, rfl⟩ [GOAL] case intro.mk.H.mk.mk.intro.mk.refine'_1 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 b✝ : at Ideal.primeCompl 𝔭 eq0✝ : val f * b✝ = 1 eq1✝ : b✝ * val f = 1 a b : A hb : b ∈ Ideal.primeCompl 𝔭 eq0 : val f * Localization.mk a { val := b, property := hb } = 1 b_f_den_not_mem : b * den f ∈ Ideal.primeCompl 𝔭 c : A hc : c ∈ Ideal.primeCompl 𝔭 eq1 : c * (a * num f) = c * (b * den f) mem1 : c * (a * num f) ∈ Ideal.primeCompl 𝔭 mem2 : ¬num f ∈ 𝔭 ⊢ f * Quotient.mk'' { deg := deg f, num := { val := den f, property := (_ : den f ∈ 𝒜 (deg f)) }, den := { val := num f, property := (_ : num f ∈ 𝒜 (deg f)) }, den_mem := mem2 } = 1 [PROOFSTEP] simp only [ext_iff_val, mul_val, val_mk'', f.eq_num_div_den, Localization.mk_mul, one_val] [GOAL] case intro.mk.H.mk.mk.intro.mk.refine'_2 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 b✝ : at Ideal.primeCompl 𝔭 eq0✝ : val f * b✝ = 1 eq1✝ : b✝ * val f = 1 a b : A hb : b ∈ Ideal.primeCompl 𝔭 eq0 : val f * Localization.mk a { val := b, property := hb } = 1 b_f_den_not_mem : b * den f ∈ Ideal.primeCompl 𝔭 c : A hc : c ∈ Ideal.primeCompl 𝔭 eq1 : c * (a * num f) = c * (b * den f) mem1 : c * (a * num f) ∈ Ideal.primeCompl 𝔭 mem2 : ¬num f ∈ 𝔭 ⊢ Quotient.mk'' { deg := deg f, num := { val := den f, property := (_ : den f ∈ 𝒜 (deg f)) }, den := { val := num f, property := (_ : num f ∈ 𝒜 (deg f)) }, den_mem := mem2 } * f = 1 [PROOFSTEP] simp only [ext_iff_val, mul_val, val_mk'', f.eq_num_div_den, Localization.mk_mul, one_val] [GOAL] case intro.mk.H.mk.mk.intro.mk.refine'_1 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 b✝ : at Ideal.primeCompl 𝔭 eq0✝ : val f * b✝ = 1 eq1✝ : b✝ * val f = 1 a b : A hb : b ∈ Ideal.primeCompl 𝔭 eq0 : val f * Localization.mk a { val := b, property := hb } = 1 b_f_den_not_mem : b * den f ∈ Ideal.primeCompl 𝔭 c : A hc : c ∈ Ideal.primeCompl 𝔭 eq1 : c * (a * num f) = c * (b * den f) mem1 : c * (a * num f) ∈ Ideal.primeCompl 𝔭 mem2 : ¬num f ∈ 𝔭 ⊢ Localization.mk (num f * den f) ({ val := den f, property := (_ : den f ∈ Ideal.primeCompl 𝔭) } * { val := num f, property := (_ : ↑{ deg := deg f, num := { val := den f, property := (_ : den f ∈ 𝒜 (deg f)) }, den := { val := num f, property := (_ : num f ∈ 𝒜 (deg f)) }, den_mem := mem2 }.den ∈ Ideal.primeCompl 𝔭) }) = 1 [PROOFSTEP] convert Localization.mk_self (M := A) _ [GOAL] case intro.mk.H.mk.mk.intro.mk.refine'_2 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 b✝ : at Ideal.primeCompl 𝔭 eq0✝ : val f * b✝ = 1 eq1✝ : b✝ * val f = 1 a b : A hb : b ∈ Ideal.primeCompl 𝔭 eq0 : val f * Localization.mk a { val := b, property := hb } = 1 b_f_den_not_mem : b * den f ∈ Ideal.primeCompl 𝔭 c : A hc : c ∈ Ideal.primeCompl 𝔭 eq1 : c * (a * num f) = c * (b * den f) mem1 : c * (a * num f) ∈ Ideal.primeCompl 𝔭 mem2 : ¬num f ∈ 𝔭 ⊢ Localization.mk (den f * num f) ({ val := num f, property := (_ : ↑{ deg := deg f, num := { val := den f, property := (_ : den f ∈ 𝒜 (deg f)) }, den := { val := num f, property := (_ : num f ∈ 𝒜 (deg f)) }, den_mem := mem2 }.den ∈ Ideal.primeCompl 𝔭) } * { val := den f, property := (_ : den f ∈ Ideal.primeCompl 𝔭) }) = 1 [PROOFSTEP] convert Localization.mk_self (M := A) _ [GOAL] case h.e'_2.h.h.e'_4 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 b✝ : at Ideal.primeCompl 𝔭 eq0✝ : val f * b✝ = 1 eq1✝ : b✝ * val f = 1 a b : A hb : b ∈ Ideal.primeCompl 𝔭 eq0 : val f * Localization.mk a { val := b, property := hb } = 1 b_f_den_not_mem : b * den f ∈ Ideal.primeCompl 𝔭 c : A hc : c ∈ Ideal.primeCompl 𝔭 eq1 : c * (a * num f) = c * (b * den f) mem1 : c * (a * num f) ∈ Ideal.primeCompl 𝔭 mem2 : ¬num f ∈ 𝔭 ⊢ num f * den f = ↑({ val := den f, property := (_ : den f ∈ Ideal.primeCompl 𝔭) } * { val := num f, property := (_ : ↑{ deg := deg f, num := { val := den f, property := (_ : den f ∈ 𝒜 (deg f)) }, den := { val := num f, property := (_ : num f ∈ 𝒜 (deg f)) }, den_mem := mem2 }.den ∈ Ideal.primeCompl 𝔭) }) [PROOFSTEP] rw [mul_comm] [GOAL] case h.e'_2.h.h.e'_4 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 b✝ : at Ideal.primeCompl 𝔭 eq0✝ : val f * b✝ = 1 eq1✝ : b✝ * val f = 1 a b : A hb : b ∈ Ideal.primeCompl 𝔭 eq0 : val f * Localization.mk a { val := b, property := hb } = 1 b_f_den_not_mem : b * den f ∈ Ideal.primeCompl 𝔭 c : A hc : c ∈ Ideal.primeCompl 𝔭 eq1 : c * (a * num f) = c * (b * den f) mem1 : c * (a * num f) ∈ Ideal.primeCompl 𝔭 mem2 : ¬num f ∈ 𝔭 ⊢ den f * num f = ↑({ val := num f, property := (_ : ↑{ deg := deg f, num := { val := den f, property := (_ : den f ∈ 𝒜 (deg f)) }, den := { val := num f, property := (_ : num f ∈ 𝒜 (deg f)) }, den_mem := mem2 }.den ∈ Ideal.primeCompl 𝔭) } * { val := den f, property := (_ : den f ∈ Ideal.primeCompl 𝔭) }) [PROOFSTEP] rw [mul_comm] [GOAL] case h.e'_2.h.h.e'_4 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 b✝ : at Ideal.primeCompl 𝔭 eq0✝ : val f * b✝ = 1 eq1✝ : b✝ * val f = 1 a b : A hb : b ∈ Ideal.primeCompl 𝔭 eq0 : val f * Localization.mk a { val := b, property := hb } = 1 b_f_den_not_mem : b * den f ∈ Ideal.primeCompl 𝔭 c : A hc : c ∈ Ideal.primeCompl 𝔭 eq1 : c * (a * num f) = c * (b * den f) mem1 : c * (a * num f) ∈ Ideal.primeCompl 𝔭 mem2 : ¬num f ∈ 𝔭 ⊢ den f * num f = ↑({ val := den f, property := (_ : den f ∈ Ideal.primeCompl 𝔭) } * { val := num f, property := (_ : ↑{ deg := deg f, num := { val := den f, property := (_ : den f ∈ 𝒜 (deg f)) }, den := { val := num f, property := (_ : num f ∈ 𝒜 (deg f)) }, den_mem := mem2 }.den ∈ Ideal.primeCompl 𝔭) }) [PROOFSTEP] rfl [GOAL] case h.e'_2.h.h.e'_4 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 b✝ : at Ideal.primeCompl 𝔭 eq0✝ : val f * b✝ = 1 eq1✝ : b✝ * val f = 1 a b : A hb : b ∈ Ideal.primeCompl 𝔭 eq0 : val f * Localization.mk a { val := b, property := hb } = 1 b_f_den_not_mem : b * den f ∈ Ideal.primeCompl 𝔭 c : A hc : c ∈ Ideal.primeCompl 𝔭 eq1 : c * (a * num f) = c * (b * den f) mem1 : c * (a * num f) ∈ Ideal.primeCompl 𝔭 mem2 : ¬num f ∈ 𝔭 ⊢ num f * den f = ↑({ val := num f, property := (_ : ↑{ deg := deg f, num := { val := den f, property := (_ : den f ∈ 𝒜 (deg f)) }, den := { val := num f, property := (_ : num f ∈ 𝒜 (deg f)) }, den_mem := mem2 }.den ∈ Ideal.primeCompl 𝔭) } * { val := den f, property := (_ : den f ∈ Ideal.primeCompl 𝔭) }) [PROOFSTEP] rfl [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 x✝ : IsUnit f b : AtPrime 𝒜 𝔭 eq1 : f * b = 1 eq2 : b * f = 1 ⊢ IsUnit (val f) [PROOFSTEP] simp only [ext_iff_val, mul_val, one_val] at eq1 eq2 [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 f : AtPrime 𝒜 𝔭 x✝ : IsUnit f b : AtPrime 𝒜 𝔭 eq1 : val f * val b = 1 eq2 : val b * val f = 1 ⊢ IsUnit (val f) [PROOFSTEP] exact ⟨⟨f.val, b.val, eq1, eq2⟩, rfl⟩ [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 r : 0 = 1 ⊢ False [PROOFSTEP] simp [ext_iff_val, zero_val, one_val, zero_ne_one] at r [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 a : AtPrime 𝒜 𝔭 ⊢ IsUnit a ∨ IsUnit (1 - a) [PROOFSTEP] simp only [← isUnit_iff_isUnit_val, sub_val, one_val] [GOAL] ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 a : AtPrime 𝒜 𝔭 ⊢ IsUnit (val a) ∨ IsUnit (1 - val a) [PROOFSTEP] induction' a using Quotient.inductionOn' with a [GOAL] case h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 a : NumDenSameDeg 𝒜 (Ideal.primeCompl 𝔭) ⊢ IsUnit (val (Quotient.mk'' a)) ∨ IsUnit (1 - val (Quotient.mk'' a)) [PROOFSTEP] simp only [HomogeneousLocalization.val_mk''] [GOAL] case h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 a : NumDenSameDeg 𝒜 (Ideal.primeCompl 𝔭) ⊢ IsUnit (Localization.mk ↑a.num { val := ↑a.den, property := (_ : ↑a.den ∈ Ideal.primeCompl 𝔭) }) ∨ IsUnit (1 - Localization.mk ↑a.num { val := ↑a.den, property := (_ : ↑a.den ∈ Ideal.primeCompl 𝔭) }) [PROOFSTEP] by_cases mem1 : a.num.1 ∈ 𝔭 [GOAL] case pos ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 a : NumDenSameDeg 𝒜 (Ideal.primeCompl 𝔭) mem1 : ↑a.num ∈ 𝔭 ⊢ IsUnit (Localization.mk ↑a.num { val := ↑a.den, property := (_ : ↑a.den ∈ Ideal.primeCompl 𝔭) }) ∨ IsUnit (1 - Localization.mk ↑a.num { val := ↑a.den, property := (_ : ↑a.den ∈ Ideal.primeCompl 𝔭) }) [PROOFSTEP] right [GOAL] case pos.h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 a : NumDenSameDeg 𝒜 (Ideal.primeCompl 𝔭) mem1 : ↑a.num ∈ 𝔭 ⊢ IsUnit (1 - Localization.mk ↑a.num { val := ↑a.den, property := (_ : ↑a.den ∈ Ideal.primeCompl 𝔭) }) [PROOFSTEP] have : a.den.1 - a.num.1 ∈ 𝔭.primeCompl := fun h => a.den_mem (sub_add_cancel a.den.val a.num.val ▸ Ideal.add_mem _ h mem1 : a.den.1 ∈ 𝔭) [GOAL] case pos.h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 a : NumDenSameDeg 𝒜 (Ideal.primeCompl 𝔭) mem1 : ↑a.num ∈ 𝔭 this : ↑a.den - ↑a.num ∈ Ideal.primeCompl 𝔭 ⊢ IsUnit (1 - Localization.mk ↑a.num { val := ↑a.den, property := (_ : ↑a.den ∈ Ideal.primeCompl 𝔭) }) [PROOFSTEP] apply isUnit_of_mul_eq_one _ (Localization.mk a.den.1 ⟨a.den.1 - a.num.1, this⟩) [GOAL] case pos.h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 a : NumDenSameDeg 𝒜 (Ideal.primeCompl 𝔭) mem1 : ↑a.num ∈ 𝔭 this : ↑a.den - ↑a.num ∈ Ideal.primeCompl 𝔭 ⊢ (1 - Localization.mk ↑a.num { val := ↑a.den, property := (_ : ↑a.den ∈ Ideal.primeCompl 𝔭) }) * Localization.mk ↑a.den { val := ↑a.den - ↑a.num, property := this } = 1 [PROOFSTEP] simp only [sub_mul, Localization.mk_mul, one_mul, Localization.sub_mk, Submonoid.coe_mul] [GOAL] case pos.h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 a : NumDenSameDeg 𝒜 (Ideal.primeCompl 𝔭) mem1 : ↑a.num ∈ 𝔭 this : ↑a.den - ↑a.num ∈ Ideal.primeCompl 𝔭 ⊢ Localization.mk (↑a.den * (↑a.den - ↑a.num) * ↑a.den - (↑a.den * (↑a.num * ↑a.den) - ↑a.num * (↑a.num * ↑a.den))) ({ val := ↑a.den - ↑a.num, property := this } * ({ val := ↑a.den, property := (_ : ↑a.den ∈ Ideal.primeCompl 𝔭) } * { val := ↑a.den - ↑a.num, property := this })) = 1 [PROOFSTEP] convert Localization.mk_self (M := A) _ [GOAL] case h.e'_2.h.h.e'_4 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 a : NumDenSameDeg 𝒜 (Ideal.primeCompl 𝔭) mem1 : ↑a.num ∈ 𝔭 this : ↑a.den - ↑a.num ∈ Ideal.primeCompl 𝔭 ⊢ ↑a.den * (↑a.den - ↑a.num) * ↑a.den - (↑a.den * (↑a.num * ↑a.den) - ↑a.num * (↑a.num * ↑a.den)) = ↑({ val := ↑a.den - ↑a.num, property := this } * ({ val := ↑a.den, property := (_ : ↑a.den ∈ Ideal.primeCompl 𝔭) } * { val := ↑a.den - ↑a.num, property := this })) [PROOFSTEP] simp only [Submonoid.coe_mul] [GOAL] case h.e'_2.h.h.e'_4 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 a : NumDenSameDeg 𝒜 (Ideal.primeCompl 𝔭) mem1 : ↑a.num ∈ 𝔭 this : ↑a.den - ↑a.num ∈ Ideal.primeCompl 𝔭 ⊢ ↑a.den * (↑a.den - ↑a.num) * ↑a.den - (↑a.den * (↑a.num * ↑a.den) - ↑a.num * (↑a.num * ↑a.den)) = (↑a.den - ↑a.num) * (↑a.den * (↑a.den - ↑a.num)) [PROOFSTEP] ring [GOAL] case neg ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 a : NumDenSameDeg 𝒜 (Ideal.primeCompl 𝔭) mem1 : ¬↑a.num ∈ 𝔭 ⊢ IsUnit (Localization.mk ↑a.num { val := ↑a.den, property := (_ : ↑a.den ∈ Ideal.primeCompl 𝔭) }) ∨ IsUnit (1 - Localization.mk ↑a.num { val := ↑a.den, property := (_ : ↑a.den ∈ Ideal.primeCompl 𝔭) }) [PROOFSTEP] left [GOAL] case neg.h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 a : NumDenSameDeg 𝒜 (Ideal.primeCompl 𝔭) mem1 : ¬↑a.num ∈ 𝔭 ⊢ IsUnit (Localization.mk ↑a.num { val := ↑a.den, property := (_ : ↑a.den ∈ Ideal.primeCompl 𝔭) }) [PROOFSTEP] change _ ∈ 𝔭.primeCompl at mem1 [GOAL] case neg.h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 a : NumDenSameDeg 𝒜 (Ideal.primeCompl 𝔭) mem1 : ↑a.num ∈ Ideal.primeCompl 𝔭 ⊢ IsUnit (Localization.mk ↑a.num { val := ↑a.den, property := (_ : ↑a.den ∈ Ideal.primeCompl 𝔭) }) [PROOFSTEP] apply isUnit_of_mul_eq_one _ (Localization.mk a.den.1 ⟨a.num.1, mem1⟩) [GOAL] case neg.h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 a : NumDenSameDeg 𝒜 (Ideal.primeCompl 𝔭) mem1 : ↑a.num ∈ Ideal.primeCompl 𝔭 ⊢ Localization.mk ↑a.num { val := ↑a.den, property := (_ : ↑a.den ∈ Ideal.primeCompl 𝔭) } * Localization.mk ↑a.den { val := ↑a.num, property := mem1 } = 1 [PROOFSTEP] rw [Localization.mk_mul] [GOAL] case neg.h ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 a : NumDenSameDeg 𝒜 (Ideal.primeCompl 𝔭) mem1 : ↑a.num ∈ Ideal.primeCompl 𝔭 ⊢ Localization.mk (↑a.num * ↑a.den) ({ val := ↑a.den, property := (_ : ↑a.den ∈ Ideal.primeCompl 𝔭) } * { val := ↑a.num, property := mem1 }) = 1 [PROOFSTEP] convert Localization.mk_self (M := A) _ [GOAL] case h.e'_2.h.h.e'_4 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 a : NumDenSameDeg 𝒜 (Ideal.primeCompl 𝔭) mem1 : ↑a.num ∈ Ideal.primeCompl 𝔭 ⊢ ↑a.num * ↑a.den = ↑({ val := ↑a.den, property := (_ : ↑a.den ∈ Ideal.primeCompl 𝔭) } * { val := ↑a.num, property := mem1 }) [PROOFSTEP] rw [mul_comm] [GOAL] case h.e'_2.h.h.e'_4 ι : Type u_1 R : Type u_2 A : Type u_3 inst✝⁶ : AddCommMonoid ι inst✝⁵ : DecidableEq ι inst✝⁴ : CommRing R inst✝³ : CommRing A inst✝² : Algebra R A 𝒜 : ι → Submodule R A inst✝¹ : GradedAlgebra 𝒜 x : Submonoid A 𝔭 : Ideal A inst✝ : Ideal.IsPrime 𝔭 a : NumDenSameDeg 𝒜 (Ideal.primeCompl 𝔭) mem1 : ↑a.num ∈ Ideal.primeCompl 𝔭 ⊢ ↑a.den * ↑a.num = ↑({ val := ↑a.den, property := (_ : ↑a.den ∈ Ideal.primeCompl 𝔭) } * { val := ↑a.num, property := mem1 }) [PROOFSTEP] rfl
module Main import System -countdown : (secs : Nat) -> IO () countdown Z = putStrLn "Lift off!" countdown (S secs) = do putStrLn (show (S secs)) usleep 1000000 countdown secs- countdowns : IO () countdowns = do putStr "Enter starting number: " Just startNum <- readNumber | Nothing => do putStrLn "Invalid input" countdowns countdown startNum putStr "Another (y/n)?" yn <- getLine if yn == "y" then countdowns else pure ()
If $f$ is holomorphic on a punctured ball $B(z,r)$ and can be written as $g(w)(w-z)^n$ and $h(w)(w-z)^m$ for some holomorphic functions $g$ and $h$ on $B(z,r)$, then $n=m$.
\iffalse This is a big-ish template that I've been using for years now. A lot of the includes are redundant, so if you're reading this and have no idea why I've included most things, don't worry - I don't either. Also, compiling this (to PDF, for instance) relies on CSS files present on my computer (coming from the packages). So it might not look as nice if you do it on yours (especially if you don't have all the packages). Ya'll've been warned. \fi \documentclass{article} \usepackage{tikz} \usetikzlibrary{% decorations.pathreplacing,% decorations.pathmorphing% } \usepackage{subcaption} \usepackage{todonotes} \usepackage{amsmath} \usepackage{amssymb} \usepackage{color} \usepackage{bm} % \usepackage[dvipsnames]{xcolor} \usepackage{graphicx,float} \usepackage{caption} \usepackage{float} \usepackage[hidelinks]{hyperref} \usepackage{enumitem} \usepackage[bottom]{footmisc} \usepackage{flexisym} \usepackage{cancel} \usepackage[braket]{qcircuit} \usepackage[margin=.8in, tmargin=.3in]{geometry} \usepackage{mathtools} % \renewcommand{\baselinestretch}{1.2} \newcommand{\eps}{\epsilon} \newcommand{\vq}{\mathbf{q}} \newcommand{\vqdot}{\mathbf{\dot{q}}} \newcommand{\vqddot}{\mathbf{\ddot{q}}} \newcommand{\vx}{\mathbf{x}} \newcommand{\vy}{\mathbf{y}} \newcommand{\vystar}{\mathbf{y}^*} \newcommand{\vu}{\mathbf{u}} \newcommand{\vv}{\mathbf{v}} \newcommand{\vf}{\mathbf{f}} \newcommand{\vr}{\mathbf{r}} \newcommand{\vp}{\mathbf{p}} \newcommand{\vg}{\mathbf{G}} \newcommand{\bM}{\mathbf{M}} \newcommand{\bC}{\mathbf{C}} \renewcommand{\vec}{\bm} \newcommand{\dotvec}[1]{\bm{\dot{#1}}} \newcommand{\bS}{\mathbf{S}} \newcommand{\bJ}{\mathbf{J}} \newcommand{\vlam}{\pmb{\lambda}} \newcommand{\vxdot}{\mathbf{\dot{x}}} \newcommand{\argmin}{\operatornamewithlimits{arg\ min}} % \newcommand{\tens}{\otimes} \newcommand{\tens}[1]{% \mathbin{\mathop{\otimes}\limits_{#1}}% } \setlength{\parskip}{\baselineskip} % \newcommand{\l}{\left(} \usepackage{titlesec} \usepackage{physics} \usepackage{multicol} \setlength\parindent{0pt} \captionsetup{justification=centering} \title{Classical Mechanics: From Newton to Euler-Lagrange} \date{\today} \author{Traiko Dinev \textless [email protected]\textgreater} \begin{document} \begin{multicols}{2}[Classical Mechanics: From Newton to Euler-Lagrang] \maketitle \textit{NOTE: These notes are a summary of Classical Mechanics: A Theoretical Minimum. They also contain some of David Morrin. Some of the notebooks are exercises I did through my own research.} \textit{NOTE: Note this "summary" is NOT a reproduction of the course materials nor is it copied from the corresponding courses. It was entirely written and typeset from scratch.} \textit{License: Creative Commons public license; See README.md of repository} Hey, it is me, the author of these notes. I used to think reading physics was pointless practically speaking, so I did it a bit sparingly. But then.. I actually needed it in my own research! So I'm citing my work here~\cite{dinev2020modeling}. Hopefully it encourages more academics to read physics at a moderate to advanced level, as you never know when you'll need it! \section{Basics} A position of a particle in space is $\bm{r} = (x, y, z)$, its velocity is $\bm{v} = \dot{\bm{r}} = \frac{d\bm{r}}{d t}$. By (almost) definition of derivatives, we have: \begin{equation} \bm{r}(t) = \bm{r}_0 + \bm{v}_0 t \end{equation} if $\bm{v}(t) = \bm{v}_0$ is independent of time. Adding acceleration to this, by \textbf{Newton's second law}, $\bm{a} = \dot{\bm{v}} = \bm{F}/m$, we can arrive at the following differential equation: \begin{equation} \dot{\bm{r}}_t = \bm{v}(t) = \bm{v}_0 + \bm{a}_0 t \end{equation} Integrating this, we obtain: \begin{align} \bm{r}(t) &= \bm{r}_0 + \int_0^t \bm{v}(t) dt = \bm{r}_0 + \int_0^t \bm{v}_0 + \bm{a}_0 t\ dt \\ &= \bm{r}_0 + \bm{v}_0 t + \frac{\bm{a}_0}{2} t^2 = \bm{r}_0 + \bm{v}_0 t + \frac{\bm{F}}{2m} t^2 \end{align} assuming that the acceleration is not a function of time. Otherwise you'd integrate the above ODE for each timestep. \section{Generalized Co-ordinates and Equations of Motion} \textit{The following is from a robotics summary of mine} A system's dynamics are most generally described by a second-order non-linear equation: \begin{equation} \label{eq:dynamics} \ddot{\vec{q}} = \vec{f}(\vec{q}, \dot{\vec{q}}, \vec{u}, t) \end{equation} where $\dot{\vec{q}}$ and $\ddot{\vec{q}}$ are the first and second derivative of $\vec{q}(t)$ -- the state of the system and $\vec{u}(t)$ -- the control inputs at time $t$. $\vec{f}$ is a matrix describing the dynamics. \autoref{eq:dynamics} describes the time-evolution of the world's configuration. This depends on the state at time $t$ as well as the control inputs we apply. We derive the equations of motion by using Newton's second law of motion. For all robots without kinematic chains (loop mechanical connections), the above can be generally written as the following product: \begin{equation} \label{eq:dynamics_standard} \vec{M}(\vec{q}) \ddot{\vec{q}} + \vec{C}(\vec{q}, \dot{\vec{q}}) \dot{\vec{q}} = \tau_g(\vec{q}) + \vec{B}\vec{u} \end{equation} Here $\vec{M}$ is the inertia matrix, $\vec{C}$ is the Coriolis matrix, $\tau_g$ is the gravity vector and $\vec{B}$ maps control inputs $\vec{u}$ into forces. For many systems this simplifies even further: \begin{equation} \label{eq:affine} \ddot{\vec{q}} = \vec{f}_1(\vec{q}, \dotvec{q}, t) + \vec{f}_2(\vec{q}, \dotvec{q}, t)\ \vec{u} \end{equation} We call such systems \textbf{control affine}. Such systems have dynamics that are affine (linear plus offset) in $\vec{u}$. \section{Lagrange} So how do we obtain the equations of motion of a system? They all obey Newton's second law, but there is another way of stating that is more general. Define the Lagrangian of a system as the difference of its kinetic energy and potential energy: \begin{equation*} \mathcal{L} = T - V \end{equation*} The fundamental law then states that for any system the motion from point A to point B is that which minimizes the integral of this difference along the path. In a sence it is a \textbf{stationary action principle}, that is the action (the integral) is stationary (not necessarily a minimum or maximum). Firstly, let's start with conservative forces (which as we'll see will make a certain term equal to 0). We write the integral of the lagrangian as: \begin{equation*} S = \int_{t_A}^{t_B} \mathcal{L}\ dt \end{equation*} and we call $S$ the \textbf{action}. The principle states that the action is stationary, i.e.: \begin{equation*} \delta S = 0 \end{equation*} In generalized coordinates the system's kinetic energy is $\frac{1}{2} \dot{q}^T M \dot{q}$. For readability we will stick to the one-dimensional case, trusting that this extends (and it does) to any dimensions. For now, all we need to know is that the Lagrangian $\mathcal{L}$ is a function of time, generalized positions, and generalized velocities: \begin{equation*} \mathcal{A} = \mathcal{A}(t, q(t), \dot{q}(t)) \end{equation*} Firstly, we need to be clear that the path a system takes must start and end at a fixed point (otherwise this doesn't work), that is $q(t_A) = q_A, q(t_B) = q_B$ and the same for velocities. We want to find the minimum of the action, that is: \begin{equation*} \min_{q(t)} S = \min \int_{t_A}^{t_B} \mathcal{L}\ dt \end{equation*} where we note two things. 1) we are minimizing w.r.t. a function and 2) -- we are minimizing an integral. Consider a petrubation of the path the system takes (the thing under the min above): \begin{align*} q'(t) &= q(t) + \epsilon \eta(t) \\ \dot{q}'(t) &= \dot{q}(t) + \epsilon \eta'(t) \end{align*} where we need to have $\eta(t_A) = \eta(t_B) = 0$, because we've fixed the start and end points. At the minimum any variation must yield a greater action (flip for maximum), that is: \begin{equation*} S[t, q(t), \dot{q}(t)] \leq S[t, q(t) + \epsilon \eta(t), \dot{q}(t) + \epsilon \eta'(t)] \end{equation*} which means that the minimum is at $\epsilon = 0$. Minimum means that the derivative needs to be $0$. First we define the thing that's at the minimum to be a function of $\epsilon$: \begin{equation*} f(\epsilon) = S[t, q'(t), \dot{q}'(t)] \end{equation*} Now we can say that this is minimized at $\epsilon = 0$ (follows from the assumption that action is minimized). Then we calculate its total derivative: \begin{equation} \frac{d f}{d \epsilon} = \frac{d}{d \epsilon}\int_{t_A}^{t_B} \mathcal{L}(t, q'(t), \dot{q}'(t))\ dt = \int_{t_A}^{t_B} \frac{d \mathcal{L}}{d \epsilon}\ dt \end{equation} The derivative of the Lagrangian w.r.t $\epsilon$ is: \begin{equation*} \frac{d \mathcal{L}}{d \epsilon} = \frac{\partial \mathcal{L}}{\partial t} \frac{d t}{d \epsilon} + \frac{\partial \mathcal{L}}{\partial q'} \frac{dq'}{d \epsilon} + \frac{\partial \mathcal{L}}{\partial \dot{q}'} \frac{d \dot{q}'}{d \epsilon} \end{equation*} The first term is $0$ since $\epsilon$ has no effect on $t$. We can do a substitution of the pertrubation derivatives to obtain: \begin{equation*} \frac{d \mathcal{L}}{d \epsilon} = \frac{\partial \mathcal{L}}{\partial q'} \eta(t) + \frac{\partial \mathcal{L}}{\partial \dot{q}'} \eta'(t) \end{equation*} note the slighly confusing notation, where $q'$ stands for variation in $q$ and $\eta'$ stands for $\eta$'s derivative. At least we consistenly use the inconsistency. Now the derivative of $f(\epsilon)$ needs to be $0$ at $\epsilon = 0$. This means we can remove all the pertrubations in the Lagrangian (set $q' = q, \dot{q}' = \dot{q}$) Meaning: \begin{equation*} \left. \frac{d \mathcal{L}}{d \epsilon} \right\vert_{\epsilon = 0} = \int_{t_A}^{t_B} \left[ \frac{\partial \mathcal{L}}{\partial q} \eta(t) + \frac{\partial \mathcal{L}}{\partial \dot{q}} \eta'(t) \right] dt = 0 \end{equation*} Next we need to integrate by parts. Remembering that if we have: \begin{equation*} \frac{d\ \eta f}{dt} = \eta \frac{df}{dt} + f \frac{d\eta}{dt} \end{equation*} then we can integrate to get: \begin{equation*} \int f \frac{d \eta}{dt} dt = \eta f - \int \eta \frac{df}{dt} dt \end{equation*} We apply integration by parts on the second term: \begin{align*} & \int_{t_A}^{t_B} \left[ \frac{\partial \mathcal{L}}{\partial q} \eta(t) + \frac{\partial \mathcal{L}}{\partial \dot{q}} \eta'(t) \right] dt \\ & = \int_{t_A}^{t_B} \frac{\partial \mathcal{L}}{\partial q} \eta(t)\ dt + \int_{t_A}^{t_B} \frac{\partial \mathcal{L}}{\partial \dot{q}} \eta'(t) dt \\ & = \int_{t_A}^{t_B} \frac{\partial \mathcal{L}}{\partial q} \eta(t)\ dt + \left[ \frac{\partial \mathcal{L}}{\partial\dot{q}} \eta(t) \right]_{t_A}^{t_B} - \int_{t_A}^{t_B} \frac{d}{dt} \frac{\partial \mathcal{L}}{\partial \dot{q}} \eta(t) \ dt \\ & = \int_{t_A}^{t_B} \frac{\partial \mathcal{L}}{\partial q} \eta(t)\ dt - \int_{t_A}^{t_B} \frac{d}{dt} \frac{\partial \mathcal{L}}{\partial \dot{q}} \eta(t)\ dt \\ & = \int_{t_A}^{t_B} \left[ \frac{\partial \mathcal{L}}{dq} \eta(t) - \frac{d}{dt} \frac{\partial \mathcal{L}}{\partial \dot{q}} \eta(t) \right] \ dt = \\ & = \int_{t_A}^{t_B} \left[ \frac{\partial \mathcal{L}}{\partial q} - \frac{d}{dt} \frac{\partial \mathcal{L}}{\partial\dot{q}} \right] \eta(t) \ dt \end{align*} where we apply the bundary conditions $\eta(t_A) = \eta(t_B) = 0$. Now we have this remaining: \begin{equation*} \int_{t_A}^{t_B} \left[ \frac{\partial \mathcal{L}}{\partial q} - \frac{d}{dt} \frac{\partial \mathcal{L}}{\partial \dot{q}} \right] \eta(t) \ dt = 0 \end{equation*} where this is true at $\epsilon = 0$. Feynman has the best visual proof but the idea is that if it's true for any $\eta(t)$ I can make it any delta function (peak) $\eta(t_i) = 1$ for any $i$ I choose then the first thing must be 0. Meaning: \begin{equation} \frac{\partial \mathcal{L}}{\partial q} - \frac{d}{dt} \frac{\partial \mathcal{L}}{\partial \dot{q}} = 0 \end{equation} Normally this is written the other way around: \begin{equation} \frac{d}{dt} \frac{\partial \mathcal{L}}{\partial \dot{q}} - \frac{\partial \mathcal{L}}{\partial q} = 0 \end{equation} The conservative forces show as potential energies. Namely: \begin{align*} \mathcal{L} &= T - V \\ T &= \frac{1}{2} m \dot{q}^2 \\ F_{pot} &= -\frac{d V}{dt} \end{align*} with a negative sign convention in physics. This is just Newton's second law for a particle: \begin{align*} \mathcal{L} &= \frac{1}{2} m v^2 - V(x) \\ \frac{d}{dt} m v&= -\frac{d V(x)}{dt} \\ m a &= F \end{align*} Lastly, remember external (non-conservative) forces? They show up on the right: \begin{equation} \frac{d}{dt} \frac{\partial \mathcal{L}}{\partial \dot{q}} - \frac{\partial \mathcal{L}}{\partial q} = F_{ext} \end{equation} \section{Example} \begin{figure}[H] \centering \begin{tikzpicture}[ media/.style={font={\footnotesize\sffamily}}, interface/.style={ postaction={draw,decorate,decoration={border,angle=-45, amplitude=0.3cm,segment length=2mm}}}, scale=1.2 ] % Round rectangle % \fill[gray!10,rounded corners] (-4,-3) rectangle (4,0); % Interface \draw[blue,line width=.5pt,interface](-3,0)--(3,0); % Vertical dashed line \draw[dashed,gray](0,0)--(0,3); % Coordinates system % \draw(0,0.15)node[above]{$x$}; \draw[<->,line width=1pt, shift={(-3cm, 0cm)}] (1,0) node[above]{$x$}-|(0,1) node[left]{$z$}; \path (0,0)++(80:2.cm)node{$\theta$}; \draw[->] (0,2.5) arc (90:30:.75cm); \path (0,0)++(-1.2, 1)node{$\phi$}; \draw[->] (-.6,.55) arc (-120:-250:.5cm); \draw[gray,dashed](0,1)--(1,.7); \path (1.3, .6)node{$x,z$}; \draw[line width=1pt](0,1cm)circle(.5cm); \draw[gray](0,1)--(1.5,2.5); \draw[gray, line width=1pt](1.1, 1.9)--(0.9,2.1); \draw[gray, line width=1pt](0.9,2.1)--(0.6,1.8); \draw[gray, line width=1pt](1.1,1.9)--(0.8,1.6); \draw[line width=1pt](1.5,2.5)circle(.1cm); \path(1.1, 2.6) node{$m_b$}; \draw[<->,line width=.5pt,blue,dashed](0.2,0.7)--(1.8, 2.2); \path (1.25, 1.25) node{$l$}; \end{tikzpicture} \caption{A Variable-Length Wheeled Inverted Pendulum (VL-WIP) model.} \label{fig:dynamics} \end{figure} We use the Lagrangian method to derive the dynamics of the system. First, we define the position $x_b, z_b$ of the mass $m_b$ and its velocity $\dot{x}_b, \dot{z}_b$: % % \vskip 0.1in \begin{align} x_b &= x + l\ \sin(\theta) \\ z_b &= z + l\ \cos(\theta) \nonumber \\ \dot{x}_b &= \dot{x} + \dot{l}\ \sin(\theta) + l\ cos(\theta)\ \dot{\theta} \nonumber \\ \dot{z}_b &= \dot{z} + \dot{l}\ \cos(\theta) - l\ sin(\theta)\ \dot{\theta} \nonumber \end{align} % \vskip 0.1in % Lagrange's method states that for a system with total kinetic energy $T$ and potential energy $U$: % \vskip 0.1in \begin{equation} \label{eq:lagrange} \frac{d}{dt} \frac{\partial \mathcal{L}}{\partial \vqdot_i} - \frac{\partial \mathcal{L}}{\partial \vq_i} = \vf_{ext}, \end{equation} \vskip 0.1in % where $\mathcal{L} = T - U$ is the system's Lagrangian and $\vf_{ext}$ are external forces applied to the system. We now need to compute the system's kinetic and potential energy. In general, every link will have a rotational and translational kinetic energy component. For the wheel we include a rotational kinetic energy term $I_w \dot{\phi}^2$ where $I_w = m_w R_w^2$ is the moment of inertia of the wheel. Since the point mass has a zero moment of inertia, it only has a translational kinetic energy $m_b \vv_b^T \vv_b$, where $\vv_b$ is the velocity of the point mass. The only potential energy component is due to gravity $g$ acting on the wheel and the point mass. This leads to: % \begin{align} \label{eq:energy1} T &= \frac{1}{2}(I_w \ \dot{\phi}^2 + m_w \dot{x}^2 + m_w \dot{z}^2 + m_b \dot{x}_b^2 + m_b \dot{z}_b^2) \\ U &= m_w g z + m_b g z_b \label{eq:energy2} \\ \mathcal{L} &= T - U \label{eq:energy3} \end{align} \textit{Note} I haven't written it out here, but you will obtain a system of equations, which you can solve however you want (scipy has a package to check your working). Then you can obtain the mass matrix, the coriolis matrix and the gravity vector. \section{Conservation Laws (Noether)} \subsection{Generic Proof (Simplified)} A symmetry is defined as $\delta S = 0$ for a certain variation in the path. As before, we define: \begin{align*} q_i'(t) &= q_i(t) + \eta_i(q(t), t) \\ \delta q_i &= q_i'(t) - q_i(t) = \eta_i(q(t), t) \end{align*} for all the generalized coordinates $q_i$. Then, since the action is invariant under the symmetry, we have: \begin{equation*} \delta S = S[q'] - S[q] = 0 \end{equation*} Noether's theorem states that the quantity (Q): \begin{equation*} Q = \sum_i \frac{\partial \mathcal{L}}{\partial \dot{q}_i} \eta_i \end{equation*} Starting with the action vanishing, we have: \begin{align*} &\delta S = \sum_i \int_{t_A}^{t_B} \delta \mathcal{L}\ dt = \int_{t_A}^{t_B} \frac{\partial \mathcal{L}}{\partial q_i} \delta q_i + \frac{\partial \mathcal{L}}{\partial \dot{q}_i} \delta \dot{q}_i\ dt = \\ &= \sum_i \int_{t_A}^{t_B} \frac{\partial \mathcal{L}}{\partial q_i} \eta_i + \frac{\partial \mathcal{L}}{\partial \dot{q}_i} \eta'_i \ dt = \\ &= \sum_i \int_{t_A}^{t_B} \left[ \frac{d}{dt} \frac{\partial \mathcal{L}}{\partial \dot{q}_i} - \frac{\partial \mathcal{L}}{\partial q_i} \right] \eta_i\ dt - \left. \frac{\partial \mathcal{L}}{\partial \dot{q}_i} \eta_i \right\vert_{t_A}^{t_B} \end{align*} where we used the same integration by parts trick as before. Now, if the system obeys the Newton-Euler equation of motion, then the integral vanishes and we have: \begin{align*} \delta S = \sum_i \left. \frac{\partial \mathcal{L}}{\partial \dot{q}_i} \eta_i \right\vert_{t_A}^{t_B} = Q(t_B) - Q(t_A) = 0 \end{align*} Since we did not specify or impose any constraints on $t_A$ and $t_B$, this is valid for any path. Thus: \begin{align*} \frac{d}{dt} \sum_i \frac{\partial \mathcal{L}}{\partial \dot{q}_i} \eta_i = 0 \end{align*} and $Q$ is conserved as its derivative is $0$ everywhere along the path. \subsection{Back to Physics} First we need a couple of definitions. A \textbf{cyclic coordinate} is one that does not occur in the Lagrangian, i.e.: \begin{equation} \frac{\partial \mathcal{L}}{\partial q} = 0 \end{equation} The \textbf{conjugate momemtum} is defined as: \begin{equation} p = \frac{\partial \mathcal{L}}{\partial \dot{q}} \end{equation} \subsubsection{Translational Invariance Leads to Conservation of Linear Momentum} Consider a translation transformation: \begin{equation*} q_i' = q_i + \epsilon_i \end{equation*} Then if the Lagrangian is invariant under such a transformation, the quantinity: \begin{equation*} Q = \sum_i \frac{\partial \mathcal{L}}{\partial \dot{q}_i} \epsilon_i \end{equation*} is conserved and so is the conjugate momentum, since $\epsilon$ is a constant. \subsubsection{Total Linear Momentum Conservation} Consider a vector potential that only depends on the relative distance between $N$ particles $\bm{x}_i$, where $i \in [1, N]$: \begin{equation*} \mathcal{L} = \sum_i \left[ m_i \frac{1}{2} \dot{\bm{x}}_i^T \dot{\bm{x}}_i - \sum_{b \neq a} V(\bm{x}_a - \bm{x}_b) \right] \end{equation*} Then shifting the entire system by the same vector does not change the lagrangian and the action. The velocity change is $0$ and the potential change is also $0$ as: \begin{align*} \bm{x}_i' &= \bm{x}_i + \bm{\epsilon} \\ \bm{x}_a' - \bm{x}_b' &= (\bm{x}_a + \bm{\epsilon}) - (\bm{x}_b + \bm{\epsilon}) = \bm{x}_a - \bm{x}_b \end{align*} which means that: \begin{equation*} Q = \sum_i \frac{\partial L}{\partial \dot{\bm{x}}_i} = \sum_i m_i \bm{\dot{x}}_i \end{equation*} is conserved. This is the sum linear momentum of the system. \subsubsection{Rotational Invariance Leads to Angular Momentum Conservation} TODO \section{Time-Translational Invariance Leads to Energy Convervation} \section{Harmonic Oscillator: Hamiltonians} \section{Gibbs Liouville} \section{Poisson Brackets} \section{Electromagnetic Force} \subsection{Lorentz Force Law} \subsection{Vector Potential} \subsection{Gauge Invariance} \bibliographystyle{IEEEtran} \bibliography{IEEEabrv,IEEEconf,bib} \end{multicols} \end{document}
[STATEMENT] lemma model_to_dimacs_neg_nin: "n_vars \<le> x \<Longrightarrow> int x \<notin> set (model_to_dimacs_model M [a..<n_vars])" [PROOF STATE] proof (prove) goal (1 subgoal): 1. n_vars \<le> x \<Longrightarrow> int x \<notin> set (model_to_dimacs_model M [a..<n_vars]) [PROOF STEP] by (induction n_vars arbitrary: a) (auto simp: model_to_dimacs_model_append')
= = = Origins = = =
module Core.FC import Core.Name.Namespace import Data.Maybe import Libraries.Text.Bounded import Libraries.Text.PrettyPrint.Prettyprinter %default total ------------------------------------------------------------------------ -- Types public export FilePos : Type FilePos = (Int, Int) showPos : FilePos -> String showPos (l, c) = show (l + 1) ++ ":" ++ show (c + 1) public export FileName : Type FileName = String public export data VirtualIdent : Type where Interactive : VirtualIdent public export Eq VirtualIdent where Interactive == Interactive = True export Show VirtualIdent where show Interactive = "(Interactive)" public export data OriginDesc : Type where ||| Anything that originates in physical Idris source files is assigned a ||| `PhysicalIdrSrc modIdent`, ||| where `modIdent` is the top-level module identifier of that file. PhysicalIdrSrc : (ident : ModuleIdent) -> OriginDesc ||| Anything parsed from a package file is decorated with `PhysicalPkgSrc fname`, ||| where `fname` is path to the package file. PhysicalPkgSrc : (fname : FileName) -> OriginDesc Virtual : (ident : VirtualIdent) -> OriginDesc public export Eq OriginDesc where PhysicalIdrSrc ident == PhysicalIdrSrc ident' = ident == ident' PhysicalPkgSrc fname == PhysicalPkgSrc fname' = fname == fname' Virtual ident == Virtual ident' = ident == ident' _ == _ = False export Show OriginDesc where show (PhysicalIdrSrc ident) = show ident show (PhysicalPkgSrc fname) = show fname show (Virtual ident) = show ident export Pretty OriginDesc where pretty = pretty . show ||| A file context is a filename together with starting and ending positions. ||| It's often carried by AST nodes that might have been created from a source ||| file or by the compiler. That makes it useful to have the notion of ||| `EmptyFC` as part of the type. public export data FC = MkFC OriginDesc FilePos FilePos | ||| Virtual FCs are FC attached to desugared/generated code. They can help with marking ||| errors, but we shouldn't attach semantic highlighting metadata to them. MkVirtualFC OriginDesc FilePos FilePos | EmptyFC ||| A version of a file context that cannot be empty public export NonEmptyFC : Type NonEmptyFC = (OriginDesc, FilePos, FilePos) ------------------------------------------------------------------------ -- Conversion between NonEmptyFC and FC ||| NonEmptyFC always embeds into FC export justFC : NonEmptyFC -> FC justFC (fname, start, end) = MkFC fname start end ||| A view checking whether an arbitrary FC happens to be non-empty export isNonEmptyFC : FC -> Maybe NonEmptyFC isNonEmptyFC (MkFC fn start end) = Just (fn, start, end) isNonEmptyFC (MkVirtualFC fn start end) = Just (fn, start, end) isNonEmptyFC EmptyFC = Nothing ||| A view checking whether an arbitrary FC originates from a source location export isConcreteFC : FC -> Maybe NonEmptyFC isConcreteFC (MkFC fn start end) = Just (fn, start, end) isConcreteFC _ = Nothing ||| Turn an FC into a virtual one export virtualiseFC : FC -> FC virtualiseFC (MkFC fn start end) = MkVirtualFC fn start end virtualiseFC fc = fc export defaultFC : NonEmptyFC defaultFC = (Virtual Interactive, (0, 0), (0, 0)) export replFC : FC replFC = justFC defaultFC export toNonEmptyFC : FC -> NonEmptyFC toNonEmptyFC = fromMaybe defaultFC . isNonEmptyFC ------------------------------------------------------------------------ -- Projections export origin : NonEmptyFC -> OriginDesc origin (fn, _, _) = fn export startPos : NonEmptyFC -> FilePos startPos (_, s, _) = s export startLine : NonEmptyFC -> Int startLine = fst . startPos export startCol : NonEmptyFC -> Int startCol = snd . startPos export endPos : NonEmptyFC -> FilePos endPos (_, _, e) = e export endLine : NonEmptyFC -> Int endLine = fst . endPos export endCol : NonEmptyFC -> Int endCol = snd . endPos ------------------------------------------------------------------------ -- Smart constructors export boundToFC : OriginDesc -> WithBounds t -> FC boundToFC mbModIdent b = MkFC mbModIdent (start b) (end b) ------------------------------------------------------------------------ -- Predicates --- Return whether a given file position is within the file context (assuming we're --- in the right file) export within : FilePos -> NonEmptyFC -> Bool within (x, y) (_, start, end) = (x, y) >= start && (x, y) <= end -- Return whether a given line is on the same line as the file context (assuming -- we're in the right file) export onLine : Int -> NonEmptyFC -> Bool onLine x (_, start, end) = x >= fst start && x <= fst end ------------------------------------------------------------------------ -- Constant values export emptyFC : FC emptyFC = EmptyFC ------------------------------------------------------------------------ -- Basic operations export mergeFC : FC -> FC -> Maybe FC mergeFC (MkFC fname1 start1 end1) (MkFC fname2 start2 end2) = if fname1 == fname2 then Just $ MkFC fname1 (min start1 start2) (max end1 end2) else Nothing mergeFC _ _ = Nothing %name FC fc ------------------------------------------------------------------------ -- Instances export Eq FC where (==) (MkFC n s e) (MkFC n' s' e') = n == n' && s == s' && e == e' (==) (MkVirtualFC n s e) (MkVirtualFC n' s' e') = n == n' && s == s' && e == e' (==) EmptyFC EmptyFC = True (==) _ _ = False export Show FC where show EmptyFC = "EmptyFC" show (MkFC ident startPos endPos) = show ident ++ ":" ++ showPos startPos ++ "--" ++ showPos endPos show (MkVirtualFC ident startPos endPos) = show ident ++ ":" ++ showPos startPos ++ "--" ++ showPos endPos prettyPos : FilePos -> Doc ann prettyPos (l, c) = pretty (l + 1) <+> colon <+> pretty (c + 1) export Pretty FC where pretty EmptyFC = pretty "EmptyFC" pretty (MkFC ident startPos endPos) = pretty ident <+> colon <+> prettyPos startPos <+> pretty "--" <+> prettyPos endPos pretty (MkVirtualFC ident startPos endPos) = pretty ident <+> colon <+> prettyPos startPos <+> pretty "--" <+> prettyPos endPos
Formal statement is: lemma (in linorder_topology) eventually_at_split: "eventually P (at x) \<longleftrightarrow> eventually P (at_left x) \<and> eventually P (at_right x)" Informal statement is: In a linearly ordered topological space, the set of points at which a property $P$ holds is the intersection of the sets of points at which $P$ holds to the left of $x$ and to the right of $x$.
State Before: F : Type u_1 α : Type u_2 β : Type u_3 R : Type ?u.86642 inst✝² : Semiring α inst✝¹ : Semiring β m n : α inst✝ : RingHomClass F α β f : F ⊢ Odd m → Odd (↑f m) State After: case intro F : Type u_1 α : Type u_2 β : Type u_3 R : Type ?u.86642 inst✝² : Semiring α inst✝¹ : Semiring β n : α inst✝ : RingHomClass F α β f : F m : α ⊢ Odd (↑f (2 * m + 1)) Tactic: rintro ⟨m, rfl⟩ State Before: case intro F : Type u_1 α : Type u_2 β : Type u_3 R : Type ?u.86642 inst✝² : Semiring α inst✝¹ : Semiring β n : α inst✝ : RingHomClass F α β f : F m : α ⊢ Odd (↑f (2 * m + 1)) State After: no goals Tactic: exact ⟨f m, by simp [two_mul]⟩ State Before: F : Type u_1 α : Type u_2 β : Type u_3 R : Type ?u.86642 inst✝² : Semiring α inst✝¹ : Semiring β n : α inst✝ : RingHomClass F α β f : F m : α ⊢ ↑f (2 * m + 1) = 2 * ↑f m + 1 State After: no goals Tactic: simp [two_mul]
/- Copyright (c) 2020 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ import Mathlib.PrePort import Mathlib.Lean3Lib.init.default import Mathlib.algebra.category.Module.kernels import Mathlib.algebra.category.Module.limits import Mathlib.category_theory.abelian.exact import Mathlib.PostPort universes u v u_1 namespace Mathlib /-! # The category of left R-modules is abelian. Additionally, two linear maps are exact in the categorical sense iff `range f = ker g`. -/ namespace Module /-- In the category of modules, every monomorphism is normal. -/ def normal_mono {R : Type u} [ring R] {M : Module R} {N : Module R} (f : M ⟶ N) (hf : category_theory.mono f) : category_theory.normal_mono f := category_theory.normal_mono.mk (of R (submodule.quotient (linear_map.range f))) (submodule.mkq (linear_map.range f)) sorry (category_theory.limits.is_kernel.iso_kernel (submodule.mkq (linear_map.range f)) f (kernel_is_limit (submodule.mkq (linear_map.range f))) (linear_equiv.to_Module_iso' (linear_equiv.trans (linear_equiv.symm (submodule.quot_equiv_of_eq_bot (linear_map.ker f) (ker_eq_bot_of_mono f))) (linear_equiv.trans (linear_map.quot_ker_equiv_range f) (linear_equiv.of_eq (linear_map.range f) (linear_map.ker (submodule.mkq (linear_map.range f))) sorry)))) sorry) /-- In the category of modules, every epimorphism is normal. -/ def normal_epi {R : Type u} [ring R] {M : Module R} {N : Module R} (f : M ⟶ N) (hf : category_theory.epi f) : category_theory.normal_epi f := category_theory.normal_epi.mk (of R ↥(linear_map.ker f)) (submodule.subtype (linear_map.ker f)) sorry (category_theory.limits.is_cokernel.cokernel_iso (submodule.subtype (linear_map.ker f)) f (cokernel_is_colimit (submodule.subtype (linear_map.ker f))) (linear_equiv.to_Module_iso' (linear_equiv.trans (linear_equiv.trans (submodule.quot_equiv_of_eq (linear_map.range (submodule.subtype (linear_map.ker f))) (linear_map.ker f) sorry) (linear_map.quot_ker_equiv_range f)) (linear_equiv.of_top (linear_map.range f) (range_eq_top_of_epi f)))) sorry) /-- The category of R-modules is abelian. -/ protected instance category_theory.abelian {R : Type u} [ring R] : category_theory.abelian (Module R) := category_theory.abelian.mk (fun (X Y : Module R) => normal_mono) fun (X Y : Module R) => normal_epi theorem exact_iff {R : Type u} [ring R] {M : Module R} {N : Module R} (f : M ⟶ N) {O : Module R} (g : N ⟶ O) : category_theory.exact f g ↔ linear_map.range f = linear_map.ker g := sorry
%2multibyte Version: 5.50.0.2953 CodePage: 65001 \documentclass{article} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %TCIDATA{OutputFilter=LATEX.DLL} %TCIDATA{Version=5.50.0.2953} %TCIDATA{Codepage=65001} %TCIDATA{<META NAME="SaveForMode" CONTENT="1">} %TCIDATA{BibliographyScheme=Manual} %TCIDATA{Created=Wednesday, July 31, 2013 16:50:51} %TCIDATA{LastRevised=Wednesday, July 31, 2013 17:20:44} %TCIDATA{<META NAME="GraphicsSave" CONTENT="32">} %TCIDATA{<META NAME="DocumentShell" CONTENT="Scientific Notebook\Blank Document">} %TCIDATA{CSTFile=Math with theorems suppressed.cst} %TCIDATA{PageSetup=72,72,72,72,0} %TCIDATA{AllPages= %F=36,\PARA{038<p type="texpara" tag="Body Text" >\hfill \thepage} %} \newtheorem{theorem}{Theorem} \newtheorem{acknowledgement}[theorem]{Acknowledgement} \newtheorem{algorithm}[theorem]{Algorithm} \newtheorem{axiom}[theorem]{Axiom} \newtheorem{case}[theorem]{Case} \newtheorem{claim}[theorem]{Claim} \newtheorem{conclusion}[theorem]{Conclusion} \newtheorem{condition}[theorem]{Condition} \newtheorem{conjecture}[theorem]{Conjecture} \newtheorem{corollary}[theorem]{Corollary} \newtheorem{criterion}[theorem]{Criterion} \newtheorem{definition}[theorem]{Definition} \newtheorem{example}[theorem]{Example} \newtheorem{exercise}[theorem]{Exercise} \newtheorem{lemma}[theorem]{Lemma} \newtheorem{notation}[theorem]{Notation} \newtheorem{problem}[theorem]{Problem} \newtheorem{proposition}[theorem]{Proposition} \newtheorem{remark}[theorem]{Remark} \newtheorem{solution}[theorem]{Solution} \newtheorem{summary}[theorem]{Summary} \newenvironment{proof}[1][Proof]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}} \input{tcilatex} \begin{document} \section{A more complex example} Phillips curve \[ \alpha _{\pi }\pi _{t}=c_{\pi }+\alpha _{\pi ,1}\pi _{t-1}+\alpha _{\pi ,2}\pi _{t-2}+\alpha _{y}y_{t-1}+\varepsilon _{\pi ,t} \] IS curve \[ \beta _{y}y_{t}=c_{y}+\beta _{y,1}y_{t-1}+\beta _{y,2}y_{t-2}-\beta _{r}\left( i_{t-1}-\pi _{t-1}\right) +\varepsilon _{y,t} \] Taylor rule \[ \gamma _{i}i_{t}=c_{i}+\gamma _{i}\rho _{i}i_{t-1}+\gamma _{i}\left( 1-\rho _{i}\right) \left( \gamma _{y}y_{t}+\gamma _{\pi }\pi _{t}\right) +\varepsilon _{i,t} \] The original equation in Tao's pdf file is : $\gamma _{i}i_{t}=c_{i}+\gamma _{i}\rho _{i}i_{t-1}-\gamma _{i}\left( 1-\rho _{i}\right) \left( \gamma _{y}y_{t}+\gamma _{\pi }\pi _{t}\right) +\varepsilon _{i,t}$. I think the minus is a typo \subsection{Some important points} \begin{itemize} \item This example is simple \item It is backward looking \item Risk does not matter \item estimation is faster... at least provided that we do not spend time computing the steady state below \item If the parameters switch, there are potentially multiple steady states, which RISE easily handles both for backward looking models, like this one, and for more general forward-looking models. \item one potential issue is how to set bounds on non-structural parameters \item This shows how RISE\ is flexible: One can easily set up an estimation of such a model with sign restrictions. \item It makes more sense to estimate SVARs in this way, rather than thinking that letting the parameters wander where they want will reveal some important economic insights: NO, NO and NO!!! \end{itemize} \section{The steady state} \[ y_{t}=\frac{c_{y}-\frac{\beta _{r}c_{i}}{\gamma _{i}\left( 1-\rho _{i}\right) }-\frac{\beta _{r}\left( \gamma _{\pi }-1\right) c_{\pi }}{% \alpha _{\pi }-\alpha _{\pi ,1}-\alpha _{\pi ,2}}}{\beta _{y}-\beta _{y,1}-\beta _{y,2}+\beta _{r}\gamma _{y}+\frac{\beta _{r}\left( \gamma _{\pi }-1\right) \alpha _{y}}{\alpha _{\pi }-\alpha _{\pi ,1}-\alpha _{\pi ,2}}} \] \[ \pi _{t}=\frac{c_{\pi }}{\alpha _{\pi }-\alpha _{\pi ,1}-\alpha _{\pi ,2}}+% \frac{\alpha _{y}}{\alpha _{\pi }-\alpha _{\pi ,1}-\alpha _{\pi ,2}}y_{t} \] \[ i_{t}=\frac{c_{i}}{\gamma _{i}\left( 1-\rho _{i}\right) }+\gamma _{y}y_{t}+\gamma _{\pi }\pi _{t} \] \end{document}
(* Title: HOL/Auth/n_germanSymIndex_lemma_on_inv__22.thy Author: Yongjian Li and Kaiqiang Duan, State Key Lab of Computer Science, Institute of Software, Chinese Academy of Sciences Copyright 2016 State Key Lab of Computer Science, Institute of Software, Chinese Academy of Sciences *) header{*The n_germanSymIndex Protocol Case Study*} theory n_germanSymIndex_lemma_on_inv__22 imports n_germanSymIndex_base begin section{*All lemmas on causal relation between inv__22 and some rule r*} lemma n_SendInv__part__0Vsinv__22: assumes a1: "(\<exists> i. i\<le>N\<and>r=n_SendInv__part__0 i)" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__22 p__Inv2)" shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s") proof - from a1 obtain i where a1:"i\<le>N\<and>r=n_SendInv__part__0 i" apply fastforce done from a2 obtain p__Inv2 where a2:"p__Inv2\<le>N\<and>f=inv__22 p__Inv2" apply fastforce done have "(i=p__Inv2)\<or>(i~=p__Inv2)" apply (cut_tac a1 a2, auto) done moreover { assume b1: "(i=p__Inv2)" have "?P1 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } moreover { assume b1: "(i~=p__Inv2)" have "?P2 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } ultimately show "invHoldForRule s f r (invariants N)" by satx qed lemma n_SendInv__part__1Vsinv__22: assumes a1: "(\<exists> i. i\<le>N\<and>r=n_SendInv__part__1 i)" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__22 p__Inv2)" shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s") proof - from a1 obtain i where a1:"i\<le>N\<and>r=n_SendInv__part__1 i" apply fastforce done from a2 obtain p__Inv2 where a2:"p__Inv2\<le>N\<and>f=inv__22 p__Inv2" apply fastforce done have "(i=p__Inv2)\<or>(i~=p__Inv2)" apply (cut_tac a1 a2, auto) done moreover { assume b1: "(i=p__Inv2)" have "?P1 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } moreover { assume b1: "(i~=p__Inv2)" have "?P2 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } ultimately show "invHoldForRule s f r (invariants N)" by satx qed lemma n_SendInvAckVsinv__22: assumes a1: "(\<exists> i. i\<le>N\<and>r=n_SendInvAck i)" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__22 p__Inv2)" shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s") proof - from a1 obtain i where a1:"i\<le>N\<and>r=n_SendInvAck i" apply fastforce done from a2 obtain p__Inv2 where a2:"p__Inv2\<le>N\<and>f=inv__22 p__Inv2" apply fastforce done have "(i=p__Inv2)\<or>(i~=p__Inv2)" apply (cut_tac a1 a2, auto) done moreover { assume b1: "(i=p__Inv2)" have "?P1 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } moreover { assume b1: "(i~=p__Inv2)" have "?P2 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } ultimately show "invHoldForRule s f r (invariants N)" by satx qed lemma n_RecvInvAckVsinv__22: assumes a1: "(\<exists> i. i\<le>N\<and>r=n_RecvInvAck i)" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__22 p__Inv2)" shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s") proof - from a1 obtain i where a1:"i\<le>N\<and>r=n_RecvInvAck i" apply fastforce done from a2 obtain p__Inv2 where a2:"p__Inv2\<le>N\<and>f=inv__22 p__Inv2" apply fastforce done have "(i=p__Inv2)\<or>(i~=p__Inv2)" apply (cut_tac a1 a2, auto) done moreover { assume b1: "(i=p__Inv2)" have "?P3 s" apply (cut_tac a1 a2 b1, simp, rule_tac x="(neg (andForm (eqn (IVar (Field (Para (Ident ''Chan2'') p__Inv2) ''Cmd'')) (Const GntS)) (eqn (IVar (Field (Para (Ident ''Chan3'') p__Inv2) ''Cmd'')) (Const InvAck))))" in exI, auto) done then have "invHoldForRule s f r (invariants N)" by auto } moreover { assume b1: "(i~=p__Inv2)" have "?P2 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } ultimately show "invHoldForRule s f r (invariants N)" by satx qed lemma n_SendGntSVsinv__22: assumes a1: "(\<exists> i. i\<le>N\<and>r=n_SendGntS i)" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__22 p__Inv2)" shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s") proof - from a1 obtain i where a1:"i\<le>N\<and>r=n_SendGntS i" apply fastforce done from a2 obtain p__Inv2 where a2:"p__Inv2\<le>N\<and>f=inv__22 p__Inv2" apply fastforce done have "(i=p__Inv2)\<or>(i~=p__Inv2)" apply (cut_tac a1 a2, auto) done moreover { assume b1: "(i=p__Inv2)" have "?P1 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } moreover { assume b1: "(i~=p__Inv2)" have "?P2 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } ultimately show "invHoldForRule s f r (invariants N)" by satx qed lemma n_SendGntEVsinv__22: assumes a1: "(\<exists> i. i\<le>N\<and>r=n_SendGntE N i)" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__22 p__Inv2)" shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s") proof - from a1 obtain i where a1:"i\<le>N\<and>r=n_SendGntE N i" apply fastforce done from a2 obtain p__Inv2 where a2:"p__Inv2\<le>N\<and>f=inv__22 p__Inv2" apply fastforce done have "(i=p__Inv2)\<or>(i~=p__Inv2)" apply (cut_tac a1 a2, auto) done moreover { assume b1: "(i=p__Inv2)" have "?P1 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } moreover { assume b1: "(i~=p__Inv2)" have "?P2 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } ultimately show "invHoldForRule s f r (invariants N)" by satx qed lemma n_RecvGntSVsinv__22: assumes a1: "(\<exists> i. i\<le>N\<and>r=n_RecvGntS i)" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__22 p__Inv2)" shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s") proof - from a1 obtain i where a1:"i\<le>N\<and>r=n_RecvGntS i" apply fastforce done from a2 obtain p__Inv2 where a2:"p__Inv2\<le>N\<and>f=inv__22 p__Inv2" apply fastforce done have "(i=p__Inv2)\<or>(i~=p__Inv2)" apply (cut_tac a1 a2, auto) done moreover { assume b1: "(i=p__Inv2)" have "?P1 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } moreover { assume b1: "(i~=p__Inv2)" have "?P2 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } ultimately show "invHoldForRule s f r (invariants N)" by satx qed lemma n_RecvGntEVsinv__22: assumes a1: "(\<exists> i. i\<le>N\<and>r=n_RecvGntE i)" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__22 p__Inv2)" shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s") proof - from a1 obtain i where a1:"i\<le>N\<and>r=n_RecvGntE i" apply fastforce done from a2 obtain p__Inv2 where a2:"p__Inv2\<le>N\<and>f=inv__22 p__Inv2" apply fastforce done have "(i=p__Inv2)\<or>(i~=p__Inv2)" apply (cut_tac a1 a2, auto) done moreover { assume b1: "(i=p__Inv2)" have "?P1 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } moreover { assume b1: "(i~=p__Inv2)" have "?P2 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } ultimately show "invHoldForRule s f r (invariants N)" by satx qed lemma n_SendReqE__part__1Vsinv__22: assumes a1: "\<exists> i. i\<le>N\<and>r=n_SendReqE__part__1 i" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__22 p__Inv2)" shows "invHoldForRule s f r (invariants N)" apply (rule noEffectOnRule, cut_tac a1 a2, auto) done lemma n_StoreVsinv__22: assumes a1: "\<exists> i d. i\<le>N\<and>d\<le>N\<and>r=n_Store i d" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__22 p__Inv2)" shows "invHoldForRule s f r (invariants N)" apply (rule noEffectOnRule, cut_tac a1 a2, auto) done lemma n_RecvReqEVsinv__22: assumes a1: "\<exists> i. i\<le>N\<and>r=n_RecvReqE N i" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__22 p__Inv2)" shows "invHoldForRule s f r (invariants N)" apply (rule noEffectOnRule, cut_tac a1 a2, auto) done lemma n_SendReqE__part__0Vsinv__22: assumes a1: "\<exists> i. i\<le>N\<and>r=n_SendReqE__part__0 i" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__22 p__Inv2)" shows "invHoldForRule s f r (invariants N)" apply (rule noEffectOnRule, cut_tac a1 a2, auto) done lemma n_SendReqSVsinv__22: assumes a1: "\<exists> i. i\<le>N\<and>r=n_SendReqS i" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__22 p__Inv2)" shows "invHoldForRule s f r (invariants N)" apply (rule noEffectOnRule, cut_tac a1 a2, auto) done lemma n_RecvReqSVsinv__22: assumes a1: "\<exists> i. i\<le>N\<and>r=n_RecvReqS N i" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__22 p__Inv2)" shows "invHoldForRule s f r (invariants N)" apply (rule noEffectOnRule, cut_tac a1 a2, auto) done end
Formal statement is: lemma sigma_finite_measure_count_space: fixes A :: "'a::countable set" shows "sigma_finite_measure (count_space A)" Informal statement is: The counting measure on a countable set is sigma-finite.
import algebra.field tactic.ext open list universes u v variables (K : Type u) [field K] [inhabited K] {α : Type v} [has_add α] (x y : K) (xl yl : list K) /-- addition function on `list α`, where `α` has an addition function -/ @[ext] def ladd : list α → list α → list α := zip_with has_add.add /- The following theorems are stolen from data.list.zip and adapted for the zip_with function, which is more generic than the zip function the lemmata were initially used for. These lemmata are used in the file aff_coord_space to prove statements necessary to show aff_vec_coord_tuple is a vector space. -/ /-- addition is compatible with list constructor -/ @[simp] theorem add_cons_cons (a b : α) (l₁ l₂ : list α) : ladd (a :: l₁) (b :: l₂) = (a + b) :: ladd l₁ l₂ := rfl /-- adding the empty list to a list gives you the empty list -/ @[simp] theorem add_nil_left (l : list α) : ladd ([] : list α) l = [] := rfl /-- adding a list to the empty list gives you the empty list -/ @[simp] theorem add_nil_right (l : list α) : ladd l ([] : list α) = [] := by cases l; refl /-- The length of the sum of two lists is the length of the shorter list -/ @[simp] theorem length_sum : ∀ (l₁ : list α) (l₂ : list α), length (ladd l₁ l₂) = min (length l₁) (length l₂) | [] l₂ := rfl | l₁ [] := by simp -- TODO: figure out which simp lemmata are being used, and use "simp only" | (a::l₁) (b::l₂) := --by simp only [length, add_cons_cons, length_sum l₁ l₂, min_succ_succ] begin simp only [length, add_cons_cons, length_sum l₁ l₂], exact ((length l₁).min_succ_succ (length l₂)).symm, end /-- the length of nil is 0 -/ lemma len_nil : length ([] : list α) = 0 := rfl lemma len_cons : length (x :: xl) = length xl + 1 := rfl /-- Implements list addition coordinate-wise w.r.t. the addition function on the list entries. -/ instance (α : Type*) [has_add α] : has_add (list α) := ⟨ladd⟩ -- TODO: rename this lemma. It's actually important lemma sum_test : ∀ a b : list K, a + b = ladd a b := by {intros, refl} lemma sum_test' : ∀ a b : list K, a + b = (zip_with has_add.add) a b := by {intros, refl} /-- returns list rep of 0 vector of given length. -/ def list.field_zero : ℕ → list K | 0 := [0] | (nat.succ n) := 0 :: (list.field_zero n) /-- returns a list multiplied element-wise by a scalar. -/ def list.field_scalar : K → list K → list K | x [] := [] | x (a :: l) := (x * a) :: (list.field_scalar x l) lemma scalar_nil : list.field_scalar K x [] = [] := rfl lemma scalar_cons : list.field_scalar K y (x :: xl) = (y * x) :: (list.field_scalar K y xl) := rfl lemma scale_len : length (list.field_scalar K x xl) = length xl := begin induction xl, rw scalar_nil, simp only [scalar_cons, len_cons, xl_ih], end lemma list.one_smul_cons : list.field_scalar K 1 xl = xl := begin induction xl, refl, rw [scalar_cons, one_mul, xl_ih], end lemma list.smul_assoc : list.field_scalar K (x*y) xl = list.field_scalar K x (list.field_scalar K y xl) := begin induction xl, refl, simp only [scalar_cons], split, rw mul_assoc, exact xl_ih, end lemma list.smul_zero : ∀ n : ℕ, list.field_scalar K x (list.field_zero K n) = list.field_zero K n := begin intros, induction n with n', { have zero_is : list.field_zero K 0 = [0] := rfl, have mul_zero : x * 0 = 0 := by apply mul_zero, rw [zero_is, scalar_cons, mul_zero, scalar_nil] }, { have field_zero_succ : list.field_zero K n'.succ = 0 :: list.field_zero K n' := rfl, have mul_zero : x * 0 = 0 := by apply mul_zero, rw [field_zero_succ, scalar_cons, mul_zero, n_ih] } end lemma list.zero_smul : xl ≠ nil → list.field_scalar K 0 xl = list.field_zero K (length xl - 1) := begin intro h, induction xl, {contradiction}, { induction xl_tl, { have zero_is : list.field_zero K ([xl_hd].length - 1) = [0] := rfl, have zero_mul : 0 * xl_hd = 0 := by apply zero_mul, rw [zero_is, scalar_cons, scalar_nil, zero_mul] }, { have zero_mul : 0 * xl_hd = 0 := by apply zero_mul, have non_nil : xl_tl_hd :: xl_tl_tl ≠ nil := by contradiction, rw [scalar_cons, zero_mul, xl_ih non_nil], refl } } end --below are functions. TODO: remove 2 of the neg functions def field_neg : K → K := λ a, -a def list.neg : list K → list K := map (field_neg K) def list.neg' : list K → list K := λ x, list.field_scalar K (-1 : K) x def list.neg'' : list K → list K | [] := [] | (x :: xl) := (-x) :: list.neg'' xl lemma neg_cons : list.neg K (x :: xl) = (-x) :: list.neg K xl := rfl lemma neg_nil_nil : list.neg K nil = nil := rfl lemma len_succ : ∀ a : α, ∀ al : list α, length (a :: al) = length al + 1 := by intros; refl @[simp] theorem list.len_neg : length (list.neg K xl) = length xl := begin induction xl, { rw neg_nil_nil }, { have t : list.neg K (xl_hd :: xl_tl) = (-xl_hd :: list.neg K xl_tl) := rfl, simp only [t, len_succ, xl_ih], }, end lemma field_zero_sep : ∀ n : ℕ, n ≠ 0 → list.field_zero K n = 0 :: list.field_zero K (n - 1) := begin intros n h, induction n with n', {contradiction}, {refl} end -- Lemmas concerning addition lemma list.ladd_is : ∀ x y : list K, ladd x y = x + y := by {intros, refl} lemma nil_add : ∀ x : list K, nil + x = nil := by {intros, refl} lemma add_nil : ∀ x : list K, x + nil = nil := by {intros, induction x, refl, refl} lemma list.add_assoc : ∀ x y z : list K, (x + y) + z = x + (y + z) := begin intros x y z, cases x, refl, cases y, refl, cases z, refl, sorry, end lemma list.zero_add : ∀ x : list K, (list.field_zero K (length x - 1)) + x = x := begin intro x, induction x, {refl}, { have tl_len : length (x_hd :: x_tl) - 1 = length x_tl := rfl, rw tl_len, induction x_tl, { have field_zero_zero : list.field_zero K 0 = [0] := rfl, have add_list : [0] + [x_hd] = [0 + x_hd] := rfl, rw [len_nil, field_zero_zero, add_list, zero_add] }, { have zero_tl : list.field_zero K (length (x_tl_hd :: x_tl_tl)) = 0 :: list.field_zero K (length x_tl_tl) := begin have len_x : length (x_tl_hd :: x_tl_tl) ≠ 0 := begin intro h, have len_x' : length (x_tl_hd :: x_tl_tl) = length x_tl_tl + 1 := rfl, contradiction end, apply field_zero_sep, exact len_x end, have sep_head : 0 :: list.field_zero K (length x_tl_tl) + x_hd :: (x_tl_hd :: x_tl_tl) = (0 + x_hd) :: (list.field_zero K (length x_tl_tl) + (x_tl_hd :: x_tl_tl)) := rfl, have head_add : 0 + x_hd = x_hd := by rw zero_add, have len_x_tl : length x_tl_tl = length (x_tl_hd :: x_tl_tl) - 1 := rfl, rw [zero_tl, sep_head, head_add, len_x_tl, x_ih] } } end lemma list.zero_add' : ∀ x : list K, ∀ n : ℕ, length x = n + 1 → (list.field_zero K n) + x = x := begin intros x n x_len, induction x, contradiction, have tl_l : length (x_hd :: x_tl) - 1 = length x_tl := rfl, have tl_len : length x_tl = n := nat.succ.inj x_len, rw (eq.symm tl_len), rw (eq.symm tl_l), apply list.zero_add, end -- TODO: clean up this lemma lemma list.add_zero : ∀ x : list K, x + (list.field_zero K (length x - 1)) = x := begin intro x, induction x, {refl}, { have tl_len : length (x_hd :: x_tl) - 1 = length x_tl := rfl, rw tl_len, induction x_tl, { have field_zero_zero : list.field_zero K 0 = [0] := rfl, have add_list : [x_hd] + [0] = [x_hd + 0] := rfl, rw [len_nil, field_zero_zero, add_list, add_zero] }, { have zero_tl : list.field_zero K (length (x_tl_hd :: x_tl_tl)) = 0 :: list.field_zero K (length (x_tl_hd :: x_tl_tl) - 1) := begin have len_x : length (x_tl_hd :: x_tl_tl) ≠ 0 := begin intro h, have len_x' : length (x_tl_hd :: x_tl_tl) = length x_tl_tl + 1 := rfl, contradiction end, apply field_zero_sep, exact len_x end, have sep_head : x_hd :: (x_tl_hd :: x_tl_tl) + 0 :: list.field_zero K (length (x_tl_hd :: x_tl_tl) - 1) = (x_hd + 0) :: ((x_tl_hd :: x_tl_tl) + list.field_zero K (length (x_tl_hd :: x_tl_tl) - 1)) := rfl, have head_add : x_hd + 0 = x_hd := by rw add_zero, rw [zero_tl, sep_head, head_add, x_ih] } } end lemma list.add_zero' : ∀ x : list K, ∀ n : ℕ, length x = n + 1 → x + (list.field_zero K n) = x := begin intros x n x_len, induction x, contradiction, have tl_l : length (x_hd :: x_tl) - 1 = length x_tl := rfl, have tl_len : length x_tl = n := nat.succ.inj x_len, rw (eq.symm tl_len), rw (eq.symm tl_l), apply list.add_zero, end lemma list.add_left_neg : ∀ x : list K, x ≠ [] → list.neg K x + x = list.field_zero K ((length x) - 1) := begin intros x x_h, induction x, /- This theorem won't work if x = [] -x + x = -[] + [] = [] length x - 1 = 0 - 1 = 0 (because 0 is a ℕ) list.field_zero K 0 = [0] [] ≠ [0] -/ {contradiction}, { induction x_tl, { have neg_x : list.neg K [x_hd] = [-x_hd] := rfl, have list_sum : [-x_hd] + [x_hd] = [-x_hd + x_hd] := rfl, have x_hd_sum : -x_hd + x_hd = 0 := by apply add_left_neg, have zero_is : list.field_zero K (length [x_hd] - 1) = [0] := rfl, rw [neg_x, list_sum, x_hd_sum, zero_is] }, { have neg_x : list.neg K (x_hd :: x_tl_hd :: x_tl_tl) = (-x_hd) :: (list.neg K (x_tl_hd :: x_tl_tl)) := rfl, have list_sum : -x_hd :: list.neg K (x_tl_hd :: x_tl_tl) + x_hd :: x_tl_hd :: x_tl_tl = (-x_hd + x_hd) :: (list.neg K (x_tl_hd :: x_tl_tl) + x_tl_hd :: x_tl_tl) := rfl, have x_hd_sum : -x_hd + x_hd = 0 := by apply add_left_neg, have x_tl_sum : list.neg K (x_tl_hd :: x_tl_tl) + x_tl_hd :: x_tl_tl = list.field_zero K (length (x_tl_hd :: x_tl_tl) - 1) := begin apply x_ih, contradiction end, have zero_is : list.field_zero K (length (x_hd :: x_tl_hd :: x_tl_tl) - 1) = 0 :: list.field_zero K (length (x_hd :: x_tl_tl) - 1) := rfl, rw [neg_x, list_sum, x_hd_sum, x_tl_sum, zero_is], refl } } end lemma head_cons_add : ∀ a : K, ∀ x y : list K, a :: x + y = a :: (x + y) := sorry lemma list.add_comm : ∀ x y : list K, x + y = y + x := begin intros x y, cases x, dsimp only [has_add.add], rw [add_nil_left, add_nil_right], sorry, end lemma list.add_trans : ∀ a b : list K, length a = length b → ∃ x : list K, x + a = b := begin intros a b h, induction a, { apply exists.intro, { have b_nil : b = nil := by {cases b, refl, contradiction}, rw [b_nil, add_nil] }, {exact nil} }, { apply exists.intro, { induction b, {contradiction}, {sorry} }, {exact b + list.neg K (a_hd :: a_tl)} } end lemma list.aff_add_trans : ∀ a b : list K, (length a = length b) ∧ (a.head = (1 : K)) ∧ (b.head = (1 : K)) → ∃ x : list K, (x + a = b ∧ x.head = (0 : K)) := begin sorry end lemma list.add_free : ∀ a g h : list K, length g = length a → length h = length a → g + a = h + a → g = h := begin intros a g h g_len_a h_len_a sum_h, cases a, { have g_nil : g = nil := by {cases g, refl, contradiction}, have h_nil : h = nil := by {cases h, refl, contradiction}, rw [g_nil, h_nil] }, { have g_neg_cancel : g = g + (a_hd :: a_tl) + list.neg K (a_hd :: a_tl) := begin have a_na_zero : (a_hd :: a_tl) + list.neg K (a_hd :: a_tl) = list.field_zero K ((length (a_hd :: a_tl)) - 1) := begin transitivity, {apply list.add_comm}, { apply list.add_left_neg, have a_not_nil : (a_hd :: a_tl) ≠ nil := by contradiction, apply a_not_nil } end, rw [list.add_assoc, a_na_zero], rw [eq.symm g_len_a], symmetry, apply list.add_zero end, have h_neg_cancel : h = h + (a_hd :: a_tl) + list.neg K (a_hd :: a_tl) := begin have a_na_zero : (a_hd :: a_tl) + list.neg K (a_hd :: a_tl) = list.field_zero K ((length (a_hd :: a_tl)) - 1) := begin transitivity, {apply list.add_comm}, { apply list.add_left_neg, have a_not_nil : (a_hd :: a_tl) ≠ nil := by contradiction, apply a_not_nil } end, rw [list.add_assoc, a_na_zero], rw [eq.symm h_len_a], symmetry, apply list.add_zero end, rw [g_neg_cancel, h_neg_cancel, sum_h] } end -- Lemmas that involve addition and scalar multiplication lemma list.smul_add : ∀ g : K, ∀ x y : list K, list.field_scalar K g (x + y) = (list.field_scalar K g x) + (list.field_scalar K g y) := begin intros, induction x, { rw [nil_add, scalar_nil, nil_add] }, { induction y, {rw [scalar_nil, add_nil, add_nil, scalar_nil]}, { repeat {rw scalar_cons}, have add_xy : x_hd :: x_tl + y_hd :: y_tl = (x_hd + y_hd) :: (x_tl + y_tl) := rfl, have scalar_is : g * x_hd :: list.field_scalar K g x_tl + g * y_hd :: list.field_scalar K g y_tl = (g * x_hd + g * y_hd) :: (list.field_scalar K g x_tl + list.field_scalar K g y_tl) := rfl, have head_distrib : g * x_hd + g * y_hd = g * (x_hd + y_hd) := by {symmetry, apply left_distrib}, have tail_distrib : list.field_scalar K g x_tl + list.field_scalar K g y_tl = list.field_scalar K g (x_tl + y_tl) := sorry, rw [add_xy, scalar_cons, scalar_is, head_distrib, tail_distrib] } } end lemma list.add_smul : ∀ g h : K, ∀ x : list K, list.field_scalar K (g + h) x = (list.field_scalar K g x) + (list.field_scalar K h x) := begin intros, induction x, { rw [scalar_nil, scalar_nil, scalar_nil], refl }, { have sum_is : g * x_hd :: list.field_scalar K g x_tl + h * x_hd :: list.field_scalar K h x_tl = (g * x_hd + h * x_hd) :: (list.field_scalar K g x_tl + list.field_scalar K h x_tl) := rfl, have head_distrib : g * x_hd + h * x_hd = (g + h) * x_hd := by {symmetry, apply right_distrib}, rw [scalar_cons, scalar_cons, scalar_cons, sum_is, head_distrib, x_ih] } end
I’m trying to think thorough certain aspects of migrating my .pst files from Outlook 2003 to Outlook 2013 before actually attempting the migration. If I start Outlook 2013 before I have created an email account and I decline any invitation to create an email account, will I still be able to set my AutoArchive preferences and set Outlook 2013 to work offline? Or must I create an email account before I do either of these? If I must create an email account before I can set my AutoArchive preferences and set Outlook 2013 to work offline, I need advice on how to achieve these tasks before allowing Outlook 2013 to access my saved .pst files and download additional emails from my mail server. With Outlook 2003, I was able to prevent the download of emails from my mail server by disabling my Internet connection. But I am not sure I can do this with a newly installed click-to-run Outlook 2013. I don’t know whether I would be inhibiting any necessary streaming. You can cut the internet connection, but I'd probably wait an hour or two before doing this, so that you are sure outlook is completely streamed. It doesn't matter which order you create the account but its usually easier/better if you create the account before opening Outlook, especially if you are using an existing pst. In most/some cases, Outlook will be able to use the mailbox manager file created by the older version of Outlook and it won't redownload existing mail. If you are upgrading on the same computer it will use a copy of the outlook 2003 profile. Another option is to create the account using a new pst, let the stuff download then add the old pst and set it as the default. You didn’t state explicitly that I would not be able to set my AutoArchive preferences and set Outlook 2013 to work offline until I have created an email account. But, I will assume it is true unless I am corrected. I don’t know what the default AutoArchive settings are in Outlook 2013, but I didn’t want Outlook 2013 to start auto-archiving emails in my saved Outlook.pst file as soon as I started Outlook 2013 for the first time. And I like to be prompted before allowing AutoArchive to proceed. And I wasn’t really concerned about existing emails being re-downloaded. On my mail server, an email is removed from the server Inbox as soon as it is downloaded to my PC, so there is no danger of it being re-downloaded (I use POP3/SMTP, not IMAP). What I don’t want is any new emails to be downloaded before I am ready to receive them. Hence the reason for wanting to work offline initially. In order to avoid any potential problems in migrating from Outlook 2003 to Outlook 2013, I was actually planning to start from a completely “clean sheet”. So I was intending to back up my .pst and nickname files, delete my email account and email profile, and uninstall Office 2003 before installing Office 2013. So, when I start Outlook 2013 for the first time, a new email profile will be created. Considering all my requirements, it sounds as though my best strategy would be to store my backed-up .pst files in a location where Outlook 2013 won’t look for them and disable my Internet connection before I start Outlook 2013 for the first time. I can then proceed to create a new email profile and a new email account with a new “empty” .pst file. This will give me the chance to set my AutoArchive preferences and set Outlook 2013 to work offline. Then, having exited Outlook 2013, I can use the Mail applet in the Control Panel to specify the location of my backed-up .pst files before entering Outlook 2013 again. Will this strategy work? You say “You can cut the Internet connection, but I'd probably wait an hour or two before doing this …”. Can I ask after what event should I wait an hour or two? After installing Office 2013? I have no idea how click-to-run streaming works and I can find no information about how it works. Under what circumstances will Outlook 2013 code be streamed to my PC? Will it be streamed if I leave my PC on, but unattended, for an hour or two with Outlook 2013 having never been started? Or is the code only ever streamed if Outlook 2013 is in a started state, or has been started at least once? If either of the latter possibilities, then I have a real problem if I want to start Outlook 2013 for the first time with my Internet connection disabled! Cutting the internet: the click to run installation will stream the apps in the background but you can begin using the apps before they are fully downloaded and installed. You need to give it some time to insure everything is downloaded before you go offline. On some of my installs i received alerts that said it was done and i could go offline, other times i did not. Your strategy sounds perfect and yes, it will work. I did eventually install Office 2013 with Outlook. However, I decided in the end that it might be simpler to install from the backup DVD with my Internet connection disabled. It all worked well. However, I had a nervous three days following installation waiting for Office 2013 to be updated. The backup DVD contains only RTM level code and I had expected an update to the current level to be sooner. I tried disabling updates and then enabling them, but that appeared to have no effect. Anyway, eventually it did update. Thank you once again for the support. Glad to hear it worked out for you. The updates are usually checked / installed at 3 AM, so there should be a delay if you don't check for updates manfully. I usually have to check 3 -4 times before everything is installed - the update system works on its own schedule. Cannot access query builder in Outlook 2007? When I expand query builder, why are the search fields grayed out?
[GOAL] x : ℝ hx : 0 ≤ x y : ℝ z : ℂ ⊢ ↑x ^ (↑y * z) = ↑(x ^ y) ^ z [PROOFSTEP] rw [cpow_mul, ofReal_cpow hx] [GOAL] case h₁ x : ℝ hx : 0 ≤ x y : ℝ z : ℂ ⊢ -Real.pi < (log ↑x * ↑y).im [PROOFSTEP] rw [← ofReal_log hx, ← ofReal_mul, ofReal_im, neg_lt_zero] [GOAL] case h₁ x : ℝ hx : 0 ≤ x y : ℝ z : ℂ ⊢ 0 < Real.pi [PROOFSTEP] exact Real.pi_pos [GOAL] case h₂ x : ℝ hx : 0 ≤ x y : ℝ z : ℂ ⊢ (log ↑x * ↑y).im ≤ Real.pi [PROOFSTEP] rw [← ofReal_log hx, ← ofReal_mul, ofReal_im] [GOAL] case h₂ x : ℝ hx : 0 ≤ x y : ℝ z : ℂ ⊢ 0 ≤ Real.pi [PROOFSTEP] exact Real.pi_pos.le [GOAL] E : Type u_1 inst✝⁴ : NormedAddCommGroup E inst✝³ : NormedSpace ℂ E f : ℝ → E s : ℂ hf : MellinConvergent f s 𝕜 : Type u_2 inst✝² : NontriviallyNormedField 𝕜 inst✝¹ : NormedSpace 𝕜 E inst✝ : SMulCommClass ℂ 𝕜 E c : 𝕜 ⊢ MellinConvergent (fun t => c • f t) s [PROOFSTEP] simpa only [MellinConvergent, smul_comm] using hf.smul c [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℂ E f : ℝ → E s a : ℂ ⊢ MellinConvergent (fun t => ↑t ^ a • f t) s ↔ MellinConvergent f (s + a) [PROOFSTEP] refine' integrableOn_congr_fun (fun t ht => _) measurableSet_Ioi [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℂ E f : ℝ → E s a : ℂ t : ℝ ht : t ∈ Ioi 0 ⊢ ↑t ^ (s - 1) • (fun t => ↑t ^ a • f t) t = ↑t ^ (s + a - 1) • f t [PROOFSTEP] simp_rw [← sub_add_eq_add_sub, cpow_add _ _ (ofReal_ne_zero.2 <| ne_of_gt ht), mul_smul] [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℂ E f : ℝ → ℂ s : ℂ hf : MellinConvergent f s a : ℂ ⊢ MellinConvergent (fun t => f t / a) s [PROOFSTEP] simpa only [MellinConvergent, smul_eq_mul, ← mul_div_assoc] using hf.div_const a [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℂ E f : ℝ → E s : ℂ a : ℝ ha : 0 < a ⊢ MellinConvergent (fun t => f (a * t)) s ↔ MellinConvergent f s [PROOFSTEP] have := integrableOn_Ioi_comp_mul_left_iff (fun t : ℝ => (t : ℂ) ^ (s - 1) • f t) 0 ha [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℂ E f : ℝ → E s : ℂ a : ℝ ha : 0 < a this : IntegrableOn (fun x => (fun t => ↑t ^ (s - 1) • f t) (a * x)) (Ioi 0) ↔ IntegrableOn (fun t => ↑t ^ (s - 1) • f t) (Ioi (a * 0)) ⊢ MellinConvergent (fun t => f (a * t)) s ↔ MellinConvergent f s [PROOFSTEP] rw [mul_zero] at this [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℂ E f : ℝ → E s : ℂ a : ℝ ha : 0 < a this : IntegrableOn (fun x => (fun t => ↑t ^ (s - 1) • f t) (a * x)) (Ioi 0) ↔ IntegrableOn (fun t => ↑t ^ (s - 1) • f t) (Ioi 0) ⊢ MellinConvergent (fun t => f (a * t)) s ↔ MellinConvergent f s [PROOFSTEP] have h1 : EqOn (fun t : ℝ => (↑(a * t) : ℂ) ^ (s - 1) • f (a * t)) ((a : ℂ) ^ (s - 1) • fun t : ℝ => (t : ℂ) ^ (s - 1) • f (a * t)) (Ioi 0) := fun t ht ↦ by simp only [ofReal_mul, mul_cpow_ofReal_nonneg ha.le (le_of_lt ht), mul_smul, Pi.smul_apply] [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℂ E f : ℝ → E s : ℂ a : ℝ ha : 0 < a this : IntegrableOn (fun x => (fun t => ↑t ^ (s - 1) • f t) (a * x)) (Ioi 0) ↔ IntegrableOn (fun t => ↑t ^ (s - 1) • f t) (Ioi 0) t : ℝ ht : t ∈ Ioi 0 ⊢ (fun t => ↑(a * t) ^ (s - 1) • f (a * t)) t = (↑a ^ (s - 1) • fun t => ↑t ^ (s - 1) • f (a * t)) t [PROOFSTEP] simp only [ofReal_mul, mul_cpow_ofReal_nonneg ha.le (le_of_lt ht), mul_smul, Pi.smul_apply] [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℂ E f : ℝ → E s : ℂ a : ℝ ha : 0 < a this : IntegrableOn (fun x => (fun t => ↑t ^ (s - 1) • f t) (a * x)) (Ioi 0) ↔ IntegrableOn (fun t => ↑t ^ (s - 1) • f t) (Ioi 0) h1 : EqOn (fun t => ↑(a * t) ^ (s - 1) • f (a * t)) (↑a ^ (s - 1) • fun t => ↑t ^ (s - 1) • f (a * t)) (Ioi 0) ⊢ MellinConvergent (fun t => f (a * t)) s ↔ MellinConvergent f s [PROOFSTEP] have h2 : (a : ℂ) ^ (s - 1) ≠ 0 := by rw [Ne.def, cpow_eq_zero_iff, not_and_or, ofReal_eq_zero] exact Or.inl ha.ne' [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℂ E f : ℝ → E s : ℂ a : ℝ ha : 0 < a this : IntegrableOn (fun x => (fun t => ↑t ^ (s - 1) • f t) (a * x)) (Ioi 0) ↔ IntegrableOn (fun t => ↑t ^ (s - 1) • f t) (Ioi 0) h1 : EqOn (fun t => ↑(a * t) ^ (s - 1) • f (a * t)) (↑a ^ (s - 1) • fun t => ↑t ^ (s - 1) • f (a * t)) (Ioi 0) ⊢ ↑a ^ (s - 1) ≠ 0 [PROOFSTEP] rw [Ne.def, cpow_eq_zero_iff, not_and_or, ofReal_eq_zero] [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℂ E f : ℝ → E s : ℂ a : ℝ ha : 0 < a this : IntegrableOn (fun x => (fun t => ↑t ^ (s - 1) • f t) (a * x)) (Ioi 0) ↔ IntegrableOn (fun t => ↑t ^ (s - 1) • f t) (Ioi 0) h1 : EqOn (fun t => ↑(a * t) ^ (s - 1) • f (a * t)) (↑a ^ (s - 1) • fun t => ↑t ^ (s - 1) • f (a * t)) (Ioi 0) ⊢ ¬a = 0 ∨ ¬s - 1 ≠ 0 [PROOFSTEP] exact Or.inl ha.ne' [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℂ E f : ℝ → E s : ℂ a : ℝ ha : 0 < a this : IntegrableOn (fun x => (fun t => ↑t ^ (s - 1) • f t) (a * x)) (Ioi 0) ↔ IntegrableOn (fun t => ↑t ^ (s - 1) • f t) (Ioi 0) h1 : EqOn (fun t => ↑(a * t) ^ (s - 1) • f (a * t)) (↑a ^ (s - 1) • fun t => ↑t ^ (s - 1) • f (a * t)) (Ioi 0) h2 : ↑a ^ (s - 1) ≠ 0 ⊢ MellinConvergent (fun t => f (a * t)) s ↔ MellinConvergent f s [PROOFSTEP] rw [MellinConvergent, MellinConvergent, ← this, integrableOn_congr_fun h1 measurableSet_Ioi, IntegrableOn, IntegrableOn, integrable_smul_iff h2] [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℂ E f : ℝ → E s : ℂ a : ℝ ha : a ≠ 0 ⊢ MellinConvergent (fun t => f (t ^ a)) s ↔ MellinConvergent f (s / ↑a) [PROOFSTEP] refine Iff.trans ?_ (integrableOn_Ioi_comp_rpow_iff' _ ha) [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℂ E f : ℝ → E s : ℂ a : ℝ ha : a ≠ 0 ⊢ MellinConvergent (fun t => f (t ^ a)) s ↔ IntegrableOn (fun x => x ^ (a - 1) • ↑(x ^ a) ^ (s / ↑a - 1) • f (x ^ a)) (Ioi 0) [PROOFSTEP] rw [MellinConvergent] [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℂ E f : ℝ → E s : ℂ a : ℝ ha : a ≠ 0 ⊢ IntegrableOn (fun t => ↑t ^ (s - 1) • f (t ^ a)) (Ioi 0) ↔ IntegrableOn (fun x => x ^ (a - 1) • ↑(x ^ a) ^ (s / ↑a - 1) • f (x ^ a)) (Ioi 0) [PROOFSTEP] refine' integrableOn_congr_fun (fun t ht => _) measurableSet_Ioi [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℂ E f : ℝ → E s : ℂ a : ℝ ha : a ≠ 0 t : ℝ ht : t ∈ Ioi 0 ⊢ ↑t ^ (s - 1) • f (t ^ a) = t ^ (a - 1) • ↑(t ^ a) ^ (s / ↑a - 1) • f (t ^ a) [PROOFSTEP] dsimp only [Pi.smul_apply] [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℂ E f : ℝ → E s : ℂ a : ℝ ha : a ≠ 0 t : ℝ ht : t ∈ Ioi 0 ⊢ ↑t ^ (s - 1) • f (t ^ a) = t ^ (a - 1) • ↑(t ^ a) ^ (s / ↑a - 1) • f (t ^ a) [PROOFSTEP] rw [← Complex.coe_smul (t ^ (a - 1)), ← mul_smul, ← cpow_mul_ofReal_nonneg (le_of_lt ht), ofReal_cpow (le_of_lt ht), ← cpow_add _ _ (ofReal_ne_zero.mpr (ne_of_gt ht)), ofReal_sub, ofReal_one, mul_sub, mul_div_cancel' _ (ofReal_ne_zero.mpr ha), mul_one, add_comm, ← add_sub_assoc, sub_add_cancel] [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℂ E inst✝ : CompleteSpace E f : ℝ → E s a : ℂ ⊢ mellin (fun t => ↑t ^ a • f t) s = mellin f (s + a) [PROOFSTEP] refine' set_integral_congr measurableSet_Ioi fun t ht => _ [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℂ E inst✝ : CompleteSpace E f : ℝ → E s a : ℂ t : ℝ ht : t ∈ Ioi 0 ⊢ ↑t ^ (s - 1) • (fun t => ↑t ^ a • f t) t = ↑t ^ (s + a - 1) • f t [PROOFSTEP] simp_rw [← sub_add_eq_add_sub, cpow_add _ _ (ofReal_ne_zero.2 <| ne_of_gt ht), mul_smul] [GOAL] E : Type u_1 inst✝⁵ : NormedAddCommGroup E inst✝⁴ : NormedSpace ℂ E inst✝³ : CompleteSpace E f : ℝ → E s : ℂ 𝕜 : Type u_2 inst✝² : NontriviallyNormedField 𝕜 inst✝¹ : NormedSpace 𝕜 E inst✝ : SMulCommClass ℂ 𝕜 E c : 𝕜 ⊢ mellin (fun t => c • f t) s = c • mellin f s [PROOFSTEP] simp only [mellin, smul_comm, integral_smul] [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℂ E inst✝ : CompleteSpace E f : ℝ → ℂ s a : ℂ ⊢ mellin (fun t => f t / a) s = mellin f s / a [PROOFSTEP] simp_rw [mellin, smul_eq_mul, ← mul_div_assoc, integral_div] [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℂ E inst✝ : CompleteSpace E f : ℝ → E s : ℂ a : ℝ ha : a ≠ 0 ⊢ mellin (fun t => f (t ^ a)) s = |a|⁻¹ • mellin f (s / ↑a) [PROOFSTEP] simp_rw [mellin] [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℂ E inst✝ : CompleteSpace E f : ℝ → E s : ℂ a : ℝ ha : a ≠ 0 ⊢ ∫ (t : ℝ) in Ioi 0, ↑t ^ (s - 1) • f (t ^ a) = |a|⁻¹ • ∫ (t : ℝ) in Ioi 0, ↑t ^ (s / ↑a - 1) • f t [PROOFSTEP] conv_rhs => rw [← integral_comp_rpow_Ioi _ ha, ← integral_smul] [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℂ E inst✝ : CompleteSpace E f : ℝ → E s : ℂ a : ℝ ha : a ≠ 0 | |a|⁻¹ • ∫ (t : ℝ) in Ioi 0, ↑t ^ (s / ↑a - 1) • f t [PROOFSTEP] rw [← integral_comp_rpow_Ioi _ ha, ← integral_smul] [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℂ E inst✝ : CompleteSpace E f : ℝ → E s : ℂ a : ℝ ha : a ≠ 0 | |a|⁻¹ • ∫ (t : ℝ) in Ioi 0, ↑t ^ (s / ↑a - 1) • f t [PROOFSTEP] rw [← integral_comp_rpow_Ioi _ ha, ← integral_smul] [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℂ E inst✝ : CompleteSpace E f : ℝ → E s : ℂ a : ℝ ha : a ≠ 0 | |a|⁻¹ • ∫ (t : ℝ) in Ioi 0, ↑t ^ (s / ↑a - 1) • f t [PROOFSTEP] rw [← integral_comp_rpow_Ioi _ ha, ← integral_smul] [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℂ E inst✝ : CompleteSpace E f : ℝ → E s : ℂ a : ℝ ha : a ≠ 0 ⊢ ∫ (t : ℝ) in Ioi 0, ↑t ^ (s - 1) • f (t ^ a) = ∫ (a_1 : ℝ) in Ioi 0, |a|⁻¹ • (|a| * a_1 ^ (a - 1)) • ↑(a_1 ^ a) ^ (s / ↑a - 1) • f (a_1 ^ a) [PROOFSTEP] refine' set_integral_congr measurableSet_Ioi fun t ht => _ [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℂ E inst✝ : CompleteSpace E f : ℝ → E s : ℂ a : ℝ ha : a ≠ 0 t : ℝ ht : t ∈ Ioi 0 ⊢ ↑t ^ (s - 1) • f (t ^ a) = |a|⁻¹ • (|a| * t ^ (a - 1)) • ↑(t ^ a) ^ (s / ↑a - 1) • f (t ^ a) [PROOFSTEP] dsimp only [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℂ E inst✝ : CompleteSpace E f : ℝ → E s : ℂ a : ℝ ha : a ≠ 0 t : ℝ ht : t ∈ Ioi 0 ⊢ ↑t ^ (s - 1) • f (t ^ a) = |a|⁻¹ • (|a| * t ^ (a - 1)) • ↑(t ^ a) ^ (s / ↑a - 1) • f (t ^ a) [PROOFSTEP] rw [← mul_smul, ← mul_assoc, inv_mul_cancel (mt abs_eq_zero.1 ha), one_mul, ← smul_assoc, real_smul] [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℂ E inst✝ : CompleteSpace E f : ℝ → E s : ℂ a : ℝ ha : a ≠ 0 t : ℝ ht : t ∈ Ioi 0 ⊢ ↑t ^ (s - 1) • f (t ^ a) = (↑(t ^ (a - 1)) * ↑(t ^ a) ^ (s / ↑a - 1)) • f (t ^ a) [PROOFSTEP] rw [ofReal_cpow (le_of_lt ht), ← cpow_mul_ofReal_nonneg (le_of_lt ht), ← cpow_add _ _ (ofReal_ne_zero.mpr <| ne_of_gt ht), ofReal_sub, ofReal_one, mul_sub, mul_div_cancel' _ (ofReal_ne_zero.mpr ha), add_comm, ← add_sub_assoc, mul_one, sub_add_cancel] [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℂ E inst✝ : CompleteSpace E f : ℝ → E s : ℂ a : ℝ ha : 0 < a ⊢ mellin (fun t => f (a * t)) s = ↑a ^ (-s) • mellin f s [PROOFSTEP] simp_rw [mellin] [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℂ E inst✝ : CompleteSpace E f : ℝ → E s : ℂ a : ℝ ha : 0 < a ⊢ ∫ (t : ℝ) in Ioi 0, ↑t ^ (s - 1) • f (a * t) = ↑a ^ (-s) • ∫ (t : ℝ) in Ioi 0, ↑t ^ (s - 1) • f t [PROOFSTEP] have : EqOn (fun t : ℝ => (t : ℂ) ^ (s - 1) • f (a * t)) (fun t : ℝ => (a : ℂ) ^ (1 - s) • (fun u : ℝ => (u : ℂ) ^ (s - 1) • f u) (a * t)) (Ioi 0) := fun t ht ↦ by dsimp only rw [ofReal_mul, mul_cpow_ofReal_nonneg ha.le (le_of_lt ht), ← mul_smul, (by ring : 1 - s = -(s - 1)), cpow_neg, inv_mul_cancel_left₀] rw [Ne.def, cpow_eq_zero_iff, ofReal_eq_zero, not_and_or] exact Or.inl ha.ne' [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℂ E inst✝ : CompleteSpace E f : ℝ → E s : ℂ a : ℝ ha : 0 < a t : ℝ ht : t ∈ Ioi 0 ⊢ (fun t => ↑t ^ (s - 1) • f (a * t)) t = (fun t => ↑a ^ (1 - s) • (fun u => ↑u ^ (s - 1) • f u) (a * t)) t [PROOFSTEP] dsimp only [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℂ E inst✝ : CompleteSpace E f : ℝ → E s : ℂ a : ℝ ha : 0 < a t : ℝ ht : t ∈ Ioi 0 ⊢ ↑t ^ (s - 1) • f (a * t) = ↑a ^ (1 - s) • ↑(a * t) ^ (s - 1) • f (a * t) [PROOFSTEP] rw [ofReal_mul, mul_cpow_ofReal_nonneg ha.le (le_of_lt ht), ← mul_smul, (by ring : 1 - s = -(s - 1)), cpow_neg, inv_mul_cancel_left₀] [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℂ E inst✝ : CompleteSpace E f : ℝ → E s : ℂ a : ℝ ha : 0 < a t : ℝ ht : t ∈ Ioi 0 ⊢ 1 - s = -(s - 1) [PROOFSTEP] ring [GOAL] case h E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℂ E inst✝ : CompleteSpace E f : ℝ → E s : ℂ a : ℝ ha : 0 < a t : ℝ ht : t ∈ Ioi 0 ⊢ ↑a ^ (s - 1) ≠ 0 [PROOFSTEP] rw [Ne.def, cpow_eq_zero_iff, ofReal_eq_zero, not_and_or] [GOAL] case h E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℂ E inst✝ : CompleteSpace E f : ℝ → E s : ℂ a : ℝ ha : 0 < a t : ℝ ht : t ∈ Ioi 0 ⊢ ¬a = 0 ∨ ¬s - 1 ≠ 0 [PROOFSTEP] exact Or.inl ha.ne' [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℂ E inst✝ : CompleteSpace E f : ℝ → E s : ℂ a : ℝ ha : 0 < a this : EqOn (fun t => ↑t ^ (s - 1) • f (a * t)) (fun t => ↑a ^ (1 - s) • (fun u => ↑u ^ (s - 1) • f u) (a * t)) (Ioi 0) ⊢ ∫ (t : ℝ) in Ioi 0, ↑t ^ (s - 1) • f (a * t) = ↑a ^ (-s) • ∫ (t : ℝ) in Ioi 0, ↑t ^ (s - 1) • f t [PROOFSTEP] rw [set_integral_congr measurableSet_Ioi this, integral_smul, integral_comp_mul_left_Ioi (fun u ↦ ↑u ^ (s - 1) • f u) _ ha, mul_zero, ← Complex.coe_smul, ← mul_smul, sub_eq_add_neg, cpow_add _ _ (ofReal_ne_zero.mpr ha.ne'), cpow_one, abs_of_pos (inv_pos.mpr ha), ofReal_inv, mul_assoc, mul_comm, inv_mul_cancel_right₀ (ofReal_ne_zero.mpr ha.ne')] [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℂ E inst✝ : CompleteSpace E f : ℝ → E s : ℂ a : ℝ ha : 0 < a ⊢ mellin (fun t => f (t * a)) s = ↑a ^ (-s) • mellin f s [PROOFSTEP] simpa only [mul_comm] using mellin_comp_mul_left f s ha [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℂ E inst✝ : CompleteSpace E f : ℝ → E s : ℂ ⊢ mellin (fun t => f t⁻¹) s = mellin f (-s) [PROOFSTEP] simp_rw [← rpow_neg_one, mellin_comp_rpow _ _ (neg_ne_zero.mpr one_ne_zero), abs_neg, abs_one, inv_one, one_smul, ofReal_neg, ofReal_one, div_neg, div_one] [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℂ E inst✝ : CompleteSpace E f g : ℝ → E s : ℂ hf : MellinConvergent f s hg : MellinConvergent g s ⊢ MellinConvergent (fun t => f t + g t) s [PROOFSTEP] simpa only [MellinConvergent, smul_add] using hf.add hg [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℂ E inst✝ : CompleteSpace E f g : ℝ → E s : ℂ hf : MellinConvergent f s hg : MellinConvergent g s ⊢ mellin (fun t => f t + g t) s = mellin f s + mellin g s [PROOFSTEP] simpa only [mellin, smul_add] using integral_add hf hg [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℂ E inst✝ : CompleteSpace E f g : ℝ → E s : ℂ hf : MellinConvergent f s hg : MellinConvergent g s ⊢ MellinConvergent (fun t => f t - g t) s [PROOFSTEP] simpa only [MellinConvergent, smul_sub] using hf.sub hg [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℂ E inst✝ : CompleteSpace E f g : ℝ → E s : ℂ hf : MellinConvergent f s hg : MellinConvergent g s ⊢ mellin (fun t => f t - g t) s = mellin f s - mellin g s [PROOFSTEP] simpa only [mellin, smul_sub] using integral_sub hf hg [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℂ E f : ℝ → E T : Set ℝ hT : T ⊆ Ioi 0 hT' : MeasurableSet T hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) s : ℂ ⊢ IntegrableOn (fun t => ↑t ^ (s - 1) • f t) T ↔ IntegrableOn (fun t => t ^ (s.re - 1) * ‖f t‖) T [PROOFSTEP] have : AEStronglyMeasurable (fun t : ℝ => (t : ℂ) ^ (s - 1) • f t) (volume.restrict T) := by refine' ((ContinuousAt.continuousOn _).aestronglyMeasurable hT').smul (hfc.mono_set hT) exact fun t ht => continuousAt_ofReal_cpow_const _ _ (Or.inr <| ne_of_gt (hT ht)) [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℂ E f : ℝ → E T : Set ℝ hT : T ⊆ Ioi 0 hT' : MeasurableSet T hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) s : ℂ ⊢ AEStronglyMeasurable (fun t => ↑t ^ (s - 1) • f t) (Measure.restrict volume T) [PROOFSTEP] refine' ((ContinuousAt.continuousOn _).aestronglyMeasurable hT').smul (hfc.mono_set hT) [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℂ E f : ℝ → E T : Set ℝ hT : T ⊆ Ioi 0 hT' : MeasurableSet T hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) s : ℂ ⊢ ∀ (x : ℝ), x ∈ T → ContinuousAt (fun t => ↑t ^ (s - 1)) x [PROOFSTEP] exact fun t ht => continuousAt_ofReal_cpow_const _ _ (Or.inr <| ne_of_gt (hT ht)) [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℂ E f : ℝ → E T : Set ℝ hT : T ⊆ Ioi 0 hT' : MeasurableSet T hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) s : ℂ this : AEStronglyMeasurable (fun t => ↑t ^ (s - 1) • f t) (Measure.restrict volume T) ⊢ IntegrableOn (fun t => ↑t ^ (s - 1) • f t) T ↔ IntegrableOn (fun t => t ^ (s.re - 1) * ‖f t‖) T [PROOFSTEP] rw [IntegrableOn, ← integrable_norm_iff this, ← IntegrableOn] [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℂ E f : ℝ → E T : Set ℝ hT : T ⊆ Ioi 0 hT' : MeasurableSet T hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) s : ℂ this : AEStronglyMeasurable (fun t => ↑t ^ (s - 1) • f t) (Measure.restrict volume T) ⊢ IntegrableOn (fun a => ‖↑a ^ (s - 1) • f a‖) T ↔ IntegrableOn (fun t => t ^ (s.re - 1) * ‖f t‖) T [PROOFSTEP] refine' integrableOn_congr_fun (fun t ht => _) hT' [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℂ E f : ℝ → E T : Set ℝ hT : T ⊆ Ioi 0 hT' : MeasurableSet T hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) s : ℂ this : AEStronglyMeasurable (fun t => ↑t ^ (s - 1) • f t) (Measure.restrict volume T) t : ℝ ht : t ∈ T ⊢ ‖↑t ^ (s - 1) • f t‖ = t ^ (s.re - 1) * ‖f t‖ [PROOFSTEP] simp_rw [norm_smul, Complex.norm_eq_abs, abs_cpow_eq_rpow_re_of_pos (hT ht), sub_re, one_re] [GOAL] E : Type u_1 inst✝ : NormedAddCommGroup E f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) a s : ℝ hf : f =O[atTop] fun x => x ^ (-a) hs : s < a ⊢ ∃ c, 0 < c ∧ IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioi c) [PROOFSTEP] obtain ⟨d, hd'⟩ := hf.isBigOWith [GOAL] case intro E : Type u_1 inst✝ : NormedAddCommGroup E f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) a s : ℝ hf : f =O[atTop] fun x => x ^ (-a) hs : s < a d : ℝ hd' : IsBigOWith d atTop f fun x => x ^ (-a) ⊢ ∃ c, 0 < c ∧ IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioi c) [PROOFSTEP] simp_rw [IsBigOWith, eventually_atTop] at hd' [GOAL] case intro E : Type u_1 inst✝ : NormedAddCommGroup E f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) a s : ℝ hf : f =O[atTop] fun x => x ^ (-a) hs : s < a d : ℝ hd' : ∃ a_1, ∀ (b : ℝ), b ≥ a_1 → ‖f b‖ ≤ d * ‖b ^ (-a)‖ ⊢ ∃ c, 0 < c ∧ IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioi c) [PROOFSTEP] obtain ⟨e, he⟩ := hd' [GOAL] case intro.intro E : Type u_1 inst✝ : NormedAddCommGroup E f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) a s : ℝ hf : f =O[atTop] fun x => x ^ (-a) hs : s < a d e : ℝ he : ∀ (b : ℝ), b ≥ e → ‖f b‖ ≤ d * ‖b ^ (-a)‖ ⊢ ∃ c, 0 < c ∧ IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioi c) [PROOFSTEP] have he' : 0 < max e 1 := zero_lt_one.trans_le (le_max_right _ _) [GOAL] case intro.intro E : Type u_1 inst✝ : NormedAddCommGroup E f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) a s : ℝ hf : f =O[atTop] fun x => x ^ (-a) hs : s < a d e : ℝ he : ∀ (b : ℝ), b ≥ e → ‖f b‖ ≤ d * ‖b ^ (-a)‖ he' : 0 < max e 1 ⊢ ∃ c, 0 < c ∧ IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioi c) [PROOFSTEP] refine' ⟨max e 1, he', _, _⟩ [GOAL] case intro.intro.refine'_1 E : Type u_1 inst✝ : NormedAddCommGroup E f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) a s : ℝ hf : f =O[atTop] fun x => x ^ (-a) hs : s < a d e : ℝ he : ∀ (b : ℝ), b ≥ e → ‖f b‖ ≤ d * ‖b ^ (-a)‖ he' : 0 < max e 1 ⊢ AEStronglyMeasurable (fun t => t ^ (s - 1) * f t) (Measure.restrict volume (Ioi (max e 1))) [PROOFSTEP] refine' AEStronglyMeasurable.mul _ (hfc.mono_set (Ioi_subset_Ioi he'.le)) [GOAL] case intro.intro.refine'_1 E : Type u_1 inst✝ : NormedAddCommGroup E f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) a s : ℝ hf : f =O[atTop] fun x => x ^ (-a) hs : s < a d e : ℝ he : ∀ (b : ℝ), b ≥ e → ‖f b‖ ≤ d * ‖b ^ (-a)‖ he' : 0 < max e 1 ⊢ AEStronglyMeasurable (fun t => t ^ (s - 1)) (Measure.restrict volume (Ioi (max e 1))) [PROOFSTEP] refine' (ContinuousAt.continuousOn fun t ht => _).aestronglyMeasurable measurableSet_Ioi [GOAL] case intro.intro.refine'_1 E : Type u_1 inst✝ : NormedAddCommGroup E f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) a s : ℝ hf : f =O[atTop] fun x => x ^ (-a) hs : s < a d e : ℝ he : ∀ (b : ℝ), b ≥ e → ‖f b‖ ≤ d * ‖b ^ (-a)‖ he' : 0 < max e 1 t : ℝ ht : t ∈ Ioi (max e 1) ⊢ ContinuousAt (fun t => t ^ (s - 1)) t [PROOFSTEP] exact continuousAt_rpow_const _ _ (Or.inl <| (he'.trans ht).ne') [GOAL] case intro.intro.refine'_2 E : Type u_1 inst✝ : NormedAddCommGroup E f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) a s : ℝ hf : f =O[atTop] fun x => x ^ (-a) hs : s < a d e : ℝ he : ∀ (b : ℝ), b ≥ e → ‖f b‖ ≤ d * ‖b ^ (-a)‖ he' : 0 < max e 1 ⊢ HasFiniteIntegral fun t => t ^ (s - 1) * f t [PROOFSTEP] have : ∀ᵐ t : ℝ ∂volume.restrict (Ioi <| max e 1), ‖t ^ (s - 1) * f t‖ ≤ t ^ (s - 1 + -a) * d := by refine' (ae_restrict_mem measurableSet_Ioi).mono fun t ht => _ have ht' : 0 < t := he'.trans ht rw [norm_mul, rpow_add ht', ← norm_of_nonneg (rpow_nonneg_of_nonneg ht'.le (-a)), mul_assoc, mul_comm _ d, norm_of_nonneg (rpow_nonneg_of_nonneg ht'.le _)] exact mul_le_mul_of_nonneg_left (he t ((le_max_left e 1).trans_lt ht).le) (rpow_pos_of_pos ht' _).le [GOAL] E : Type u_1 inst✝ : NormedAddCommGroup E f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) a s : ℝ hf : f =O[atTop] fun x => x ^ (-a) hs : s < a d e : ℝ he : ∀ (b : ℝ), b ≥ e → ‖f b‖ ≤ d * ‖b ^ (-a)‖ he' : 0 < max e 1 ⊢ ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi (max e 1)), ‖t ^ (s - 1) * f t‖ ≤ t ^ (s - 1 + -a) * d [PROOFSTEP] refine' (ae_restrict_mem measurableSet_Ioi).mono fun t ht => _ [GOAL] E : Type u_1 inst✝ : NormedAddCommGroup E f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) a s : ℝ hf : f =O[atTop] fun x => x ^ (-a) hs : s < a d e : ℝ he : ∀ (b : ℝ), b ≥ e → ‖f b‖ ≤ d * ‖b ^ (-a)‖ he' : 0 < max e 1 t : ℝ ht : t ∈ Ioi (max e 1) ⊢ ‖t ^ (s - 1) * f t‖ ≤ t ^ (s - 1 + -a) * d [PROOFSTEP] have ht' : 0 < t := he'.trans ht [GOAL] E : Type u_1 inst✝ : NormedAddCommGroup E f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) a s : ℝ hf : f =O[atTop] fun x => x ^ (-a) hs : s < a d e : ℝ he : ∀ (b : ℝ), b ≥ e → ‖f b‖ ≤ d * ‖b ^ (-a)‖ he' : 0 < max e 1 t : ℝ ht : t ∈ Ioi (max e 1) ht' : 0 < t ⊢ ‖t ^ (s - 1) * f t‖ ≤ t ^ (s - 1 + -a) * d [PROOFSTEP] rw [norm_mul, rpow_add ht', ← norm_of_nonneg (rpow_nonneg_of_nonneg ht'.le (-a)), mul_assoc, mul_comm _ d, norm_of_nonneg (rpow_nonneg_of_nonneg ht'.le _)] [GOAL] E : Type u_1 inst✝ : NormedAddCommGroup E f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) a s : ℝ hf : f =O[atTop] fun x => x ^ (-a) hs : s < a d e : ℝ he : ∀ (b : ℝ), b ≥ e → ‖f b‖ ≤ d * ‖b ^ (-a)‖ he' : 0 < max e 1 t : ℝ ht : t ∈ Ioi (max e 1) ht' : 0 < t ⊢ t ^ (s - 1) * ‖f t‖ ≤ t ^ (s - 1) * (d * ‖t ^ (-a)‖) [PROOFSTEP] exact mul_le_mul_of_nonneg_left (he t ((le_max_left e 1).trans_lt ht).le) (rpow_pos_of_pos ht' _).le [GOAL] case intro.intro.refine'_2 E : Type u_1 inst✝ : NormedAddCommGroup E f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) a s : ℝ hf : f =O[atTop] fun x => x ^ (-a) hs : s < a d e : ℝ he : ∀ (b : ℝ), b ≥ e → ‖f b‖ ≤ d * ‖b ^ (-a)‖ he' : 0 < max e 1 this : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi (max e 1)), ‖t ^ (s - 1) * f t‖ ≤ t ^ (s - 1 + -a) * d ⊢ HasFiniteIntegral fun t => t ^ (s - 1) * f t [PROOFSTEP] refine' (HasFiniteIntegral.mul_const _ _).mono' this [GOAL] case intro.intro.refine'_2 E : Type u_1 inst✝ : NormedAddCommGroup E f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) a s : ℝ hf : f =O[atTop] fun x => x ^ (-a) hs : s < a d e : ℝ he : ∀ (b : ℝ), b ≥ e → ‖f b‖ ≤ d * ‖b ^ (-a)‖ he' : 0 < max e 1 this : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi (max e 1)), ‖t ^ (s - 1) * f t‖ ≤ t ^ (s - 1 + -a) * d ⊢ HasFiniteIntegral fun a_1 => a_1 ^ (s - 1 + -a) [PROOFSTEP] exact (integrableOn_Ioi_rpow_of_lt (by linarith) he').hasFiniteIntegral [GOAL] E : Type u_1 inst✝ : NormedAddCommGroup E f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) a s : ℝ hf : f =O[atTop] fun x => x ^ (-a) hs : s < a d e : ℝ he : ∀ (b : ℝ), b ≥ e → ‖f b‖ ≤ d * ‖b ^ (-a)‖ he' : 0 < max e 1 this : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi (max e 1)), ‖t ^ (s - 1) * f t‖ ≤ t ^ (s - 1 + -a) * d ⊢ s - 1 + -a < -1 [PROOFSTEP] linarith [GOAL] E : Type u_1 inst✝ : NormedAddCommGroup E b : ℝ f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) s : ℝ hs : b < s ⊢ ∃ c, 0 < c ∧ IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioc 0 c) [PROOFSTEP] obtain ⟨d, hd, hd'⟩ := hf.exists_pos [GOAL] case intro.intro E : Type u_1 inst✝ : NormedAddCommGroup E b : ℝ f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) s : ℝ hs : b < s d : ℝ hd : 0 < d hd' : IsBigOWith d (𝓝[Ioi 0] 0) f fun x => x ^ (-b) ⊢ ∃ c, 0 < c ∧ IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioc 0 c) [PROOFSTEP] simp_rw [IsBigOWith, eventually_nhdsWithin_iff, Metric.eventually_nhds_iff, gt_iff_lt] at hd' [GOAL] case intro.intro E : Type u_1 inst✝ : NormedAddCommGroup E b : ℝ f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) s : ℝ hs : b < s d : ℝ hd : 0 < d hd' : ∃ ε, 0 < ε ∧ ∀ ⦃y : ℝ⦄, dist y 0 < ε → y ∈ Ioi 0 → ‖f y‖ ≤ d * ‖y ^ (-b)‖ ⊢ ∃ c, 0 < c ∧ IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioc 0 c) [PROOFSTEP] obtain ⟨ε, hε, hε'⟩ := hd' [GOAL] case intro.intro.intro.intro E : Type u_1 inst✝ : NormedAddCommGroup E b : ℝ f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) s : ℝ hs : b < s d : ℝ hd : 0 < d ε : ℝ hε : 0 < ε hε' : ∀ ⦃y : ℝ⦄, dist y 0 < ε → y ∈ Ioi 0 → ‖f y‖ ≤ d * ‖y ^ (-b)‖ ⊢ ∃ c, 0 < c ∧ IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioc 0 c) [PROOFSTEP] refine' ⟨ε, hε, integrableOn_Ioc_iff_integrableOn_Ioo.mpr ⟨_, _⟩⟩ [GOAL] case intro.intro.intro.intro.refine'_1 E : Type u_1 inst✝ : NormedAddCommGroup E b : ℝ f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) s : ℝ hs : b < s d : ℝ hd : 0 < d ε : ℝ hε : 0 < ε hε' : ∀ ⦃y : ℝ⦄, dist y 0 < ε → y ∈ Ioi 0 → ‖f y‖ ≤ d * ‖y ^ (-b)‖ ⊢ AEStronglyMeasurable (fun t => t ^ (s - 1) * f t) (Measure.restrict volume (Ioo 0 ε)) [PROOFSTEP] refine' AEStronglyMeasurable.mul _ (hfc.mono_set Ioo_subset_Ioi_self) [GOAL] case intro.intro.intro.intro.refine'_1 E : Type u_1 inst✝ : NormedAddCommGroup E b : ℝ f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) s : ℝ hs : b < s d : ℝ hd : 0 < d ε : ℝ hε : 0 < ε hε' : ∀ ⦃y : ℝ⦄, dist y 0 < ε → y ∈ Ioi 0 → ‖f y‖ ≤ d * ‖y ^ (-b)‖ ⊢ AEStronglyMeasurable (fun t => t ^ (s - 1)) (Measure.restrict volume (Ioo 0 ε)) [PROOFSTEP] refine' (ContinuousAt.continuousOn fun t ht => _).aestronglyMeasurable measurableSet_Ioo [GOAL] case intro.intro.intro.intro.refine'_1 E : Type u_1 inst✝ : NormedAddCommGroup E b : ℝ f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) s : ℝ hs : b < s d : ℝ hd : 0 < d ε : ℝ hε : 0 < ε hε' : ∀ ⦃y : ℝ⦄, dist y 0 < ε → y ∈ Ioi 0 → ‖f y‖ ≤ d * ‖y ^ (-b)‖ t : ℝ ht : t ∈ Ioo 0 ε ⊢ ContinuousAt (fun t => t ^ (s - 1)) t [PROOFSTEP] exact continuousAt_rpow_const _ _ (Or.inl ht.1.ne') [GOAL] case intro.intro.intro.intro.refine'_2 E : Type u_1 inst✝ : NormedAddCommGroup E b : ℝ f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) s : ℝ hs : b < s d : ℝ hd : 0 < d ε : ℝ hε : 0 < ε hε' : ∀ ⦃y : ℝ⦄, dist y 0 < ε → y ∈ Ioi 0 → ‖f y‖ ≤ d * ‖y ^ (-b)‖ ⊢ HasFiniteIntegral fun t => t ^ (s - 1) * f t [PROOFSTEP] apply HasFiniteIntegral.mono' [GOAL] case intro.intro.intro.intro.refine'_2.hg E : Type u_1 inst✝ : NormedAddCommGroup E b : ℝ f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) s : ℝ hs : b < s d : ℝ hd : 0 < d ε : ℝ hε : 0 < ε hε' : ∀ ⦃y : ℝ⦄, dist y 0 < ε → y ∈ Ioi 0 → ‖f y‖ ≤ d * ‖y ^ (-b)‖ ⊢ HasFiniteIntegral ?intro.intro.intro.intro.refine'_2.g [PROOFSTEP] show HasFiniteIntegral (fun t => d * t ^ (s - b - 1)) _ [GOAL] case intro.intro.intro.intro.refine'_2.hg E : Type u_1 inst✝ : NormedAddCommGroup E b : ℝ f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) s : ℝ hs : b < s d : ℝ hd : 0 < d ε : ℝ hε : 0 < ε hε' : ∀ ⦃y : ℝ⦄, dist y 0 < ε → y ∈ Ioi 0 → ‖f y‖ ≤ d * ‖y ^ (-b)‖ ⊢ HasFiniteIntegral fun t => d * t ^ (s - b - 1) [PROOFSTEP] refine' (Integrable.hasFiniteIntegral _).const_mul _ [GOAL] case intro.intro.intro.intro.refine'_2.hg E : Type u_1 inst✝ : NormedAddCommGroup E b : ℝ f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) s : ℝ hs : b < s d : ℝ hd : 0 < d ε : ℝ hε : 0 < ε hε' : ∀ ⦃y : ℝ⦄, dist y 0 < ε → y ∈ Ioi 0 → ‖f y‖ ≤ d * ‖y ^ (-b)‖ ⊢ Integrable fun t => t ^ (s - b - 1) [PROOFSTEP] rw [← IntegrableOn, ← integrableOn_Ioc_iff_integrableOn_Ioo, ← intervalIntegrable_iff_integrable_Ioc_of_le hε.le] [GOAL] case intro.intro.intro.intro.refine'_2.hg E : Type u_1 inst✝ : NormedAddCommGroup E b : ℝ f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) s : ℝ hs : b < s d : ℝ hd : 0 < d ε : ℝ hε : 0 < ε hε' : ∀ ⦃y : ℝ⦄, dist y 0 < ε → y ∈ Ioi 0 → ‖f y‖ ≤ d * ‖y ^ (-b)‖ ⊢ IntervalIntegrable (fun t => t ^ (s - b - 1)) volume 0 ε [PROOFSTEP] exact intervalIntegral.intervalIntegrable_rpow' (by linarith) [GOAL] E : Type u_1 inst✝ : NormedAddCommGroup E b : ℝ f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) s : ℝ hs : b < s d : ℝ hd : 0 < d ε : ℝ hε : 0 < ε hε' : ∀ ⦃y : ℝ⦄, dist y 0 < ε → y ∈ Ioi 0 → ‖f y‖ ≤ d * ‖y ^ (-b)‖ ⊢ -1 < s - b - 1 [PROOFSTEP] linarith [GOAL] case intro.intro.intro.intro.refine'_2.h E : Type u_1 inst✝ : NormedAddCommGroup E b : ℝ f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) s : ℝ hs : b < s d : ℝ hd : 0 < d ε : ℝ hε : 0 < ε hε' : ∀ ⦃y : ℝ⦄, dist y 0 < ε → y ∈ Ioi 0 → ‖f y‖ ≤ d * ‖y ^ (-b)‖ ⊢ ∀ᵐ (a : ℝ) ∂Measure.restrict volume (Ioo 0 ε), ‖a ^ (s - 1) * f a‖ ≤ d * a ^ (s - b - 1) [PROOFSTEP] refine' (ae_restrict_iff' measurableSet_Ioo).mpr (eventually_of_forall fun t ht => _) [GOAL] case intro.intro.intro.intro.refine'_2.h E : Type u_1 inst✝ : NormedAddCommGroup E b : ℝ f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) s : ℝ hs : b < s d : ℝ hd : 0 < d ε : ℝ hε : 0 < ε hε' : ∀ ⦃y : ℝ⦄, dist y 0 < ε → y ∈ Ioi 0 → ‖f y‖ ≤ d * ‖y ^ (-b)‖ t : ℝ ht : t ∈ Ioo 0 ε ⊢ ‖t ^ (s - 1) * f t‖ ≤ d * t ^ (s - b - 1) [PROOFSTEP] rw [mul_comm, norm_mul] [GOAL] case intro.intro.intro.intro.refine'_2.h E : Type u_1 inst✝ : NormedAddCommGroup E b : ℝ f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) s : ℝ hs : b < s d : ℝ hd : 0 < d ε : ℝ hε : 0 < ε hε' : ∀ ⦃y : ℝ⦄, dist y 0 < ε → y ∈ Ioi 0 → ‖f y‖ ≤ d * ‖y ^ (-b)‖ t : ℝ ht : t ∈ Ioo 0 ε ⊢ ‖f t‖ * ‖t ^ (s - 1)‖ ≤ d * t ^ (s - b - 1) [PROOFSTEP] specialize hε' _ ht.1 [GOAL] case intro.intro.intro.intro.refine'_2.h E : Type u_1 inst✝ : NormedAddCommGroup E b : ℝ f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) s : ℝ hs : b < s d : ℝ hd : 0 < d ε : ℝ hε : 0 < ε hε' : ∀ ⦃y : ℝ⦄, dist y 0 < ε → y ∈ Ioi 0 → ‖f y‖ ≤ d * ‖y ^ (-b)‖ t : ℝ ht : t ∈ Ioo 0 ε ⊢ dist t 0 < ε [PROOFSTEP] rw [dist_eq_norm, sub_zero, norm_of_nonneg (le_of_lt ht.1)] [GOAL] case intro.intro.intro.intro.refine'_2.h E : Type u_1 inst✝ : NormedAddCommGroup E b : ℝ f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) s : ℝ hs : b < s d : ℝ hd : 0 < d ε : ℝ hε : 0 < ε hε' : ∀ ⦃y : ℝ⦄, dist y 0 < ε → y ∈ Ioi 0 → ‖f y‖ ≤ d * ‖y ^ (-b)‖ t : ℝ ht : t ∈ Ioo 0 ε ⊢ t < ε [PROOFSTEP] exact ht.2 [GOAL] case intro.intro.intro.intro.refine'_2.h E : Type u_1 inst✝ : NormedAddCommGroup E b : ℝ f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) s : ℝ hs : b < s d : ℝ hd : 0 < d ε : ℝ hε : 0 < ε t : ℝ ht : t ∈ Ioo 0 ε hε' : ‖f t‖ ≤ d * ‖t ^ (-b)‖ ⊢ ‖f t‖ * ‖t ^ (s - 1)‖ ≤ d * t ^ (s - b - 1) [PROOFSTEP] refine' (mul_le_mul_of_nonneg_right hε' (norm_nonneg _)).trans _ [GOAL] case intro.intro.intro.intro.refine'_2.h E : Type u_1 inst✝ : NormedAddCommGroup E b : ℝ f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) s : ℝ hs : b < s d : ℝ hd : 0 < d ε : ℝ hε : 0 < ε t : ℝ ht : t ∈ Ioo 0 ε hε' : ‖f t‖ ≤ d * ‖t ^ (-b)‖ ⊢ d * ‖t ^ (-b)‖ * ‖t ^ (s - 1)‖ ≤ d * t ^ (s - b - 1) [PROOFSTEP] simp_rw [norm_of_nonneg (rpow_nonneg_of_nonneg (le_of_lt ht.1) _), mul_assoc] [GOAL] case intro.intro.intro.intro.refine'_2.h E : Type u_1 inst✝ : NormedAddCommGroup E b : ℝ f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) s : ℝ hs : b < s d : ℝ hd : 0 < d ε : ℝ hε : 0 < ε t : ℝ ht : t ∈ Ioo 0 ε hε' : ‖f t‖ ≤ d * ‖t ^ (-b)‖ ⊢ d * (t ^ (-b) * t ^ (s - 1)) ≤ d * t ^ (s - b - 1) [PROOFSTEP] refine' mul_le_mul_of_nonneg_left (le_of_eq _) hd.le [GOAL] case intro.intro.intro.intro.refine'_2.h E : Type u_1 inst✝ : NormedAddCommGroup E b : ℝ f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) s : ℝ hs : b < s d : ℝ hd : 0 < d ε : ℝ hε : 0 < ε t : ℝ ht : t ∈ Ioo 0 ε hε' : ‖f t‖ ≤ d * ‖t ^ (-b)‖ ⊢ t ^ (-b) * t ^ (s - 1) = t ^ (s - b - 1) [PROOFSTEP] rw [← rpow_add ht.1] [GOAL] case intro.intro.intro.intro.refine'_2.h E : Type u_1 inst✝ : NormedAddCommGroup E b : ℝ f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) s : ℝ hs : b < s d : ℝ hd : 0 < d ε : ℝ hε : 0 < ε t : ℝ ht : t ∈ Ioo 0 ε hε' : ‖f t‖ ≤ d * ‖t ^ (-b)‖ ⊢ t ^ (-b + (s - 1)) = t ^ (s - b - 1) [PROOFSTEP] congr 1 [GOAL] case intro.intro.intro.intro.refine'_2.h.e_a E : Type u_1 inst✝ : NormedAddCommGroup E b : ℝ f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) s : ℝ hs : b < s d : ℝ hd : 0 < d ε : ℝ hε : 0 < ε t : ℝ ht : t ∈ Ioo 0 ε hε' : ‖f t‖ ≤ d * ‖t ^ (-b)‖ ⊢ -b + (s - 1) = s - b - 1 [PROOFSTEP] abel [GOAL] case intro.intro.intro.intro.refine'_2.h.e_a E : Type u_1 inst✝ : NormedAddCommGroup E b : ℝ f : ℝ → ℝ hfc : AEStronglyMeasurable f (Measure.restrict volume (Ioi 0)) hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) s : ℝ hs : b < s d : ℝ hd : 0 < d ε : ℝ hε : 0 < ε t : ℝ ht : t ∈ Ioo 0 ε hε' : ‖f t‖ ≤ d * ‖t ^ (-b)‖ ⊢ -b + (s - 1) = s - b - 1 [PROOFSTEP] abel [GOAL] E : Type u_1 inst✝ : NormedAddCommGroup E a b : ℝ f : ℝ → ℝ s : ℝ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s ⊢ IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioi 0) [PROOFSTEP] obtain ⟨c1, hc1, hc1'⟩ := mellin_convergent_top_of_isBigO hfc.aestronglyMeasurable hf_top hs_top [GOAL] case intro.intro E : Type u_1 inst✝ : NormedAddCommGroup E a b : ℝ f : ℝ → ℝ s : ℝ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s c1 : ℝ hc1 : 0 < c1 hc1' : IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioi c1) ⊢ IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioi 0) [PROOFSTEP] obtain ⟨c2, hc2, hc2'⟩ := mellin_convergent_zero_of_isBigO hfc.aestronglyMeasurable hf_bot hs_bot [GOAL] case intro.intro.intro.intro E : Type u_1 inst✝ : NormedAddCommGroup E a b : ℝ f : ℝ → ℝ s : ℝ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s c1 : ℝ hc1 : 0 < c1 hc1' : IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioi c1) c2 : ℝ hc2 : 0 < c2 hc2' : IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioc 0 c2) ⊢ IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioi 0) [PROOFSTEP] have : Ioi 0 = Ioc 0 c2 ∪ Ioc c2 c1 ∪ Ioi c1 := by rw [union_assoc, Ioc_union_Ioi (le_max_right _ _), Ioc_union_Ioi ((min_le_left _ _).trans (le_max_right _ _)), min_eq_left (lt_min hc2 hc1).le] [GOAL] E : Type u_1 inst✝ : NormedAddCommGroup E a b : ℝ f : ℝ → ℝ s : ℝ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s c1 : ℝ hc1 : 0 < c1 hc1' : IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioi c1) c2 : ℝ hc2 : 0 < c2 hc2' : IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioc 0 c2) ⊢ Ioi 0 = Ioc 0 c2 ∪ Ioc c2 c1 ∪ Ioi c1 [PROOFSTEP] rw [union_assoc, Ioc_union_Ioi (le_max_right _ _), Ioc_union_Ioi ((min_le_left _ _).trans (le_max_right _ _)), min_eq_left (lt_min hc2 hc1).le] [GOAL] case intro.intro.intro.intro E : Type u_1 inst✝ : NormedAddCommGroup E a b : ℝ f : ℝ → ℝ s : ℝ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s c1 : ℝ hc1 : 0 < c1 hc1' : IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioi c1) c2 : ℝ hc2 : 0 < c2 hc2' : IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioc 0 c2) this : Ioi 0 = Ioc 0 c2 ∪ Ioc c2 c1 ∪ Ioi c1 ⊢ IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioi 0) [PROOFSTEP] rw [this, integrableOn_union, integrableOn_union] [GOAL] case intro.intro.intro.intro E : Type u_1 inst✝ : NormedAddCommGroup E a b : ℝ f : ℝ → ℝ s : ℝ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s c1 : ℝ hc1 : 0 < c1 hc1' : IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioi c1) c2 : ℝ hc2 : 0 < c2 hc2' : IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioc 0 c2) this : Ioi 0 = Ioc 0 c2 ∪ Ioc c2 c1 ∪ Ioi c1 ⊢ (IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioc 0 c2) ∧ IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioc c2 c1)) ∧ IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioi c1) [PROOFSTEP] refine' ⟨⟨hc2', integrableOn_Icc_iff_integrableOn_Ioc.mp _⟩, hc1'⟩ [GOAL] case intro.intro.intro.intro E : Type u_1 inst✝ : NormedAddCommGroup E a b : ℝ f : ℝ → ℝ s : ℝ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s c1 : ℝ hc1 : 0 < c1 hc1' : IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioi c1) c2 : ℝ hc2 : 0 < c2 hc2' : IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioc 0 c2) this : Ioi 0 = Ioc 0 c2 ∪ Ioc c2 c1 ∪ Ioi c1 ⊢ IntegrableOn (fun t => t ^ (s - 1) * f t) (Icc c2 c1) [PROOFSTEP] refine' (hfc.continuousOn_mul _ isOpen_Ioi).integrableOn_compact_subset (fun t ht => (hc2.trans_le ht.1 : 0 < t)) isCompact_Icc [GOAL] case intro.intro.intro.intro E : Type u_1 inst✝ : NormedAddCommGroup E a b : ℝ f : ℝ → ℝ s : ℝ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s c1 : ℝ hc1 : 0 < c1 hc1' : IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioi c1) c2 : ℝ hc2 : 0 < c2 hc2' : IntegrableOn (fun t => t ^ (s - 1) * f t) (Ioc 0 c2) this : Ioi 0 = Ioc 0 c2 ∪ Ioc c2 c1 ∪ Ioi c1 ⊢ ContinuousOn (fun t => t ^ (s - 1)) (Ioi 0) [PROOFSTEP] exact ContinuousAt.continuousOn fun t ht => continuousAt_rpow_const _ _ <| Or.inl <| ne_of_gt ht [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re ⊢ MellinConvergent f s [PROOFSTEP] rw [MellinConvergent, mellin_convergent_iff_norm Subset.rfl measurableSet_Ioi hfc.aestronglyMeasurable] [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re ⊢ IntegrableOn (fun t => t ^ (s.re - 1) * ‖f t‖) (Ioi 0) [PROOFSTEP] exact mellin_convergent_of_isBigO_scalar hfc.norm hf_top.norm_left hs_top hf_bot.norm_left hs_bot [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℝ E a b : ℝ f : ℝ → E hab : b < a hf : f =O[atTop] fun x => x ^ (-a) ⊢ (fun t => log t • f t) =O[atTop] fun x => x ^ (-b) [PROOFSTEP] refine' ((isLittleO_log_rpow_atTop (sub_pos.mpr hab)).isBigO.smul hf).congr' (eventually_of_forall fun t => by rfl) ((eventually_gt_atTop 0).mp (eventually_of_forall fun t ht => _)) [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℝ E a b : ℝ f : ℝ → E hab : b < a hf : f =O[atTop] fun x => x ^ (-a) t : ℝ ⊢ (fun x => log x • f x) t = (fun t => log t • f t) t [PROOFSTEP] rfl [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℝ E a b : ℝ f : ℝ → E hab : b < a hf : f =O[atTop] fun x => x ^ (-a) t : ℝ ht : 0 < t ⊢ (fun x => x ^ (a - b) • x ^ (-a)) t = (fun x => x ^ (-b)) t [PROOFSTEP] simp only [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℝ E a b : ℝ f : ℝ → E hab : b < a hf : f =O[atTop] fun x => x ^ (-a) t : ℝ ht : 0 < t ⊢ t ^ (a - b) • t ^ (-a) = t ^ (-b) [PROOFSTEP] rw [smul_eq_mul, ← rpow_add ht, ← sub_eq_add_neg, sub_eq_add_neg a, add_sub_cancel'] [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℝ E a b : ℝ f : ℝ → E hab : a < b hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-a) ⊢ (fun t => log t • f t) =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) [PROOFSTEP] have : log =o[𝓝[>] 0] fun t : ℝ => t ^ (a - b) := by refine' ((isLittleO_log_rpow_atTop (sub_pos.mpr hab)).neg_left.comp_tendsto tendsto_inv_zero_atTop).congr' (eventually_nhdsWithin_iff.mpr <| eventually_of_forall fun t ht => _) (eventually_nhdsWithin_iff.mpr <| eventually_of_forall fun t ht => _) · simp_rw [Function.comp_apply, ← one_div, log_div one_ne_zero (ne_of_gt ht), Real.log_one, zero_sub, neg_neg] · simp_rw [Function.comp_apply, inv_rpow (le_of_lt ht), ← rpow_neg (le_of_lt ht), neg_sub] [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℝ E a b : ℝ f : ℝ → E hab : a < b hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-a) ⊢ log =o[𝓝[Ioi 0] 0] fun t => t ^ (a - b) [PROOFSTEP] refine' ((isLittleO_log_rpow_atTop (sub_pos.mpr hab)).neg_left.comp_tendsto tendsto_inv_zero_atTop).congr' (eventually_nhdsWithin_iff.mpr <| eventually_of_forall fun t ht => _) (eventually_nhdsWithin_iff.mpr <| eventually_of_forall fun t ht => _) [GOAL] case refine'_1 E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℝ E a b : ℝ f : ℝ → E hab : a < b hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-a) t : ℝ ht : t ∈ Ioi 0 ⊢ ((fun x => -log x) ∘ fun x => x⁻¹) t = log t [PROOFSTEP] simp_rw [Function.comp_apply, ← one_div, log_div one_ne_zero (ne_of_gt ht), Real.log_one, zero_sub, neg_neg] [GOAL] case refine'_2 E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℝ E a b : ℝ f : ℝ → E hab : a < b hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-a) t : ℝ ht : t ∈ Ioi 0 ⊢ ((fun x => x ^ (b - a)) ∘ fun x => x⁻¹) t = (fun t => t ^ (a - b)) t [PROOFSTEP] simp_rw [Function.comp_apply, inv_rpow (le_of_lt ht), ← rpow_neg (le_of_lt ht), neg_sub] [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℝ E a b : ℝ f : ℝ → E hab : a < b hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-a) this : log =o[𝓝[Ioi 0] 0] fun t => t ^ (a - b) ⊢ (fun t => log t • f t) =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) [PROOFSTEP] refine' (this.isBigO.smul hf).congr' (eventually_of_forall fun t => by rfl) (eventually_nhdsWithin_iff.mpr (eventually_of_forall fun t ht => _)) [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℝ E a b : ℝ f : ℝ → E hab : a < b hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-a) this : log =o[𝓝[Ioi 0] 0] fun t => t ^ (a - b) t : ℝ ⊢ (fun x => log x • f x) t = (fun t => log t • f t) t [PROOFSTEP] rfl [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℝ E a b : ℝ f : ℝ → E hab : a < b hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-a) this : log =o[𝓝[Ioi 0] 0] fun t => t ^ (a - b) t : ℝ ht : t ∈ Ioi 0 ⊢ (fun x => x ^ (a - b) • x ^ (-a)) t = (fun x => x ^ (-b)) t [PROOFSTEP] simp_rw [smul_eq_mul, ← rpow_add ht] [GOAL] E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℝ E a b : ℝ f : ℝ → E hab : a < b hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-a) this : log =o[𝓝[Ioi 0] 0] fun t => t ^ (a - b) t : ℝ ht : t ∈ Ioi 0 ⊢ t ^ (a - b + -a) = t ^ (-b) [PROOFSTEP] congr 1 [GOAL] case e_a E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℝ E a b : ℝ f : ℝ → E hab : a < b hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-a) this : log =o[𝓝[Ioi 0] 0] fun t => t ^ (a - b) t : ℝ ht : t ∈ Ioi 0 ⊢ a - b + -a = -b [PROOFSTEP] abel [GOAL] case e_a E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℝ E a b : ℝ f : ℝ → E hab : a < b hf : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-a) this : log =o[𝓝[Ioi 0] 0] fun t => t ^ (a - b) t : ℝ ht : t ∈ Ioi 0 ⊢ a - b + -a = -b [PROOFSTEP] abel [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re ⊢ MellinConvergent (fun t => log t • f t) s ∧ HasDerivAt (mellin f) (mellin (fun t => log t • f t) s) s [PROOFSTEP] set F : ℂ → ℝ → E := fun (z : ℂ) (t : ℝ) => (t : ℂ) ^ (z - 1) • f t [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t ⊢ MellinConvergent (fun t => log t • f t) s ∧ HasDerivAt (mellin f) (mellin (fun t => log t • f t) s) s [PROOFSTEP] set F' : ℂ → ℝ → E := fun (z : ℂ) (t : ℝ) => ((t : ℂ) ^ (z - 1) * log t) • f t [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t ⊢ MellinConvergent (fun t => log t • f t) s ∧ HasDerivAt (mellin f) (mellin (fun t => log t • f t) s) s [PROOFSTEP] obtain ⟨v, hv0, hv1, hv2⟩ : ∃ v : ℝ, 0 < v ∧ v < s.re - b ∧ v < a - s.re := by obtain ⟨w, hw1, hw2⟩ := exists_between (sub_pos.mpr hs_top) obtain ⟨w', hw1', hw2'⟩ := exists_between (sub_pos.mpr hs_bot) exact ⟨min w w', lt_min hw1 hw1', (min_le_right _ _).trans_lt hw2', (min_le_left _ _).trans_lt hw2⟩ [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t ⊢ ∃ v, 0 < v ∧ v < s.re - b ∧ v < a - s.re [PROOFSTEP] obtain ⟨w, hw1, hw2⟩ := exists_between (sub_pos.mpr hs_top) [GOAL] case intro.intro E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t w : ℝ hw1 : 0 < w hw2 : w < a - s.re ⊢ ∃ v, 0 < v ∧ v < s.re - b ∧ v < a - s.re [PROOFSTEP] obtain ⟨w', hw1', hw2'⟩ := exists_between (sub_pos.mpr hs_bot) [GOAL] case intro.intro.intro.intro E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t w : ℝ hw1 : 0 < w hw2 : w < a - s.re w' : ℝ hw1' : 0 < w' hw2' : w' < s.re - b ⊢ ∃ v, 0 < v ∧ v < s.re - b ∧ v < a - s.re [PROOFSTEP] exact ⟨min w w', lt_min hw1 hw1', (min_le_right _ _).trans_lt hw2', (min_le_left _ _).trans_lt hw2⟩ [GOAL] case intro.intro.intro E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re ⊢ MellinConvergent (fun t => log t • f t) s ∧ HasDerivAt (mellin f) (mellin (fun t => log t • f t) s) s [PROOFSTEP] let bound : ℝ → ℝ := fun t : ℝ => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ [GOAL] case intro.intro.intro E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ ⊢ MellinConvergent (fun t => log t • f t) s ∧ HasDerivAt (mellin f) (mellin (fun t => log t • f t) s) s [PROOFSTEP] have h1 : ∀ᶠ z : ℂ in 𝓝 s, AEStronglyMeasurable (F z) (volume.restrict <| Ioi 0) := by refine' eventually_of_forall fun z => AEStronglyMeasurable.smul _ hfc.aestronglyMeasurable refine' ContinuousOn.aestronglyMeasurable _ measurableSet_Ioi refine' ContinuousAt.continuousOn fun t ht => _ exact continuousAt_ofReal_cpow_const _ _ (Or.inr <| ne_of_gt ht) [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ ⊢ ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) [PROOFSTEP] refine' eventually_of_forall fun z => AEStronglyMeasurable.smul _ hfc.aestronglyMeasurable [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ z : ℂ ⊢ AEStronglyMeasurable (fun t => ↑t ^ (z - 1)) (Measure.restrict volume (Ioi 0)) [PROOFSTEP] refine' ContinuousOn.aestronglyMeasurable _ measurableSet_Ioi [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ z : ℂ ⊢ ContinuousOn (fun t => ↑t ^ (z - 1)) (Ioi 0) [PROOFSTEP] refine' ContinuousAt.continuousOn fun t ht => _ [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ z : ℂ t : ℝ ht : t ∈ Ioi 0 ⊢ ContinuousAt (fun t => ↑t ^ (z - 1)) t [PROOFSTEP] exact continuousAt_ofReal_cpow_const _ _ (Or.inr <| ne_of_gt ht) [GOAL] case intro.intro.intro E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) ⊢ MellinConvergent (fun t => log t • f t) s ∧ HasDerivAt (mellin f) (mellin (fun t => log t • f t) s) s [PROOFSTEP] have h2 : IntegrableOn (F s) (Ioi (0 : ℝ)) [GOAL] case h2 E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) ⊢ IntegrableOn (F s) (Ioi 0) [PROOFSTEP] exact mellinConvergent_of_isBigO_rpow hfc hf_top hs_top hf_bot hs_bot [GOAL] case intro.intro.intro E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) ⊢ MellinConvergent (fun t => log t • f t) s ∧ HasDerivAt (mellin f) (mellin (fun t => log t • f t) s) s [PROOFSTEP] have h3 : AEStronglyMeasurable (F' s) (volume.restrict <| Ioi 0) := by apply LocallyIntegrableOn.aestronglyMeasurable refine' hfc.continuousOn_smul isOpen_Ioi ((ContinuousAt.continuousOn fun t ht => _).mul _) · exact continuousAt_ofReal_cpow_const _ _ (Or.inr <| ne_of_gt ht) · refine' continuous_ofReal.comp_continuousOn _ exact continuousOn_log.mono (subset_compl_singleton_iff.mpr not_mem_Ioi_self) [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) ⊢ AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) [PROOFSTEP] apply LocallyIntegrableOn.aestronglyMeasurable [GOAL] case hf E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) ⊢ LocallyIntegrableOn (F' s) (Ioi 0) [PROOFSTEP] refine' hfc.continuousOn_smul isOpen_Ioi ((ContinuousAt.continuousOn fun t ht => _).mul _) [GOAL] case hf.refine'_1 E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) t : ℝ ht : t ∈ Ioi 0 ⊢ ContinuousAt (fun t => ↑t ^ (s - 1)) t [PROOFSTEP] exact continuousAt_ofReal_cpow_const _ _ (Or.inr <| ne_of_gt ht) [GOAL] case hf.refine'_2 E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) ⊢ ContinuousOn (fun t => ↑(log t)) (Ioi 0) [PROOFSTEP] refine' continuous_ofReal.comp_continuousOn _ [GOAL] case hf.refine'_2 E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) ⊢ ContinuousOn (fun t => log t) (Ioi 0) [PROOFSTEP] exact continuousOn_log.mono (subset_compl_singleton_iff.mpr not_mem_Ioi_self) [GOAL] case intro.intro.intro E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) ⊢ MellinConvergent (fun t => log t • f t) s ∧ HasDerivAt (mellin f) (mellin (fun t => log t • f t) s) s [PROOFSTEP] have h4 : ∀ᵐ t : ℝ ∂volume.restrict (Ioi 0), ∀ z : ℂ, z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t := by refine' (ae_restrict_mem measurableSet_Ioi).mono fun t ht z hz => _ simp_rw [norm_smul, norm_mul, Complex.norm_eq_abs (log _), Complex.abs_ofReal, mul_assoc] refine' mul_le_mul_of_nonneg_right _ (mul_nonneg (abs_nonneg _) (norm_nonneg _)) rw [Complex.norm_eq_abs, abs_cpow_eq_rpow_re_of_pos ht] rcases le_or_lt 1 t with h | h · refine' le_add_of_le_of_nonneg (rpow_le_rpow_of_exponent_le h _) (rpow_nonneg_of_nonneg (zero_le_one.trans h) _) rw [sub_re, one_re, sub_le_sub_iff_right] rw [mem_ball_iff_norm, Complex.norm_eq_abs] at hz have hz' := (re_le_abs _).trans hz.le rwa [sub_re, sub_le_iff_le_add'] at hz' · refine' le_add_of_nonneg_of_le (rpow_pos_of_pos ht _).le (rpow_le_rpow_of_exponent_ge ht h.le _) rw [sub_re, one_re, sub_le_iff_le_add, sub_add_cancel] rw [mem_ball_iff_norm', Complex.norm_eq_abs] at hz have hz' := (re_le_abs _).trans hz.le rwa [sub_re, sub_le_iff_le_add, ← sub_le_iff_le_add'] at hz' [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) ⊢ ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t [PROOFSTEP] refine' (ae_restrict_mem measurableSet_Ioi).mono fun t ht z hz => _ [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) t : ℝ ht : t ∈ Ioi 0 z : ℂ hz : z ∈ Metric.ball s v ⊢ ‖F' z t‖ ≤ bound t [PROOFSTEP] simp_rw [norm_smul, norm_mul, Complex.norm_eq_abs (log _), Complex.abs_ofReal, mul_assoc] [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) t : ℝ ht : t ∈ Ioi 0 z : ℂ hz : z ∈ Metric.ball s v ⊢ ‖↑t ^ (z - 1)‖ * (|log t| * ‖f t‖) ≤ (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * (|log t| * ‖f t‖) [PROOFSTEP] refine' mul_le_mul_of_nonneg_right _ (mul_nonneg (abs_nonneg _) (norm_nonneg _)) [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) t : ℝ ht : t ∈ Ioi 0 z : ℂ hz : z ∈ Metric.ball s v ⊢ ‖↑t ^ (z - 1)‖ ≤ t ^ (s.re + v - 1) + t ^ (s.re - v - 1) [PROOFSTEP] rw [Complex.norm_eq_abs, abs_cpow_eq_rpow_re_of_pos ht] [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) t : ℝ ht : t ∈ Ioi 0 z : ℂ hz : z ∈ Metric.ball s v ⊢ t ^ (z - 1).re ≤ t ^ (s.re + v - 1) + t ^ (s.re - v - 1) [PROOFSTEP] rcases le_or_lt 1 t with h | h [GOAL] case inl E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) t : ℝ ht : t ∈ Ioi 0 z : ℂ hz : z ∈ Metric.ball s v h : 1 ≤ t ⊢ t ^ (z - 1).re ≤ t ^ (s.re + v - 1) + t ^ (s.re - v - 1) [PROOFSTEP] refine' le_add_of_le_of_nonneg (rpow_le_rpow_of_exponent_le h _) (rpow_nonneg_of_nonneg (zero_le_one.trans h) _) [GOAL] case inl E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) t : ℝ ht : t ∈ Ioi 0 z : ℂ hz : z ∈ Metric.ball s v h : 1 ≤ t ⊢ (z - 1).re ≤ s.re + v - 1 [PROOFSTEP] rw [sub_re, one_re, sub_le_sub_iff_right] [GOAL] case inl E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) t : ℝ ht : t ∈ Ioi 0 z : ℂ hz : z ∈ Metric.ball s v h : 1 ≤ t ⊢ z.re ≤ s.re + v [PROOFSTEP] rw [mem_ball_iff_norm, Complex.norm_eq_abs] at hz [GOAL] case inl E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) t : ℝ ht : t ∈ Ioi 0 z : ℂ hz : ↑Complex.abs (z - s) < v h : 1 ≤ t ⊢ z.re ≤ s.re + v [PROOFSTEP] have hz' := (re_le_abs _).trans hz.le [GOAL] case inl E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) t : ℝ ht : t ∈ Ioi 0 z : ℂ hz : ↑Complex.abs (z - s) < v h : 1 ≤ t hz' : (z - s).re ≤ v ⊢ z.re ≤ s.re + v [PROOFSTEP] rwa [sub_re, sub_le_iff_le_add'] at hz' [GOAL] case inr E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) t : ℝ ht : t ∈ Ioi 0 z : ℂ hz : z ∈ Metric.ball s v h : t < 1 ⊢ t ^ (z - 1).re ≤ t ^ (s.re + v - 1) + t ^ (s.re - v - 1) [PROOFSTEP] refine' le_add_of_nonneg_of_le (rpow_pos_of_pos ht _).le (rpow_le_rpow_of_exponent_ge ht h.le _) [GOAL] case inr E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) t : ℝ ht : t ∈ Ioi 0 z : ℂ hz : z ∈ Metric.ball s v h : t < 1 ⊢ s.re - v - 1 ≤ (z - 1).re [PROOFSTEP] rw [sub_re, one_re, sub_le_iff_le_add, sub_add_cancel] [GOAL] case inr E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) t : ℝ ht : t ∈ Ioi 0 z : ℂ hz : z ∈ Metric.ball s v h : t < 1 ⊢ s.re - v ≤ z.re [PROOFSTEP] rw [mem_ball_iff_norm', Complex.norm_eq_abs] at hz [GOAL] case inr E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) t : ℝ ht : t ∈ Ioi 0 z : ℂ hz : ↑Complex.abs (s - z) < v h : t < 1 ⊢ s.re - v ≤ z.re [PROOFSTEP] have hz' := (re_le_abs _).trans hz.le [GOAL] case inr E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) t : ℝ ht : t ∈ Ioi 0 z : ℂ hz : ↑Complex.abs (s - z) < v h : t < 1 hz' : (s - z).re ≤ v ⊢ s.re - v ≤ z.re [PROOFSTEP] rwa [sub_re, sub_le_iff_le_add, ← sub_le_iff_le_add'] at hz' [GOAL] case intro.intro.intro E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t ⊢ MellinConvergent (fun t => log t • f t) s ∧ HasDerivAt (mellin f) (mellin (fun t => log t • f t) s) s [PROOFSTEP] have h5 : IntegrableOn bound (Ioi 0) := by simp_rw [add_mul, mul_assoc] suffices ∀ {j : ℝ} (hj : b < j) (hj' : j < a), IntegrableOn (fun t : ℝ => t ^ (j - 1) * (|log t| * ‖f t‖)) (Ioi 0) volume by refine' Integrable.add (this _ _) (this _ _) all_goals linarith · intro j hj hj' obtain ⟨w, hw1, hw2⟩ := exists_between hj obtain ⟨w', hw1', hw2'⟩ := exists_between hj' refine' mellin_convergent_of_isBigO_scalar _ _ hw1' _ hw2 · simp_rw [mul_comm] refine' hfc.norm.mul_continuousOn _ isOpen_Ioi refine' Continuous.comp_continuousOn continuous_abs (continuousOn_log.mono _) exact subset_compl_singleton_iff.mpr not_mem_Ioi_self · refine (isBigO_rpow_top_log_smul hw2' hf_top).norm_left.congr_left fun t ↦ ?_ simp only [norm_smul, Real.norm_eq_abs] · refine (isBigO_rpow_zero_log_smul hw1 hf_bot).norm_left.congr_left fun t ↦ ?_ simp only [norm_smul, Real.norm_eq_abs] [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t ⊢ IntegrableOn bound (Ioi 0) [PROOFSTEP] simp_rw [add_mul, mul_assoc] [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t ⊢ IntegrableOn (fun t => t ^ (s.re + v - 1) * (|log t| * ‖f t‖) + t ^ (s.re - v - 1) * (|log t| * ‖f t‖)) (Ioi 0) [PROOFSTEP] suffices ∀ {j : ℝ} (hj : b < j) (hj' : j < a), IntegrableOn (fun t : ℝ => t ^ (j - 1) * (|log t| * ‖f t‖)) (Ioi 0) volume by refine' Integrable.add (this _ _) (this _ _) all_goals linarith [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t this : ∀ {j : ℝ}, b < j → j < a → IntegrableOn (fun t => t ^ (j - 1) * (|log t| * ‖f t‖)) (Ioi 0) ⊢ IntegrableOn (fun t => t ^ (s.re + v - 1) * (|log t| * ‖f t‖) + t ^ (s.re - v - 1) * (|log t| * ‖f t‖)) (Ioi 0) [PROOFSTEP] refine' Integrable.add (this _ _) (this _ _) [GOAL] case refine'_1 E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t this : ∀ {j : ℝ}, b < j → j < a → IntegrableOn (fun t => t ^ (j - 1) * (|log t| * ‖f t‖)) (Ioi 0) ⊢ b < s.re + v case refine'_2 E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t this : ∀ {j : ℝ}, b < j → j < a → IntegrableOn (fun t => t ^ (j - 1) * (|log t| * ‖f t‖)) (Ioi 0) ⊢ s.re + v < a case refine'_3 E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t this : ∀ {j : ℝ}, b < j → j < a → IntegrableOn (fun t => t ^ (j - 1) * (|log t| * ‖f t‖)) (Ioi 0) ⊢ b < s.re - v case refine'_4 E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t this : ∀ {j : ℝ}, b < j → j < a → IntegrableOn (fun t => t ^ (j - 1) * (|log t| * ‖f t‖)) (Ioi 0) ⊢ s.re - v < a [PROOFSTEP] all_goals linarith [GOAL] case refine'_1 E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t this : ∀ {j : ℝ}, b < j → j < a → IntegrableOn (fun t => t ^ (j - 1) * (|log t| * ‖f t‖)) (Ioi 0) ⊢ b < s.re + v [PROOFSTEP] linarith [GOAL] case refine'_2 E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t this : ∀ {j : ℝ}, b < j → j < a → IntegrableOn (fun t => t ^ (j - 1) * (|log t| * ‖f t‖)) (Ioi 0) ⊢ s.re + v < a [PROOFSTEP] linarith [GOAL] case refine'_3 E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t this : ∀ {j : ℝ}, b < j → j < a → IntegrableOn (fun t => t ^ (j - 1) * (|log t| * ‖f t‖)) (Ioi 0) ⊢ b < s.re - v [PROOFSTEP] linarith [GOAL] case refine'_4 E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t this : ∀ {j : ℝ}, b < j → j < a → IntegrableOn (fun t => t ^ (j - 1) * (|log t| * ‖f t‖)) (Ioi 0) ⊢ s.re - v < a [PROOFSTEP] linarith [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t ⊢ ∀ {j : ℝ}, b < j → j < a → IntegrableOn (fun t => t ^ (j - 1) * (|log t| * ‖f t‖)) (Ioi 0) [PROOFSTEP] intro j hj hj' [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t j : ℝ hj : b < j hj' : j < a ⊢ IntegrableOn (fun t => t ^ (j - 1) * (|log t| * ‖f t‖)) (Ioi 0) [PROOFSTEP] obtain ⟨w, hw1, hw2⟩ := exists_between hj [GOAL] case intro.intro E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t j : ℝ hj : b < j hj' : j < a w : ℝ hw1 : b < w hw2 : w < j ⊢ IntegrableOn (fun t => t ^ (j - 1) * (|log t| * ‖f t‖)) (Ioi 0) [PROOFSTEP] obtain ⟨w', hw1', hw2'⟩ := exists_between hj' [GOAL] case intro.intro.intro.intro E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t j : ℝ hj : b < j hj' : j < a w : ℝ hw1 : b < w hw2 : w < j w' : ℝ hw1' : j < w' hw2' : w' < a ⊢ IntegrableOn (fun t => t ^ (j - 1) * (|log t| * ‖f t‖)) (Ioi 0) [PROOFSTEP] refine' mellin_convergent_of_isBigO_scalar _ _ hw1' _ hw2 [GOAL] case intro.intro.intro.intro.refine'_1 E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t j : ℝ hj : b < j hj' : j < a w : ℝ hw1 : b < w hw2 : w < j w' : ℝ hw1' : j < w' hw2' : w' < a ⊢ LocallyIntegrableOn (fun t => |log t| * ‖f t‖) (Ioi 0) [PROOFSTEP] simp_rw [mul_comm] [GOAL] case intro.intro.intro.intro.refine'_1 E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t j : ℝ hj : b < j hj' : j < a w : ℝ hw1 : b < w hw2 : w < j w' : ℝ hw1' : j < w' hw2' : w' < a ⊢ LocallyIntegrableOn (fun t => ‖f t‖ * |log t|) (Ioi 0) [PROOFSTEP] refine' hfc.norm.mul_continuousOn _ isOpen_Ioi [GOAL] case intro.intro.intro.intro.refine'_1 E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t j : ℝ hj : b < j hj' : j < a w : ℝ hw1 : b < w hw2 : w < j w' : ℝ hw1' : j < w' hw2' : w' < a ⊢ ContinuousOn (fun t => |log t|) (Ioi 0) [PROOFSTEP] refine' Continuous.comp_continuousOn continuous_abs (continuousOn_log.mono _) [GOAL] case intro.intro.intro.intro.refine'_1 E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t j : ℝ hj : b < j hj' : j < a w : ℝ hw1 : b < w hw2 : w < j w' : ℝ hw1' : j < w' hw2' : w' < a ⊢ Ioi 0 ⊆ {0}ᶜ [PROOFSTEP] exact subset_compl_singleton_iff.mpr not_mem_Ioi_self [GOAL] case intro.intro.intro.intro.refine'_2 E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t j : ℝ hj : b < j hj' : j < a w : ℝ hw1 : b < w hw2 : w < j w' : ℝ hw1' : j < w' hw2' : w' < a ⊢ (fun t => |log t| * ‖f t‖) =O[atTop] fun x => x ^ (-w') [PROOFSTEP] refine (isBigO_rpow_top_log_smul hw2' hf_top).norm_left.congr_left fun t ↦ ?_ [GOAL] case intro.intro.intro.intro.refine'_2 E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t j : ℝ hj : b < j hj' : j < a w : ℝ hw1 : b < w hw2 : w < j w' : ℝ hw1' : j < w' hw2' : w' < a t : ℝ ⊢ ‖log t • f t‖ = |log t| * ‖f t‖ [PROOFSTEP] simp only [norm_smul, Real.norm_eq_abs] [GOAL] case intro.intro.intro.intro.refine'_3 E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t j : ℝ hj : b < j hj' : j < a w : ℝ hw1 : b < w hw2 : w < j w' : ℝ hw1' : j < w' hw2' : w' < a ⊢ (fun t => |log t| * ‖f t‖) =O[𝓝[Ioi 0] 0] fun x => x ^ (-w) [PROOFSTEP] refine (isBigO_rpow_zero_log_smul hw1 hf_bot).norm_left.congr_left fun t ↦ ?_ [GOAL] case intro.intro.intro.intro.refine'_3 E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t j : ℝ hj : b < j hj' : j < a w : ℝ hw1 : b < w hw2 : w < j w' : ℝ hw1' : j < w' hw2' : w' < a t : ℝ ⊢ ‖log t • f t‖ = |log t| * ‖f t‖ [PROOFSTEP] simp only [norm_smul, Real.norm_eq_abs] [GOAL] case intro.intro.intro E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t h5 : IntegrableOn bound (Ioi 0) ⊢ MellinConvergent (fun t => log t • f t) s ∧ HasDerivAt (mellin f) (mellin (fun t => log t • f t) s) s [PROOFSTEP] have h6 : ∀ᵐ t : ℝ ∂volume.restrict (Ioi 0), ∀ y : ℂ, y ∈ Metric.ball s v → HasDerivAt (fun z : ℂ => F z t) (F' y t) y := by refine' (ae_restrict_mem measurableSet_Ioi).mono fun t ht y _ => _ have ht' : (t : ℂ) ≠ 0 := ofReal_ne_zero.mpr (ne_of_gt ht) have u1 : HasDerivAt (fun z : ℂ => (t : ℂ) ^ (z - 1)) (t ^ (y - 1) * log t) y := by convert ((hasDerivAt_id' y).sub_const 1).const_cpow (Or.inl ht') using 1 rw [ofReal_log (le_of_lt ht)] ring exact u1.smul_const (f t) [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t h5 : IntegrableOn bound (Ioi 0) ⊢ ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (y : ℂ), y ∈ Metric.ball s v → HasDerivAt (fun z => F z t) (F' y t) y [PROOFSTEP] refine' (ae_restrict_mem measurableSet_Ioi).mono fun t ht y _ => _ [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t h5 : IntegrableOn bound (Ioi 0) t : ℝ ht : t ∈ Ioi 0 y : ℂ x✝ : y ∈ Metric.ball s v ⊢ HasDerivAt (fun z => F z t) (F' y t) y [PROOFSTEP] have ht' : (t : ℂ) ≠ 0 := ofReal_ne_zero.mpr (ne_of_gt ht) [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t h5 : IntegrableOn bound (Ioi 0) t : ℝ ht : t ∈ Ioi 0 y : ℂ x✝ : y ∈ Metric.ball s v ht' : ↑t ≠ 0 ⊢ HasDerivAt (fun z => F z t) (F' y t) y [PROOFSTEP] have u1 : HasDerivAt (fun z : ℂ => (t : ℂ) ^ (z - 1)) (t ^ (y - 1) * log t) y := by convert ((hasDerivAt_id' y).sub_const 1).const_cpow (Or.inl ht') using 1 rw [ofReal_log (le_of_lt ht)] ring [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t h5 : IntegrableOn bound (Ioi 0) t : ℝ ht : t ∈ Ioi 0 y : ℂ x✝ : y ∈ Metric.ball s v ht' : ↑t ≠ 0 ⊢ HasDerivAt (fun z => ↑t ^ (z - 1)) (↑t ^ (y - 1) * ↑(log t)) y [PROOFSTEP] convert ((hasDerivAt_id' y).sub_const 1).const_cpow (Or.inl ht') using 1 [GOAL] case h.e'_7 E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t h5 : IntegrableOn bound (Ioi 0) t : ℝ ht : t ∈ Ioi 0 y : ℂ x✝ : y ∈ Metric.ball s v ht' : ↑t ≠ 0 ⊢ ↑t ^ (y - 1) * ↑(log t) = ↑t ^ (y - 1) * Complex.log ↑t * 1 [PROOFSTEP] rw [ofReal_log (le_of_lt ht)] [GOAL] case h.e'_7 E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t h5 : IntegrableOn bound (Ioi 0) t : ℝ ht : t ∈ Ioi 0 y : ℂ x✝ : y ∈ Metric.ball s v ht' : ↑t ≠ 0 ⊢ ↑t ^ (y - 1) * Complex.log ↑t = ↑t ^ (y - 1) * Complex.log ↑t * 1 [PROOFSTEP] ring [GOAL] E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t h5 : IntegrableOn bound (Ioi 0) t : ℝ ht : t ∈ Ioi 0 y : ℂ x✝ : y ∈ Metric.ball s v ht' : ↑t ≠ 0 u1 : HasDerivAt (fun z => ↑t ^ (z - 1)) (↑t ^ (y - 1) * ↑(log t)) y ⊢ HasDerivAt (fun z => F z t) (F' y t) y [PROOFSTEP] exact u1.smul_const (f t) [GOAL] case intro.intro.intro E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t h5 : IntegrableOn bound (Ioi 0) h6 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (y : ℂ), y ∈ Metric.ball s v → HasDerivAt (fun z => F z t) (F' y t) y ⊢ MellinConvergent (fun t => log t • f t) s ∧ HasDerivAt (mellin f) (mellin (fun t => log t • f t) s) s [PROOFSTEP] have main := hasDerivAt_integral_of_dominated_loc_of_deriv_le hv0 h1 h2 h3 h4 h5 h6 [GOAL] case intro.intro.intro E : Type u_1 inst✝² : NormedAddCommGroup E inst✝¹ : CompleteSpace E inst✝ : NormedSpace ℂ E a b : ℝ f : ℝ → E s : ℂ hfc : LocallyIntegrableOn f (Ioi 0) hf_top : f =O[atTop] fun x => x ^ (-a) hs_top : s.re < a hf_bot : f =O[𝓝[Ioi 0] 0] fun x => x ^ (-b) hs_bot : b < s.re F : ℂ → ℝ → E := fun z t => ↑t ^ (z - 1) • f t F' : ℂ → ℝ → E := fun z t => (↑t ^ (z - 1) * ↑(log t)) • f t v : ℝ hv0 : 0 < v hv1 : v < s.re - b hv2 : v < a - s.re bound : ℝ → ℝ := fun t => (t ^ (s.re + v - 1) + t ^ (s.re - v - 1)) * |log t| * ‖f t‖ h1 : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) (Measure.restrict volume (Ioi 0)) h2 : IntegrableOn (F s) (Ioi 0) h3 : AEStronglyMeasurable (F' s) (Measure.restrict volume (Ioi 0)) h4 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (z : ℂ), z ∈ Metric.ball s v → ‖F' z t‖ ≤ bound t h5 : IntegrableOn bound (Ioi 0) h6 : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ∀ (y : ℂ), y ∈ Metric.ball s v → HasDerivAt (fun z => F z t) (F' y t) y main : Integrable (F' s) ∧ HasDerivAt (fun n => ∫ (a : ℝ) in Ioi 0, F n a) (∫ (a : ℝ) in Ioi 0, F' s a) s ⊢ MellinConvergent (fun t => log t • f t) s ∧ HasDerivAt (mellin f) (mellin (fun t => log t • f t) s) s [PROOFSTEP] simpa only [mul_smul] using main [GOAL] E : Type u_1 inst✝ : NormedAddCommGroup E s : ℂ hs : 0 < s.re ⊢ HasMellin (indicator (Ioc 0 1) fun x => 1) s (1 / s) [PROOFSTEP] have aux1 : -1 < (s - 1).re := by simpa only [sub_re, one_re, sub_eq_add_neg] using lt_add_of_pos_left _ hs [GOAL] E : Type u_1 inst✝ : NormedAddCommGroup E s : ℂ hs : 0 < s.re ⊢ -1 < (s - 1).re [PROOFSTEP] simpa only [sub_re, one_re, sub_eq_add_neg] using lt_add_of_pos_left _ hs [GOAL] E : Type u_1 inst✝ : NormedAddCommGroup E s : ℂ hs : 0 < s.re aux1 : -1 < (s - 1).re ⊢ HasMellin (indicator (Ioc 0 1) fun x => 1) s (1 / s) [PROOFSTEP] have aux2 : s ≠ 0 := by contrapose! hs; rw [hs, zero_re] [GOAL] E : Type u_1 inst✝ : NormedAddCommGroup E s : ℂ hs : 0 < s.re aux1 : -1 < (s - 1).re ⊢ s ≠ 0 [PROOFSTEP] contrapose! hs [GOAL] E : Type u_1 inst✝ : NormedAddCommGroup E s : ℂ aux1 : -1 < (s - 1).re hs : s = 0 ⊢ s.re ≤ 0 [PROOFSTEP] rw [hs, zero_re] [GOAL] E : Type u_1 inst✝ : NormedAddCommGroup E s : ℂ hs : 0 < s.re aux1 : -1 < (s - 1).re aux2 : s ≠ 0 ⊢ HasMellin (indicator (Ioc 0 1) fun x => 1) s (1 / s) [PROOFSTEP] have aux3 : MeasurableSet (Ioc (0 : ℝ) 1) := measurableSet_Ioc [GOAL] E : Type u_1 inst✝ : NormedAddCommGroup E s : ℂ hs : 0 < s.re aux1 : -1 < (s - 1).re aux2 : s ≠ 0 aux3 : MeasurableSet (Ioc 0 1) ⊢ HasMellin (indicator (Ioc 0 1) fun x => 1) s (1 / s) [PROOFSTEP] simp_rw [HasMellin, mellin, MellinConvergent, ← indicator_smul, IntegrableOn, integrable_indicator_iff aux3, smul_eq_mul, integral_indicator aux3, mul_one, IntegrableOn, Measure.restrict_restrict_of_subset Ioc_subset_Ioi_self] [GOAL] E : Type u_1 inst✝ : NormedAddCommGroup E s : ℂ hs : 0 < s.re aux1 : -1 < (s - 1).re aux2 : s ≠ 0 aux3 : MeasurableSet (Ioc 0 1) ⊢ (Integrable fun x => ↑x ^ (s - 1)) ∧ ∫ (x : ℝ) in Ioc 0 1, ↑x ^ (s - 1) = 1 / s [PROOFSTEP] rw [← IntegrableOn, ← intervalIntegrable_iff_integrable_Ioc_of_le zero_le_one] [GOAL] E : Type u_1 inst✝ : NormedAddCommGroup E s : ℂ hs : 0 < s.re aux1 : -1 < (s - 1).re aux2 : s ≠ 0 aux3 : MeasurableSet (Ioc 0 1) ⊢ IntervalIntegrable (fun x => ↑x ^ (s - 1)) volume 0 1 ∧ ∫ (x : ℝ) in Ioc 0 1, ↑x ^ (s - 1) = 1 / s [PROOFSTEP] refine' ⟨intervalIntegral.intervalIntegrable_cpow' aux1, _⟩ [GOAL] E : Type u_1 inst✝ : NormedAddCommGroup E s : ℂ hs : 0 < s.re aux1 : -1 < (s - 1).re aux2 : s ≠ 0 aux3 : MeasurableSet (Ioc 0 1) ⊢ ∫ (x : ℝ) in Ioc 0 1, ↑x ^ (s - 1) = 1 / s [PROOFSTEP] rw [← intervalIntegral.integral_of_le zero_le_one, integral_cpow (Or.inl aux1), sub_add_cancel, ofReal_zero, ofReal_one, one_cpow, zero_cpow aux2, sub_zero] [GOAL] E : Type u_1 inst✝ : NormedAddCommGroup E a s : ℂ hs : 0 < s.re + a.re ⊢ HasMellin (indicator (Ioc 0 1) fun t => ↑t ^ a) s (1 / (s + a)) [PROOFSTEP] have := hasMellin_one_Ioc (by rwa [add_re] : 0 < (s + a).re) [GOAL] E : Type u_1 inst✝ : NormedAddCommGroup E a s : ℂ hs : 0 < s.re + a.re ⊢ 0 < (s + a).re [PROOFSTEP] rwa [add_re] [GOAL] E : Type u_1 inst✝ : NormedAddCommGroup E a s : ℂ hs : 0 < s.re + a.re this : HasMellin (indicator (Ioc 0 1) fun x => 1) (s + a) (1 / (s + a)) ⊢ HasMellin (indicator (Ioc 0 1) fun t => ↑t ^ a) s (1 / (s + a)) [PROOFSTEP] simp_rw [HasMellin, ← MellinConvergent.cpow_smul, ← mellin_cpow_smul, ← indicator_smul, smul_eq_mul, mul_one] at this [GOAL] E : Type u_1 inst✝ : NormedAddCommGroup E a s : ℂ hs : 0 < s.re + a.re this : MellinConvergent (indicator (Ioc 0 1) fun x => ↑x ^ a) s ∧ mellin (indicator (Ioc 0 1) fun x => ↑x ^ a) s = 1 / (s + a) ⊢ HasMellin (indicator (Ioc 0 1) fun t => ↑t ^ a) s (1 / (s + a)) [PROOFSTEP] exact this
(* Title: The Calculus of Communicating Systems Author/Maintainer: Jesper Bengtson ([email protected]), 2012 *) theory Weak_Bisim_Pres imports Weak_Bisim Weak_Sim_Pres Strong_Bisim_SC begin lemma actPres: fixes P :: ccs and Q :: ccs and \<alpha> :: act assumes "P \<approx> Q" shows "\<alpha>.(P) \<approx> \<alpha>.(Q)" proof - let ?X = "{(\<alpha>.(P), \<alpha>.(Q)) | P Q. P \<approx> Q}" from assms have "(\<alpha>.(P), \<alpha>.(Q)) \<in> ?X" by auto thus ?thesis by(coinduct rule: weakBisimulationCoinduct) (auto dest: weakBisimulationE intro: actPres) qed lemma parPres: fixes P :: ccs and Q :: ccs and R :: ccs assumes "P \<approx> Q" shows "P \<parallel> R \<approx> Q \<parallel> R" proof - let ?X = "{(P \<parallel> R, Q \<parallel> R) | P Q R. P \<approx> Q}" from assms have "(P \<parallel> R, Q \<parallel> R) \<in> ?X" by blast thus ?thesis by(coinduct rule: weakBisimulationCoinduct, auto) (blast intro: parPres dest: weakBisimulationE)+ qed assumes "P \<approx> Q" shows "\<lparr>\<nu>x\<rparr>P \<approx> \<lparr>\<nu>x\<rparr>Q" proof - let ?X = "{(\<lparr>\<nu>x\<rparr>P, \<lparr>\<nu>x\<rparr>Q) | x P Q. P \<approx> Q}" from assms have "(\<lparr>\<nu>x\<rparr>P, \<lparr>\<nu>x\<rparr>Q) \<in> ?X" by auto thus ?thesis by(coinduct rule: weakBisimulationCoinduct) (auto intro: resPres dest: weakBisimulationE) qed assumes "P \<approx> Q" shows "!P \<approx> !Q" proof - let ?X = "bangRel weakBisimulation" let ?Y = "weakBisimulation O ?X O bisim" { fix R T P Q assume "R \<approx> T" and "(P, Q) \<in> ?Y" from \<open>(P, Q) \<in> ?Y\<close> obtain P' Q' where "P \<approx> P'" and "(P', Q') \<in> ?X" and "Q' \<sim> Q" by auto from \<open>P \<approx> P'\<close> have "R \<parallel> P \<approx> R \<parallel> P'" by(metis parPres bisimWeakBisimulation transitive parComm) moreover from \<open>R \<approx> T\<close> \<open>(P', Q') \<in> ?X\<close> have "(R \<parallel> P', T \<parallel> Q') \<in> ?X" by(auto dest: BRPar) moreover from \<open>Q' \<sim> Q\<close> have "T \<parallel> Q' \<sim> T \<parallel> Q" by(metis Strong_Bisim_Pres.parPres Strong_Bisim.transitive parComm) ultimately have "(R \<parallel> P, T \<parallel> Q) \<in> ?Y" by auto } note BRParAux = this from assms have "(!P, !Q) \<in> ?X" by(auto intro: BRBang) thus ?thesis proof(coinduct rule: weakBisimWeakUpto) case(cSim P Q) from \<open>(P, Q) \<in> bangRel weakBisimulation\<close> show ?case proof(induct) case(BRBang P Q) note \<open>P \<approx> Q\<close> weakBisimulationE(1) BRParAux moreover have "?X \<subseteq> ?Y" by(auto intro: Strong_Bisim.reflexive reflexive) moreover { fix P Q assume "(P \<parallel> !P, Q) \<in> ?Y" hence "(!P, Q) \<in> ?Y" using bangUnfold by(blast dest: Strong_Bisim.transitive transitive bisimWeakBisimulation) } ultimately show ?case by(rule bangPres) next case(BRPar R T P Q) from \<open>R \<approx> T\<close> have "R \<leadsto>\<^sup>^<weakBisimulation> T" by(rule weakBisimulationE) moreover note \<open>R \<approx> T\<close> \<open>P \<leadsto>\<^sup>^<?Y> Q\<close> moreover from \<open>(P, Q) \<in> ?X\<close> have "(P, Q) \<in> ?Y" by(blast intro: Strong_Bisim.reflexive reflexive) ultimately show ?case using BRParAux by(rule Weak_Sim_Pres.parPresAux) qed next case(cSym P Q) thus ?case by induct (auto dest: weakBisimulationE intro: BRPar BRBang) qed qed end
module Main %language TypeProviders implicit intString : Int -> String intString = show f : Int f = the Int 2 main : IO () main = do args <- getArgs case args of -- one arg followed by another arg, followed by one or many args (_ :: arg :: _) => putStrLn arg -- exactly one arg: -- [_, arg, _] => putStrLn arg _ => putStrLn $ show $ f -- "need some args" -- type providers strToType : String -> Type strToType "Int" = Int strToType _ = Nat fromFile : String -> IO (Provider Type) fromFile fname = do str <- readFile fname case str of Right value => return (Provide (strToType (trim value))) _ => return (Error "fail") %provide (T1 : Type) with fromFile "theType" foo : T1 foo = 1 -- hlists namespace HList data HList : List Type -> Type where Nil : HList [] (::) : a -> HList xs -> HList (a :: xs) t: Integer -> Integer t x = x * 2 hhead: HList(t :: ts) -> t --Type -> Type -- HList hhead (l :: _) = l htail: HList(t :: ts) -> HList ts --Type -> Type -- HList htail (_ :: tail) = tail hmap: {F: Type -> Type} -> ({a: Type} -> a -> F a) -> HList ts -> HList(map F ts) hmap f [] = [] hmap f (x :: xs) = f x :: (hmap f xs)
function [g,a]=ar1nv(x) % AR1NV - Estimate the parameters for an AR(1) model % Syntax: [g,a]=ar1nv(x); % % Input: x - a time series. % % Output: g - estimate of the lag-one autocorrelation. % a - estimate of the noise variance. % (c) Eric Breitenberger x=x(:); N=length(x); m=mean(x); x=x-m; % Lag zero and one covariance estimates: c0=x'*x/N; c1=x(1:N-1)'*x(2:N)/(N-1); g=c1/c0; a=sqrt((1-g^2)*c0);
lemma closed_subspace: fixes s :: "'a::euclidean_space set" assumes "subspace s" shows "closed s"
module Serializer where open import Data.List open import Data.Fin hiding (_+_) open import Data.Nat open import Data.Product open import Data.Bool open import Function using (_∘_ ; _$_ ; _∋_) open import Function.Injection hiding (_∘_) open import Function.Surjection hiding (_∘_) open import Function.Bijection hiding (_∘_) open import Relation.Binary.PropositionalEquality hiding ( [_] ) open import Reflection open import Helper.Fin open import Helper.CodeGeneration ----------------------------------- -- Generic ----------------------------------- -- Finite record Serializer (T : Set) : Set where constructor serializer field size : ℕ from : T -> Fin size to : Fin size -> T bijection : Bijection (setoid T) (setoid (Fin size))
module Erlang.Data.Ref import public Erlang.Data.IORef import public Erlang.Control.Monad.ST %default total public export interface Ref m (r : Type -> Type) | m where newRef : a -> m (r a) readRef : r a -> m a writeRef : r a -> a -> m () export HasIO io => Ref io IORef where newRef = newIORef readRef = readIORef writeRef = writeIORef export Ref (ST s) (STRef s) where newRef = newSTRef readRef = readSTRef writeRef = writeSTRef
lemma continuous_le_on_closure: fixes a::real assumes f: "continuous_on (closure s) f" and x: "x \<in> closure(s)" and xlo: "\<And>x. x \<in> s ==> f(x) \<le> a" shows "f(x) \<le> a"
module Adder AdderType : (numargs : Nat) -> Type -> Type AdderType Z numType = numType AdderType (S k) numType = (next : numType) -> AdderType k numType adder : Num num => (numargs : Nat) -> (acc : num) -> AdderType numargs num adder Z acc = acc adder (S k) acc = \i => adder k (i + acc)
Formal statement is: lemma lim_inverse_n: "((\<lambda>n. inverse(of_nat n)) \<longlongrightarrow> (0::'a::real_normed_field)) sequentially" Informal statement is: The sequence $\frac{1}{n}$ converges to $0$.
function b = legcoeffs(f, varargin) %LEGCOEFFS Compute Legendre series coefficients of a BNDFUN object. % B = LEGCOEFFS(F) returns the Legendre series coefficients of BNDFUN F, so % that F = B(N+1)*P_N + ... + B(1)*P_0, where P_k is the kth Legendre % polynomial (scaled to the domain of F). % % If F is an array-valued BNDFUN, then a matrix of coefficients is returned so % that F(:,k) = B(N+1,k)*P_N + ... + B(1,k)*P_0. % % See also CHEBCOEFFS. % Copyright 2017 by The University of Oxford and The Chebfun Developers. % See http://www.chebfun.org/ for Chebfun information. b = legcoeffs(f.onefun, varargin{:}); end
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeOperators #-} module Numeric.Optimization.TwoPhase.Tableau.Build ( IsBuilder , mkTable ) where import Prelude hiding ((++)) import qualified Data.List as List import Data.Maybe (fromJust) import qualified Data.Vector.Sized as Vec import Data.Vector.Storable.Sized (Vector, (++)) import qualified Data.Vector.Storable.Sized as SVec import GHC.TypeLits import Numeric.LinearAlgebra.Static (L) import qualified Numeric.LinearAlgebra.Static as LS import qualified Numeric.LinearAlgebra.Static.Vector as LS import Numeric.Optimization.Problem import Numeric.Optimization.TwoPhase.Types type IsBuilder v s a c = ( KnownNat v , KnownNat s , KnownNat a , KnownNat c ) data Builder (v :: Nat) (s :: Nat) (a :: Nat) (c :: Nat) = Builder { slackSupply :: [Vector s Double] , artificialSupply :: [Vector a Double] , rowsBuilt :: [Vector (Cols 'PhaseI v s a) Double] , adjustmentsBuilt :: [Vector (Cols 'PhaseI v s a) Double] } mkBuilder :: (IsBuilder v s a c) => Builder v s a c mkBuilder = Builder slackI artificialI [] [] where slackI = reverse . fmap LS.rVec . LS.toRows $ LS.eye artificialI = reverse . fmap LS.rVec . LS.toRows $ LS.eye buildPhaseI :: forall v s a c. (IsBuilder v s a c) => Builder v s a c -> Builder v s a c buildPhaseI acc = acc { rowsBuilt = row : rowsBuilt acc } where row = SVec.snoc (os ++ xs ++ ss ++ as) 0 os = SVec.fromTuple (1, 0) xs = SVec.replicate @v 0 ss = SVec.replicate @s 0 as = SVec.replicate @a (-1) buildPhaseII :: forall v s a c. (IsBuilder v s a c) => Builder v s a c -> Coeffs v -> Builder v s a c buildPhaseII acc xs' = acc { rowsBuilt = row : rowsBuilt acc } where row = SVec.snoc (os ++ xs ++ ss ++ as) 0 os = SVec.fromTuple (0, 1) xs = SVec.map negate xs' ss = SVec.replicate @s 0 as = SVec.replicate @a 0 buildObjective :: (IsBuilder v s a c) => Builder v s a c -> Coeffs v -> Builder v s a c buildObjective acc = buildPhaseI . buildPhaseII acc buildLEQ :: forall v s a c. (IsBuilder v s a c) => Builder v s a c -> Coeffs v -> Double -> Builder v s a c buildLEQ acc xs rhs = acc { slackSupply = tail (slackSupply acc) , rowsBuilt = row : rowsBuilt acc } where row = SVec.snoc (os ++ xs ++ ss ++ as) rhs os = SVec.fromTuple (0, 0) ss = head (slackSupply acc) as = SVec.replicate @a 0 buildGEQ :: forall v s a c. (IsBuilder v s a c) => Builder v s a c -> Coeffs v -> Double -> Builder v s a c buildGEQ acc xs' rhs' = acc { slackSupply = tail (slackSupply acc) , artificialSupply = tail (artificialSupply acc) , rowsBuilt = row : rowsBuilt acc } where row = SVec.snoc (os ++ xs ++ ss ++ as) rhs os = SVec.fromTuple (0, 0) xs = SVec.map negate xs' ss = head (slackSupply acc) as = head (artificialSupply acc) rhs = negate rhs' buildEQU :: forall v s a c. (IsBuilder v s a c) => Builder v s a c -> Coeffs v -> Double -> Builder v s a c buildEQU acc xs rhs = acc { artificialSupply = tail (artificialSupply acc) , rowsBuilt = row : rowsBuilt acc , adjustmentsBuilt = row : adjustmentsBuilt acc } where row = SVec.snoc (os ++ xs ++ ss ++ as) rhs os = SVec.fromTuple (0, 0) ss = SVec.replicate @s 0 as = head (artificialSupply acc) buildConstraint :: (IsBuilder v s a c) => Builder v s a c -> Constraint v x y -> Builder v s a c buildConstraint acc (xs :< y) = buildLEQ acc xs y buildConstraint acc (xs :> y) = buildGEQ acc xs y buildConstraint acc (xs := y) = buildEQU acc xs y toMatrix :: forall v s a c. (IsBuilder v s a c) => Builder v s a c -> L (Rows 'PhaseI c) (Cols 'PhaseI v s a) toMatrix acc = LS.rowsL . fromJust . Vec.fromList $ fmap LS.vecR adjusted where rows = rowsBuilt acc adjusts = adjustmentsBuilt acc adjusted = case adjusts of [] -> rows xs -> let oldObjP1 = head rows newObjP1 = List.foldl1' (SVec.zipWith (+)) (oldObjP1 : xs) in newObjP1 : tail rows mkTable :: forall d v s a c. (IsBuilder v s a c) => Problem d v s a c -> L (Rows 'PhaseI c) (Cols 'PhaseI v s a) mkTable = toMatrix . go mkBuilder where go :: Builder v s a c -> Problem d v x y z -> Builder v s a c go acc (Maximize xs) = buildObjective acc xs go acc (Minimize xs) = buildObjective acc xs go acc (SuchThat p c) = go (buildConstraint acc c) p
State Before: F : Type ?u.147946 α : Type u_1 β : Type ?u.147952 inst✝¹ : LinearOrderedRing α inst✝ : FloorRing α z : ℤ a✝ a : α m : ℤ ⊢ fract (a - ↑m) = fract a State After: F : Type ?u.147946 α : Type u_1 β : Type ?u.147952 inst✝¹ : LinearOrderedRing α inst✝ : FloorRing α z : ℤ a✝ a : α m : ℤ ⊢ a - ↑m - ↑⌊a - ↑m⌋ = fract a Tactic: rw [fract] State Before: F : Type ?u.147946 α : Type u_1 β : Type ?u.147952 inst✝¹ : LinearOrderedRing α inst✝ : FloorRing α z : ℤ a✝ a : α m : ℤ ⊢ a - ↑m - ↑⌊a - ↑m⌋ = fract a State After: no goals Tactic: simp
The imaginary part of the sum of a function $f$ over a set $s$ is equal to the sum of the imaginary parts of $f$ over $s$.
lemma Sup_insert: fixes S :: "real set" shows "bounded S \<Longrightarrow> Sup (insert x S) = (if S = {} then x else max x (Sup S))"
module Imports.Test where open import Common.Level record Foo (ℓ : Level) : Set ℓ where
Formal statement is: lemma mult: "f1 \<in> L F (g1) \<Longrightarrow> f2 \<in> L F (g2) \<Longrightarrow> (\<lambda>x. f1 x * f2 x) \<in> L F (\<lambda>x. g1 x * g2 x)" Informal statement is: If $f_1$ is Lebesgue integrable with respect to $g_1$ and $f_2$ is Lebesgue integrable with respect to $g_2$, then $f_1 f_2$ is Lebesgue integrable with respect to $g_1 g_2$.
lemma complete_isometric_image: assumes "0 < e" and s: "subspace s" and f: "bounded_linear f" and normf: "\<forall>x\<in>s. norm(f x) \<ge> e * norm(x)" and cs: "complete s" shows "complete (f ` s)"
export Unconstrained, Polygonal, nextboundary abstract type Domain end """ Unconstrained Signature of domains without boundaries. """ struct Unconstrained <: Domain end """ Polygonal Encapsulate a domain with polygonal boundaries. The boundaries are defined with the normals to the facets and the intercepts of the corresponding hyperplanes. """ struct Polygonal <: Domain normals::Matrix{Real} # dim CxD where C=#constraints, D=#features intercepts::Vector{Real} # dim C end # ----------------------------------------------------------------------------- """ nextboundary(ud::Unconstrained, x, v) Return (NaN, NaN) corresponding to the unconstrained case. """ function nextboundary(ud::Unconstrained, x::Vector{<:Real}, v::Vector{<:Real}) return (NaN, NaN) end """ nextboundary(pd::Polygonal, x, v) Return the time of next boundary hit along the current trajectory when the domain is polygonal and return the normal of the corresponding boundary. The current point is `x` and the velocity `v`. """ function nextboundary(pd::Polygonal, x::Vector{<:Real}, v::Vector{<:Real}) # hitting time along trajectory (x+tv) for a boundary (normal,intercept) is # t = intercept/(normal dot v) - (x dot normal)/(normal dot v) nsv = pd.normals * v hits = (pd.intercepts - pd.normals * x) ./ nsv # hard threshold times with nsv ~ 0 (near-parallel case), # remove negative times and times ~ 0 (for numerical stability) mask = map(|, abs.(nsv) .< 1e-10, hits .< 1e-10) for (i, e) ∈ enumerate(mask) e && (hits[i] = Inf) end # get time of hit + index of corresponding boundary (t_hit, j) = findmin(hits) # return time of hit + normal vector to boundary (t_hit, pd.normals[j, :]) end
repeat process ACV_portals { /scoreboard players set @e[type=arrow,c=1] ACV_COLOR 0 {inGround:1b,damage:5.5} /scoreboard players set @e[type=arrow,c=1] ACV_COLOR 1 {inGround:1b,damage:6.0} /scoreboard players set @e[type=arrow,c=1] ACV_COLOR 2 {inGround:1b,damage:6.5} /scoreboard players set @e[type=arrow,c=1] ACV_COLOR 3 {inGround:1b,damage:7.0} /execute @e[type=arrow,score_ACV_COLOR_min=0] ~ ~ ~ summon area_effect_cloud ~ ~ ~ {CustomName:"ACV_Main",Duration:2147483647} /execute @e[type=arrow,score_ACV_COLOR_min=0] ~ ~ ~ scoreboard players operation @e[type=area_effect_cloud,name=ACV_Main,r=0,c=1] ACV_COLOR = @e[type=arrow,score_ACV_COLOR_min=0,c=1] ACV_COLOR /kill @e[type=arrow,score_ACV_COLOR_min=0] conditional: start ACV_processMain } impulse process ACV_processMain { /execute @e[type=area_effect_cloud,name=ACV_Main] ~ ~ ~ summon area_effect_cloud ~ ~0.9 ~ {CustomName:"ACV_Up",Duration:2147483647} /execute @e[type=area_effect_cloud,name=ACV_Main] ~ ~ ~ summon area_effect_cloud ~ ~-1.45 ~ {CustomName:"ACV_Down",Duration:2147483647} /execute @e[type=area_effect_cloud,name=ACV_Main] ~ ~ ~ summon area_effect_cloud ~ ~ ~0.95 {CustomName:"ACV_South",Duration:2147483647} /execute @e[type=area_effect_cloud,name=ACV_Main] ~ ~ ~ summon area_effect_cloud ~0.95 ~ ~ {CustomName:"ACV_East",Duration:2147483647} /execute @e[type=area_effect_cloud,name=ACV_Main] ~ ~ ~ summon area_effect_cloud ~ ~ ~-0.95 {CustomName:"ACV_North",Duration:2147483647} /execute @e[type=area_effect_cloud,name=ACV_Main] ~ ~ ~ summon area_effect_cloud ~-0.95 ~ ~ {CustomName:"ACV_West",Duration:2147483647} /execute @e[type=area_effect_cloud,name=ACV_Main] ~ ~ ~ scoreboard players tag @e[type=area_effect_cloud,name=!ACV_Main,dy=0] add ACV_Direction /kill @e[type=area_effect_cloud,name=ACV_Up,tag=!ACV_Direction] /kill @e[type=area_effect_cloud,name=ACV_Down,tag=!ACV_Direction] /kill @e[type=area_effect_cloud,name=ACV_South,tag=!ACV_Direction] /kill @e[type=area_effect_cloud,name=ACV_East,tag=!ACV_Direction] /kill @e[type=area_effect_cloud,name=ACV_North,tag=!ACV_Direction] /kill @e[type=area_effect_cloud,name=ACV_West,tag=!ACV_Direction] /tp @e[type=area_effect_cloud,name=ACV_Down] ~ ~1 ~ ACV_createPortals() }
module STREAMBenchmark using BenchmarkTools using Statistics, Downloads using Base.Threads: nthreads, @threads using LoopVectorization include("kernels_allthreads.jl") include("kernels_nothreads.jl") include("kernels_nthreads.jl") include("benchmarks.jl") include("original.jl") export memory_bandwidth, benchmark, scaling_benchmark end
lemma translation_assoc: fixes a b :: "'a::ab_group_add" shows "(\<lambda>x. b + x) ` ((\<lambda>x. a + x) ` S) = (\<lambda>x. (a + b) + x) ` S"
Require Vector. Require Import Relation_Operators. Require Import List. Set Implicit Arguments. (* Defining terms over order-sorted labels, including subsorting, overloading, and associativity as in K. This is a step towards allowing a deep embedding of K definitions. *) Inductive Sorts := MkSorts { num_sorts : nat; sort : Set := Fin.t num_sorts; subsorts : list (sort * sort) }. Print Relation_Definitions. Definition subsort (s:Sorts) : sort s -> sort s -> Prop := clos_refl_trans _ (fun a b => In (a,b) (subsorts s)). Inductive SortModel (s : Sorts) : Type := MkSortModel { sort_impls : Vector.t Set (num_sorts s) ; sort_impl : sort s -> Set := Vector.nth sort_impls ; inj_impl : forall (s1 s2 : sort s) (H : subsort s1 s2), Vector.nth sort_impls s1 -> Vector.nth sort_impls s2 ; inj_coh : forall (s1 s2 s3 : sort s) H12 H23 H13 x, @inj_impl s2 s3 H23 (@inj_impl s1 s2 H12 x) = @inj_impl s1 s3 H13 x }. Inductive LabelDef (s : Sorts) := MkLabelDef { arity : nat; sigs : list (sort s * Vector.t (sort s) arity) }. Inductive Labels := MkLabels { sorts : Sorts ; labels : list (LabelDef sorts) }. Fixpoint fin_ix {A : Type} (l : list A) (ix : Fin.t (length l)) : A := match l return Fin.t (length l) -> A with | (x :: l') => fun ix => match ix in Fin.t n return n = S (length l') -> A with | Fin.F1 _ => fun _ => x | Fin.FS _ ix' => fun H => fin_ix l' (eq_rec _ Fin.t ix' _ (eq_add_S _ _ H)) end (eq_refl _) | nil => fun ix => match ix with end end ix. Inductive LabelInstance (l : Labels) : Set := MkLabelInstance { label_ix : Fin.t (length (labels l)) ; label_def := fin_ix _ label_ix ; li_arity := arity label_def ; sig_ix : Fin.t (length (sigs label_def)) ; li_sig := fin_ix _ sig_ix }. Inductive term (l : Labels) (Var : sort (sorts l) -> Set) : sort (sorts l) -> Set := |var : forall s1 s2, subsort s1 s2 -> Var s1 -> term l Var s2 |app : forall (li : LabelInstance l) s, subsort (fst (li_sig li)) s -> terms _ Var (snd (li_sig li)) -> term _ Var s with terms (l : Labels) (Var : sort (sorts l) -> Set) : forall n, Vector.t (sort (sorts l)) n -> Set := | terms_nil : terms l Var (@Vector.nil _) | terms_cons : forall s, term l Var s -> forall n ss, terms l Var ss -> terms l Var (Vector.cons _ s n ss) . Arguments rt_trans [A R x y z] _ _. Definition inj {l V s1 s2} (H : subsort s1 s2) (t : term l V s1) : term l V s2 := match t in term _ _ s return subsort s s2 -> term l V s2 with | var s0 s H0 v => fun H' => @var l V s0 s2 (rt_trans H0 H') v | app li s H0 ts => fun H' => @app l V li s2 (rt_trans H0 H') ts end H. Definition VProp {A} n : Vector.t A n -> Prop := match n return Vector.t A n -> Prop with | 0 => fun _ => True | S _ => fun v => v = Vector.cons _ (Vector.hd v) _ (Vector.tl v) end. Lemma Vector_ht : forall A n (v : Vector.t A (S n)), v = Vector.cons _ (Vector.hd v) _ (Vector.tl v). Proof. intros. change (VProp v). destruct v;reflexivity. Qed. Fixpoint injs {l V n ss1} (ts : @terms l V n ss1) : forall ss2, Vector.Forall2 (@subsort _) ss1 ss2 -> terms l V ss2. refine (match ts in @terms _ _ n ss return forall ss2, Vector.Forall2 (@subsort _) ss ss2 -> terms l V ss2 with | terms_cons s t n' ss ts' => fun ss2 H => _ | terms_nil => fun ss2 H => match ss2 in Vector.t _ n return match n with 0 => terms l V ss2 | S _ => unit end with | Vector.nil => terms_nil _ _ | Vector.cons _ _ _ => tt end end). clear n ts ss1. intros. rewrite (Vector_ht ss2) in H |- *. refine (terms_cons (inj _ t) (injs l _ _ _ ts' _ _)). inversion H. assumption. inversion H. apply Eqdep_dec.inj_pair2_eq_dec in H5. apply Eqdep_dec.inj_pair2_eq_dec in H2. subst. assumption. exact Peano_dec.eq_nat_dec. exact Peano_dec.eq_nat_dec. Defined. Inductive term_equiv l V : forall s, term l V s -> term l V s -> Prop := | te_refl : forall s t, @term_equiv l V s t t | te_sym : forall s t t', @term_equiv l V s t t' -> term_equiv t' t | te_trans : forall s t1 t2 t3, @term_equiv l V s t1 t2 -> term_equiv t2 t3 -> term_equiv t1 t3 | te_cong : forall li s H H' ts ts', terms_equiv ts ts' -> term_equiv (@app _ _ li s H ts) (app li H' ts') | te_overload : forall (lix : Fin.t (length (labels l))), let label_def := fin_ix _ lix in forall (s1 s2 : Fin.t (length (sigs label_def))), forall s (H1 : subsort (fst (fin_ix _ s1)) s) (H2 : subsort (fst (fin_ix _ s2)) s), forall ss (HS1 : Vector.Forall2 (@subsort _) ss (snd (fin_ix _ s1))) (HS2 : Vector.Forall2 (@subsort _) ss (snd (fin_ix _ s2))), forall (ts : terms l V ss), term_equiv (app (MkLabelInstance l lix s1) H1 (injs ts HS1)) (app (MkLabelInstance l lix s2) H2 (injs ts HS2)) with terms_equiv l V : forall n ss, @terms l V n ss -> terms l V ss -> Prop := | terms_equiv_nil : terms_equiv (terms_nil l V) (terms_nil l V) | terms_equiv_cons : forall s t t', @term_equiv _ _ s t t' -> forall n ss ts ts', @terms_equiv _ _ n ss ts ts' -> terms_equiv (terms_cons t ts) (terms_cons t' ts') . Definition sig_impl {A:Set} (El : A -> Set) {n} (sig : (A * Vector.t A n)) : Set := (fix args n (codes : Vector.t A n) := match codes with | Vector.nil => El (fst sig) | Vector.cons c _ cs => El c -> args _ cs end) _ (snd sig). Fixpoint eval_term l (sorts_model : SortModel (sorts l)) (label_impl : forall (li : LabelInstance l), sig_impl (sort_impl sorts_model) (li_sig li)) (V : sort (sorts l) -> Set) (var_impl : forall s, V s -> sort_impl sorts_model s) s (t : term l V s) : sort_impl sorts_model s := match t with | var s1 s2 H v => inj_impl sorts_model H (var_impl _ v) | app li s H ts => inj_impl sorts_model H (eval_terms sorts_model label_impl var_impl ts _ (label_impl li)) end with eval_terms l (sorts_model : SortModel (sorts l)) (label_impl : forall (li : LabelInstance l), sig_impl (sort_impl sorts_model) (li_sig li)) (V : sort (sorts l) -> Set) (var_impl : forall s, V s -> sort_impl sorts_model s) n ss (ts : @terms l V n ss) : forall s, sig_impl (sort_impl sorts_model) (s,ss) -> sort_impl sorts_model s := match ts in terms _ _ ss return forall s : sort (sorts l), sig_impl (sort_impl sorts_model) (s, ss) -> sort_impl sorts_model s with | terms_nil => fun _ R => R | terms_cons _ t _ _ ts' => fun _ F => (eval_terms sorts_model label_impl var_impl ts' _ (F (eval_term _ label_impl var_impl t))) end. Inductive LabelsModel (l : Labels) : Type := MkLabelsModel { sorts_model : SortModel (sorts l) ; label_impl : forall (li : LabelInstance l), sig_impl (sort_impl sorts_model) (li_sig li) ; eval : forall (V : sort (sorts l) -> Set) (V_impl : forall s, V s -> sort_impl sorts_model s) s, term l V s -> sort_impl sorts_model s := eval_term sorts_model label_impl ; label_coh : forall (V : sort (sorts l) -> Set) (V_impl : forall s, V s -> sort_impl sorts_model s) s t1 t2, @term_equiv l V s t1 t2 -> eval V_impl t1 = eval V_impl t2 }. Extraction Implicit Fin.F1 [1]. Extraction Implicit Fin.FS [1]. Extraction Implicit Vector.cons [n]. Extraction Implicit Vector.hd [n]. Extraction Implicit Vector.tl [n]. Extraction Implicit terms_cons [s n ss]. Extraction Implicit inj [l s1]. Extraction Implicit injs [l n ss1]. Recursive Extraction injs.
-- -------------------------------------------------------------- [ Common.idr ] -- Module : Common.idr -- Copyright : (c) Jan de Muijnck-Hughes -- License : see LICENSE -- --------------------------------------------------------------------- [ EOH ] ||| Common enumerated types used. module GRL.Common import public Decidable.Equality %default total %access public export data Importance = HIGH | MEDIUM | LOW | NO -- data SValue = DENIED | WEAKDEN | WEAKSATIS | SATISFIED | CONFLICT | UNKNOWN | NONE | UNDECIDED namespace Qualiative data SValue : Type where ||| The intentional element or indicator is sufficiently dissatisfied. DENIED : SValue ||| The intentional element is partially dissatisfied. WEAKDEN : SValue ||| The intentional element or indicator is partially satisfied. WEAKSATIS : SValue ||| The intentional element is sufficiently satisfied. SATISFIED : SValue ||| There are arguments strongly in favour and strongly against ||| the satisfaction of the intentional element. CONFLICT : SValue ||| The satisfaction level of the intentional element is unknown. UNDECIDED : SValue ||| The intentional element or indicator is neither satisfied nor dissatisfied. NONE : SValue export invertEval : SValue -> SValue invertEval DENIED = SATISFIED invertEval WEAKDEN = WEAKSATIS invertEval WEAKSATIS = WEAKDEN invertEval SATISFIED = DENIED invertEval x = x -- data CValue = MAKES | HELPS | SOMEPOS | UNKNOWN | SOMENEG | BREAK | HURTS namespace Contributions data CValue : Type where ||| The contribution is positive and sufficient. MAKES : CValue ||| The contribution is positive but not sufficient. HELPS : CValue ||| The contribution is positive, but the extent of the contribution is unknown. SOMEPOS : CValue ||| There is some contribution, but the extent and the degree (positive or negative) of the contribution is unknown. UNKNOWN : CValue ||| The contribution is negative, but the extent of the contribution is unknown. SOMENEG : CValue ||| The contribution of the contributing element is negative and sufficient. BREAK : CValue ||| The contribution is negative but not sufficient. HURTS : CValue export invertContrib : CValue -> CValue invertContrib MAKES = HURTS invertContrib HELPS = BREAK invertContrib SOMEPOS = SOMENEG invertContrib UNKNOWN = UNKNOWN invertContrib SOMENEG = SOMEPOS invertContrib BREAK = HELPS invertContrib HURTS = MAKES -- ------------------------------------------------------------------- [ Types ] -- data GElemTy = GOALty | SOFTty | TASKty | RESty -- data GIntentTy = IMPACTty | AFFECTSty -- data GStructTy = ANDty | XORty | IORty | NOTty data GTy = ELEM | INTENT | STRUCT data GElemTy : Type where ||| A (hard) Goal is a condition or state of affairs in the ||| world that the stakeholders would like to achieve. ||| ||| How the goal is to be achieved is not specified, allowing ||| alternatives to be considered. A goal can be either a business ||| goal or a system goal. A business goal expresses goals regarding ||| the business or state of the business affairs the individual or ||| organization wishes to achieve. A system goal expresses goals ||| the target system should achieve and generally describes the ||| functional requirements of the target information system. ||| GOALty : GElemTy ||| Softgoals are often used to describe qualities and ||| non-functional aspects such as security, robustness, ||| performance, usability, etc. ||| ||| A Softgoal is a condition or state of affairs in the world that ||| the actor would like to achieve, but unlike in the concept of ||| (hard) goal, there are no clear-cut criteria for whether the ||| condition is achieved, and it is up to subjective judgement and ||| interpretation of the modeller to judge whether a particular ||| state of affairs in fact achieves sufficiently the stated ||| softgoal. ||| SOFTty : GElemTy ||| a Task specifies a particular way of doing something. ||| ||| When a task is part of the decomposition of a (higher-level) ||| task, this restricts the higher-level task to that particular ||| course of action. Tasks can also be seen as the solutions in the ||| target system, which will address (or operationalize) goals and ||| softgoals. These solutions provide operations, processes, data ||| representations, structuring, constraints and agents in the ||| target system to meet the needs stated in the goals and ||| softgoals. ||| TASKty : GElemTy ||| A Resource is a physical or informational entity, for which the ||| main concern is whether it is available. ||| RESty : GElemTy data GIntentTy : Type where ||| A Contribution defines the level of impact that the ||| satisfaction of a source intentional element or indicator has on ||| the satisfaction of a destination intentional element. IMPACTSty : GIntentTy ||| A correlation link emphasizes side-effects between intentional ||| elements in different categories or actor definitions. AFFECTSty : GIntentTy data GStructTy : Type where ||| The AND Decomposition link enables the hierarchical ||| decomposition of a target intentional element by a source ||| element. A target intentional element can be decomposed into ||| many source intentional elements using as many decomposition ||| links. All of the source intentional elements are necessary for ||| the target intentional element to be satisfied. ||| ANDty : GStructTy ||| The XOR Decomposition link enables the description of ||| alternative means of satisfying a target intentional element: ||| Mutually exclusive. The satisfaction of one and only one of the ||| sub-intentional elements is necessary to achieve the target. ||| XORty : GStructTy ||| The IOR Decomposition link enables the description of ||| alternative means of satisfying a target intentional element: ||| Not mutually exclusive. The satisfaction of one of the ||| sub-intentional elements is sufficient to achieve the target, ||| but many sub-intentional elements can be satisfied. ||| IORty : GStructTy -- -------------------------------------------------------------------- [ Show ] implementation Show GElemTy where show GOALty = "Goal" show SOFTty = "Soft" show TASKty = "Task" show RESty = "Res" implementation Show GIntentTy where show IMPACTSty = "CONTRIBUTION" show AFFECTSty = "CORRELATION" implementation Show GStructTy where show ANDty = "ANDTy" show XORty = "XORTy" show IORty = "IORTy" implementation Show GTy where show ELEM = "ELEM" show INTENT = "INTENT" show STRUCT = "STRUCT" -- ---------------------------------------------------------------------- [ Eq ] implementation Eq GElemTy where (==) GOALty GOALty = True (==) SOFTty SOFTty = True (==) TASKty TASKty = True (==) RESty RESty = True (==) _ _ = False implementation Eq GIntentTy where (==) IMPACTSty IMPACTSty = True (==) AFFECTSty AFFECTSty = True (==) _ _ = False implementation Eq GStructTy where (==) ANDty ANDty = True (==) XORty XORty = True (==) IORty IORty = True (==) _ _ = False implementation Eq GTy where (==) ELEM ELEM = True (==) INTENT INTENT = True (==) STRUCT STRUCT = True (==) _ _ = False -- --------------------------------------------------------------- [ Orderable ] implementation Ord GTy where compare ELEM ELEM = EQ compare INTENT INTENT = EQ compare STRUCT STRUCT = EQ compare ELEM _ = LT compare _ ELEM = GT compare INTENT _ = LT compare _ INTENT = GT compare STRUCT _ = LT compare _ STRUCT = GT -- -------------------------------------------------------------------- [ Show ] implementation Show SValue where show SATISFIED = "SATISFIED" show WEAKSATIS = "WEAKSATIS" show WEAKDEN = "WEAKDEN" show DENIED = "DENIED" show CONFLICT = "CONFLICT" show UNDECIDED = "UNDECIDED" show NONE = "NONE" implementation Eq SValue where (==) SATISFIED SATISFIED = True (==) WEAKSATIS WEAKSATIS = True (==) WEAKDEN WEAKDEN = True (==) DENIED DENIED = True (==) CONFLICT CONFLICT = True (==) UNDECIDED UNDECIDED = True (==) NONE NONE = True (==) _ _ = False implementation Show CValue where show MAKES = "MAKES" show HELPS = "HELPS" show SOMEPOS = "SOMEPOS" show UNKNOWN = "UNKNOWN" show SOMENEG = "SOMENEG" show HURTS = "HURTS" show BREAK = "BREAKS" implementation Eq CValue where (==) MAKES MAKES = True (==) HELPS HELPS = True (==) SOMEPOS SOMEPOS = True (==) UNKNOWN UNKNOWN = True (==) SOMENEG SOMENEG = True (==) HURTS HURTS = True (==) BREAK BREAK = True (==) _ _ = False implementation Cast CValue String where cast MAKES = "MAKES" cast HELPS = "HELPS" cast SOMEPOS = "SOMEPOS" cast UNKNOWN = "UNKNOWN" cast SOMENEG = "SOMENEG" cast HURTS = "HURTS" cast BREAK = "BREAKS" implementation Cast SValue String where cast SATISFIED = "SATISFIED" cast WEAKSATIS = "WEAKSATIS" cast WEAKDEN = "WEAKDEN" cast DENIED = "DENIED" cast CONFLICT = "CONFLICT" cast UNDECIDED = "UNDECIDED" cast NONE = "NONE" implementation Cast String CValue where cast "MAKES" = MAKES cast "HELPS" = HELPS cast "SOMEPOS" = SOMEPOS cast "UNKNOWN" = UNKNOWN cast "SOMENEG" = SOMENEG cast "HURTS" = HURTS cast "BREAKS" = BREAK cast _ = UNKNOWN implementation Cast String SValue where cast "SATISFIED" = SATISFIED cast "WEAKSATIS" = WEAKSATIS cast "WEAKDEN" = WEAKDEN cast "DENIED" = DENIED cast "CONFLICT" = CONFLICT cast "UNDECIDED" = UNDECIDED cast "NONE" = NONE cast _ = NONE -- --------------------------------------------------------------------- [ EOF ]
State Before: G : Type u A : Type v x y : G a b : A n m : ℕ inst✝¹ : Monoid G inst✝ : AddMonoid A ⊢ orderOf x = 1 ↔ x = 1 State After: no goals Tactic: rw [orderOf, minimalPeriod_eq_one_iff_isFixedPt, IsFixedPt, mul_one]
Formal statement is: lemma LIMSEQ_le_const: "X \<longlonglongrightarrow> x \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. a \<le> X n \<Longrightarrow> a \<le> x" for a x :: "'a::linorder_topology" Informal statement is: If $X_n$ converges to $x$ and there exists $N$ such that $a \leq X_n$ for all $n \geq N$, then $a \leq x$.
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import category_theory.limits.shapes.zero /-! # Shift A `shift` on a category is nothing more than an automorphism of the category. An example to keep in mind might be the category of complexes ⋯ → C_{n-1} → C_n → C_{n+1} → ⋯ with the shift operator re-indexing the terms, so the degree `n` term of `shift C` would be the degree `n+1` term of `C`. -/ namespace category_theory universes v u variables (C : Type u) [category.{v} C] /-- A category has a shift, or translation, if it is equipped with an automorphism. -/ class has_shift := (shift : C ≌ C) variables [has_shift C] /-- The shift autoequivalence, moving objects and morphisms 'up'. -/ def shift : C ≌ C := has_shift.shift -- Any better notational suggestions? notation X`⟦`n`⟧`:20 := ((shift _)^(n : ℤ)).functor.obj X notation f`⟦`n`⟧'`:80 := ((shift _)^(n : ℤ)).functor.map f example {X Y : C} (f : X ⟶ Y) : X⟦1⟧ ⟶ Y⟦1⟧ := f⟦1⟧' example {X Y : C} (f : X ⟶ Y) : X⟦-2⟧ ⟶ Y⟦-2⟧ := f⟦-2⟧' open category_theory.limits variables [has_zero_morphisms C] @[simp] lemma shift_zero_eq_zero (X Y : C) (n : ℤ) : (0 : X ⟶ Y)⟦n⟧' = (0 : X⟦n⟧ ⟶ Y⟦n⟧) := by apply equivalence_preserves_zero_morphisms end category_theory
[GOAL] α✝ : Sort ?u.774 β✝ : Sort ?u.777 γ : Sort ?u.780 f✝ : α✝ → β✝ α α' : Sort u β : α → Sort v β' : α' → Sort v f : (a : α) → β a f' : (a : α') → β' a hα : α = α' h : ∀ (a : α) (a' : α'), HEq a a' → HEq (f a) (f' a') ⊢ HEq f f' [PROOFSTEP] subst hα [GOAL] α✝ : Sort ?u.774 β✝ : Sort ?u.777 γ : Sort ?u.780 f✝ : α✝ → β✝ α : Sort u β : α → Sort v f : (a : α) → β a β' : α → Sort v f' : (a : α) → β' a h : ∀ (a a' : α), HEq a a' → HEq (f a) (f' a') ⊢ HEq f f' [PROOFSTEP] have : ∀ a, HEq (f a) (f' a) := λ a => h a a (HEq.refl a) [GOAL] α✝ : Sort ?u.774 β✝ : Sort ?u.777 γ : Sort ?u.780 f✝ : α✝ → β✝ α : Sort u β : α → Sort v f : (a : α) → β a β' : α → Sort v f' : (a : α) → β' a h : ∀ (a a' : α), HEq a a' → HEq (f a) (f' a') this : ∀ (a : α), HEq (f a) (f' a) ⊢ HEq f f' [PROOFSTEP] have : β = β' := by funext a exact type_eq_of_heq (this a) [GOAL] α✝ : Sort ?u.774 β✝ : Sort ?u.777 γ : Sort ?u.780 f✝ : α✝ → β✝ α : Sort u β : α → Sort v f : (a : α) → β a β' : α → Sort v f' : (a : α) → β' a h : ∀ (a a' : α), HEq a a' → HEq (f a) (f' a') this : ∀ (a : α), HEq (f a) (f' a) ⊢ β = β' [PROOFSTEP] funext a [GOAL] case h α✝ : Sort ?u.774 β✝ : Sort ?u.777 γ : Sort ?u.780 f✝ : α✝ → β✝ α : Sort u β : α → Sort v f : (a : α) → β a β' : α → Sort v f' : (a : α) → β' a h : ∀ (a a' : α), HEq a a' → HEq (f a) (f' a') this : ∀ (a : α), HEq (f a) (f' a) a : α ⊢ β a = β' a [PROOFSTEP] exact type_eq_of_heq (this a) [GOAL] α✝ : Sort ?u.774 β✝ : Sort ?u.777 γ : Sort ?u.780 f✝ : α✝ → β✝ α : Sort u β : α → Sort v f : (a : α) → β a β' : α → Sort v f' : (a : α) → β' a h : ∀ (a a' : α), HEq a a' → HEq (f a) (f' a') this✝ : ∀ (a : α), HEq (f a) (f' a) this : β = β' ⊢ HEq f f' [PROOFSTEP] subst this [GOAL] α✝ : Sort ?u.774 β✝ : Sort ?u.777 γ : Sort ?u.780 f✝ : α✝ → β✝ α : Sort u β : α → Sort v f f' : (a : α) → β a h : ∀ (a a' : α), HEq a a' → HEq (f a) (f' a') this : ∀ (a : α), HEq (f a) (f' a) ⊢ HEq f f' [PROOFSTEP] apply heq_of_eq [GOAL] case h α✝ : Sort ?u.774 β✝ : Sort ?u.777 γ : Sort ?u.780 f✝ : α✝ → β✝ α : Sort u β : α → Sort v f f' : (a : α) → β a h : ∀ (a a' : α), HEq a a' → HEq (f a) (f' a') this : ∀ (a : α), HEq (f a) (f' a) ⊢ f = f' [PROOFSTEP] funext a [GOAL] case h.h α✝ : Sort ?u.774 β✝ : Sort ?u.777 γ : Sort ?u.780 f✝ : α✝ → β✝ α : Sort u β : α → Sort v f f' : (a : α) → β a h : ∀ (a a' : α), HEq a a' → HEq (f a) (f' a') this : ∀ (a : α), HEq (f a) (f' a) a : α ⊢ f a = f' a [PROOFSTEP] exact eq_of_heq (this a) [GOAL] α : Type u_1 β : Type u_2 γ : Sort ?u.1351 f : α → β inst✝³ : BEq α inst✝² : LawfulBEq α inst✝¹ : BEq β inst✝ : LawfulBEq β I : Injective f a b : α ⊢ (f a == f b) = (a == b) [PROOFSTEP] by_cases h : a == b [GOAL] case pos α : Type u_1 β : Type u_2 γ : Sort ?u.1351 f : α → β inst✝³ : BEq α inst✝² : LawfulBEq α inst✝¹ : BEq β inst✝ : LawfulBEq β I : Injective f a b : α h : (a == b) = true ⊢ (f a == f b) = (a == b) [PROOFSTEP] simp [h] [GOAL] case neg α : Type u_1 β : Type u_2 γ : Sort ?u.1351 f : α → β inst✝³ : BEq α inst✝² : LawfulBEq α inst✝¹ : BEq β inst✝ : LawfulBEq β I : Injective f a b : α h : ¬(a == b) = true ⊢ (f a == f b) = (a == b) [PROOFSTEP] simp [h] [GOAL] case pos α : Type u_1 β : Type u_2 γ : Sort ?u.1351 f : α → β inst✝³ : BEq α inst✝² : LawfulBEq α inst✝¹ : BEq β inst✝ : LawfulBEq β I : Injective f a b : α h : (a == b) = true ⊢ f a = f b [PROOFSTEP] simpa [I.eq_iff] using h [GOAL] case neg α : Type u_1 β : Type u_2 γ : Sort ?u.1351 f : α → β inst✝³ : BEq α inst✝² : LawfulBEq α inst✝¹ : BEq β inst✝ : LawfulBEq β I : Injective f a b : α h : ¬(a == b) = true ⊢ ¬f a = f b [PROOFSTEP] simpa [I.eq_iff] using h [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort ?u.3653 f✝ : α → β p : α → Prop inst✝ : DecidablePred p f : { a // p a } → β f' : { a // ¬p a } → β hf : Injective f hf' : Injective f' im_disj : ∀ {x x' : α} {hx : p x} {hx' : ¬p x'}, f { val := x, property := hx } ≠ f' { val := x', property := hx' } ⊢ Injective fun x => if h : p x then f { val := x, property := h } else f' { val := x, property := h } [PROOFSTEP] intros x₁ x₂ h [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort ?u.3653 f✝ : α → β p : α → Prop inst✝ : DecidablePred p f : { a // p a } → β f' : { a // ¬p a } → β hf : Injective f hf' : Injective f' im_disj : ∀ {x x' : α} {hx : p x} {hx' : ¬p x'}, f { val := x, property := hx } ≠ f' { val := x', property := hx' } x₁ x₂ : α h : (fun x => if h : p x then f { val := x, property := h } else f' { val := x, property := h }) x₁ = (fun x => if h : p x then f { val := x, property := h } else f' { val := x, property := h }) x₂ ⊢ x₁ = x₂ [PROOFSTEP] dsimp only at h [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort ?u.3653 f✝ : α → β p : α → Prop inst✝ : DecidablePred p f : { a // p a } → β f' : { a // ¬p a } → β hf : Injective f hf' : Injective f' im_disj : ∀ {x x' : α} {hx : p x} {hx' : ¬p x'}, f { val := x, property := hx } ≠ f' { val := x', property := hx' } x₁ x₂ : α h : (if h : p x₁ then f { val := x₁, property := h } else f' { val := x₁, property := h }) = if h : p x₂ then f { val := x₂, property := h } else f' { val := x₂, property := h } ⊢ x₁ = x₂ [PROOFSTEP] by_cases h₁ : p x₁ [GOAL] case pos α : Sort u_1 β : Sort u_2 γ : Sort ?u.3653 f✝ : α → β p : α → Prop inst✝ : DecidablePred p f : { a // p a } → β f' : { a // ¬p a } → β hf : Injective f hf' : Injective f' im_disj : ∀ {x x' : α} {hx : p x} {hx' : ¬p x'}, f { val := x, property := hx } ≠ f' { val := x', property := hx' } x₁ x₂ : α h : (if h : p x₁ then f { val := x₁, property := h } else f' { val := x₁, property := h }) = if h : p x₂ then f { val := x₂, property := h } else f' { val := x₂, property := h } h₁ : p x₁ ⊢ x₁ = x₂ [PROOFSTEP] by_cases h₂ : p x₂ [GOAL] case neg α : Sort u_1 β : Sort u_2 γ : Sort ?u.3653 f✝ : α → β p : α → Prop inst✝ : DecidablePred p f : { a // p a } → β f' : { a // ¬p a } → β hf : Injective f hf' : Injective f' im_disj : ∀ {x x' : α} {hx : p x} {hx' : ¬p x'}, f { val := x, property := hx } ≠ f' { val := x', property := hx' } x₁ x₂ : α h : (if h : p x₁ then f { val := x₁, property := h } else f' { val := x₁, property := h }) = if h : p x₂ then f { val := x₂, property := h } else f' { val := x₂, property := h } h₁ : ¬p x₁ ⊢ x₁ = x₂ [PROOFSTEP] by_cases h₂ : p x₂ [GOAL] case pos α : Sort u_1 β : Sort u_2 γ : Sort ?u.3653 f✝ : α → β p : α → Prop inst✝ : DecidablePred p f : { a // p a } → β f' : { a // ¬p a } → β hf : Injective f hf' : Injective f' im_disj : ∀ {x x' : α} {hx : p x} {hx' : ¬p x'}, f { val := x, property := hx } ≠ f' { val := x', property := hx' } x₁ x₂ : α h : (if h : p x₁ then f { val := x₁, property := h } else f' { val := x₁, property := h }) = if h : p x₂ then f { val := x₂, property := h } else f' { val := x₂, property := h } h₁ : p x₁ h₂ : p x₂ ⊢ x₁ = x₂ [PROOFSTEP] rw [dif_pos h₁, dif_pos h₂] at h [GOAL] case pos α : Sort u_1 β : Sort u_2 γ : Sort ?u.3653 f✝ : α → β p : α → Prop inst✝ : DecidablePred p f : { a // p a } → β f' : { a // ¬p a } → β hf : Injective f hf' : Injective f' im_disj : ∀ {x x' : α} {hx : p x} {hx' : ¬p x'}, f { val := x, property := hx } ≠ f' { val := x', property := hx' } x₁ x₂ : α h₁ : p x₁ h₂ : p x₂ h : f { val := x₁, property := h₁ } = f { val := x₂, property := h₂ } ⊢ x₁ = x₂ [PROOFSTEP] injection (hf h) [GOAL] case neg α : Sort u_1 β : Sort u_2 γ : Sort ?u.3653 f✝ : α → β p : α → Prop inst✝ : DecidablePred p f : { a // p a } → β f' : { a // ¬p a } → β hf : Injective f hf' : Injective f' im_disj : ∀ {x x' : α} {hx : p x} {hx' : ¬p x'}, f { val := x, property := hx } ≠ f' { val := x', property := hx' } x₁ x₂ : α h : (if h : p x₁ then f { val := x₁, property := h } else f' { val := x₁, property := h }) = if h : p x₂ then f { val := x₂, property := h } else f' { val := x₂, property := h } h₁ : p x₁ h₂ : ¬p x₂ ⊢ x₁ = x₂ [PROOFSTEP] rw [dif_pos h₁, dif_neg h₂] at h [GOAL] case neg α : Sort u_1 β : Sort u_2 γ : Sort ?u.3653 f✝ : α → β p : α → Prop inst✝ : DecidablePred p f : { a // p a } → β f' : { a // ¬p a } → β hf : Injective f hf' : Injective f' im_disj : ∀ {x x' : α} {hx : p x} {hx' : ¬p x'}, f { val := x, property := hx } ≠ f' { val := x', property := hx' } x₁ x₂ : α h₁ : p x₁ h₂ : ¬p x₂ h : f { val := x₁, property := h₁ } = f' { val := x₂, property := h₂ } ⊢ x₁ = x₂ [PROOFSTEP] exact (im_disj h).elim [GOAL] case pos α : Sort u_1 β : Sort u_2 γ : Sort ?u.3653 f✝ : α → β p : α → Prop inst✝ : DecidablePred p f : { a // p a } → β f' : { a // ¬p a } → β hf : Injective f hf' : Injective f' im_disj : ∀ {x x' : α} {hx : p x} {hx' : ¬p x'}, f { val := x, property := hx } ≠ f' { val := x', property := hx' } x₁ x₂ : α h : (if h : p x₁ then f { val := x₁, property := h } else f' { val := x₁, property := h }) = if h : p x₂ then f { val := x₂, property := h } else f' { val := x₂, property := h } h₁ : ¬p x₁ h₂ : p x₂ ⊢ x₁ = x₂ [PROOFSTEP] rw [dif_neg h₁, dif_pos h₂] at h [GOAL] case pos α : Sort u_1 β : Sort u_2 γ : Sort ?u.3653 f✝ : α → β p : α → Prop inst✝ : DecidablePred p f : { a // p a } → β f' : { a // ¬p a } → β hf : Injective f hf' : Injective f' im_disj : ∀ {x x' : α} {hx : p x} {hx' : ¬p x'}, f { val := x, property := hx } ≠ f' { val := x', property := hx' } x₁ x₂ : α h₁ : ¬p x₁ h₂ : p x₂ h : f' { val := x₁, property := h₁ } = f { val := x₂, property := h₂ } ⊢ x₁ = x₂ [PROOFSTEP] exact (im_disj h.symm).elim [GOAL] case neg α : Sort u_1 β : Sort u_2 γ : Sort ?u.3653 f✝ : α → β p : α → Prop inst✝ : DecidablePred p f : { a // p a } → β f' : { a // ¬p a } → β hf : Injective f hf' : Injective f' im_disj : ∀ {x x' : α} {hx : p x} {hx' : ¬p x'}, f { val := x, property := hx } ≠ f' { val := x', property := hx' } x₁ x₂ : α h : (if h : p x₁ then f { val := x₁, property := h } else f' { val := x₁, property := h }) = if h : p x₂ then f { val := x₂, property := h } else f' { val := x₂, property := h } h₁ : ¬p x₁ h₂ : ¬p x₂ ⊢ x₁ = x₂ [PROOFSTEP] rw [dif_neg h₁, dif_neg h₂] at h [GOAL] case neg α : Sort u_1 β : Sort u_2 γ : Sort ?u.3653 f✝ : α → β p : α → Prop inst✝ : DecidablePred p f : { a // p a } → β f' : { a // ¬p a } → β hf : Injective f hf' : Injective f' im_disj : ∀ {x x' : α} {hx : p x} {hx' : ¬p x'}, f { val := x, property := hx } ≠ f' { val := x', property := hx' } x₁ x₂ : α h₁ : ¬p x₁ h₂ : ¬p x₂ h : f' { val := x₁, property := h₁ } = f' { val := x₂, property := h₂ } ⊢ x₁ = x₂ [PROOFSTEP] injection (hf' h) [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort ?u.6624 f : α → β h : ∀ (g₁ g₂ : β → Prop), g₁ ∘ f = g₂ ∘ f → g₁ = g₂ ⊢ Surjective f [PROOFSTEP] specialize h (fun y ↦ ∃ x, f x = y) (fun _ ↦ True) (funext fun x ↦ eq_true ⟨_, rfl⟩) [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort ?u.6624 f : α → β h : (fun y => ∃ x, f x = y) = fun x => True ⊢ Surjective f [PROOFSTEP] intro y [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort ?u.6624 f : α → β h : (fun y => ∃ x, f x = y) = fun x => True y : β ⊢ ∃ a, f a = y [PROOFSTEP] rw [congr_fun h y] [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort ?u.6624 f : α → β h : (fun y => ∃ x, f x = y) = fun x => True y : β ⊢ True [PROOFSTEP] trivial [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort ?u.7150 f✝ f : α → β hf : Bijective f p : β → Prop x✝ : ∃! y, p y y : β hpy : (fun y => p y) y hy : ∀ (y_1 : β), (fun y => p y) y_1 → y_1 = y x : α hx : f x = y ⊢ (fun x => p (f x)) x [PROOFSTEP] simpa [hx] [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort ?u.7150 f✝ f : α → β hf : Bijective f p : β → Prop x✝ : ∃! x, p (f x) x : α hpx : (fun x => p (f x)) x hx : ∀ (y : α), (fun x => p (f x)) y → y = x y : β hy : (fun y => p y) y z : α hz : f z = y ⊢ (fun x => p (f x)) z [PROOFSTEP] simpa [hz] [GOAL] α✝ : Sort ?u.8686 β : Sort ?u.8689 γ : Sort ?u.8692 f✝ : α✝ → β α : Type u f : α → Type (max u v) ⊢ ¬Surjective f [PROOFSTEP] intro hf [GOAL] α✝ : Sort ?u.8686 β : Sort ?u.8689 γ : Sort ?u.8692 f✝ : α✝ → β α : Type u f : α → Type (max u v) hf : Surjective f ⊢ False [PROOFSTEP] let T : Type max u v := Sigma f [GOAL] α✝ : Sort ?u.8686 β : Sort ?u.8689 γ : Sort ?u.8692 f✝ : α✝ → β α : Type u f : α → Type (max u v) hf : Surjective f T : Type (max u v) := Sigma f ⊢ False [PROOFSTEP] cases' hf (Set T) with U hU [GOAL] case intro α✝ : Sort ?u.8686 β : Sort ?u.8689 γ : Sort ?u.8692 f✝ : α✝ → β α : Type u f : α → Type (max u v) hf : Surjective f T : Type (max u v) := Sigma f U : α hU : f U = Set T ⊢ False [PROOFSTEP] let g : Set T → T := fun s ↦ ⟨U, cast hU.symm s⟩ [GOAL] case intro α✝ : Sort ?u.8686 β : Sort ?u.8689 γ : Sort ?u.8692 f✝ : α✝ → β α : Type u f : α → Type (max u v) hf : Surjective f T : Type (max u v) := Sigma f U : α hU : f U = Set T g : Set T → T := fun s => { fst := U, snd := cast (_ : Set T = f U) s } ⊢ False [PROOFSTEP] have hg : Injective g := by intro s t h suffices cast hU (g s).2 = cast hU (g t).2 by simp only [cast_cast, cast_eq] at this assumption · congr [GOAL] α✝ : Sort ?u.8686 β : Sort ?u.8689 γ : Sort ?u.8692 f✝ : α✝ → β α : Type u f : α → Type (max u v) hf : Surjective f T : Type (max u v) := Sigma f U : α hU : f U = Set T g : Set T → T := fun s => { fst := U, snd := cast (_ : Set T = f U) s } ⊢ Injective g [PROOFSTEP] intro s t h [GOAL] α✝ : Sort ?u.8686 β : Sort ?u.8689 γ : Sort ?u.8692 f✝ : α✝ → β α : Type u f : α → Type (max u v) hf : Surjective f T : Type (max u v) := Sigma f U : α hU : f U = Set T g : Set T → T := fun s => { fst := U, snd := cast (_ : Set T = f U) s } s t : Set T h : g s = g t ⊢ s = t [PROOFSTEP] suffices cast hU (g s).2 = cast hU (g t).2 by simp only [cast_cast, cast_eq] at this assumption [GOAL] α✝ : Sort ?u.8686 β : Sort ?u.8689 γ : Sort ?u.8692 f✝ : α✝ → β α : Type u f : α → Type (max u v) hf : Surjective f T : Type (max u v) := Sigma f U : α hU : f U = Set T g : Set T → T := fun s => { fst := U, snd := cast (_ : Set T = f U) s } s t : Set T h : g s = g t this : cast hU (g s).snd = cast hU (g t).snd ⊢ s = t [PROOFSTEP] simp only [cast_cast, cast_eq] at this [GOAL] α✝ : Sort ?u.8686 β : Sort ?u.8689 γ : Sort ?u.8692 f✝ : α✝ → β α : Type u f : α → Type (max u v) hf : Surjective f T : Type (max u v) := Sigma f U : α hU : f U = Set T g : Set T → T := fun s => { fst := U, snd := cast (_ : Set T = f U) s } s t : Set T h : g s = g t this : s = t ⊢ s = t [PROOFSTEP] assumption [GOAL] α✝ : Sort ?u.8686 β : Sort ?u.8689 γ : Sort ?u.8692 f✝ : α✝ → β α : Type u f : α → Type (max u v) hf : Surjective f T : Type (max u v) := Sigma f U : α hU : f U = Set T g : Set T → T := fun s => { fst := U, snd := cast (_ : Set T = f U) s } s t : Set T h : g s = g t ⊢ cast hU (g s).snd = cast hU (g t).snd [PROOFSTEP] congr [GOAL] case intro α✝ : Sort ?u.8686 β : Sort ?u.8689 γ : Sort ?u.8692 f✝ : α✝ → β α : Type u f : α → Type (max u v) hf : Surjective f T : Type (max u v) := Sigma f U : α hU : f U = Set T g : Set T → T := fun s => { fst := U, snd := cast (_ : Set T = f U) s } hg : Injective g ⊢ False [PROOFSTEP] exact cantor_injective g hg [GOAL] α : Sort u_2 β : Sort u_1 γ : Sort u_3 f✝ f : α → β g : β → α h : β → γ i : γ → β hf : LeftInverse f g hh : LeftInverse h i a : γ ⊢ h (f (g (i a))) = a [PROOFSTEP] rw [hf (i a), hh a] [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort ?u.11227 f✝ f : α → β g₁ g₂ : β → α h₁ : LeftInverse g₁ f h₂ : RightInverse g₂ f ⊢ g₁ = g₁ ∘ f ∘ g₂ [PROOFSTEP] rw [h₂.comp_eq_id, comp.right_id] [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort ?u.11227 f✝ f : α → β g₁ g₂ : β → α h₁ : LeftInverse g₁ f h₂ : RightInverse g₂ f ⊢ g₁ ∘ f ∘ g₂ = g₂ [PROOFSTEP] rw [← comp.assoc, h₁.comp_eq_id, comp.left_id] [GOAL] α✝ : Sort ?u.11659 β✝ : Sort ?u.11662 γ : Sort ?u.11665 f✝ : α✝ → β✝ α : Type u_1 β : Sort u_2 f : α → β I : Injective f a : α b : β h : partialInv f b = some a hpi : partialInv f b = if h : ∃ a, f a = b then some (Classical.choose h) else none h' : ∃ a, f a = b ⊢ f a = b [PROOFSTEP] rw [hpi, dif_pos h'] at h [GOAL] α✝ : Sort ?u.11659 β✝ : Sort ?u.11662 γ : Sort ?u.11665 f✝ : α✝ → β✝ α : Type u_1 β : Sort u_2 f : α → β I : Injective f a : α b : β hpi : partialInv f b = if h : ∃ a, f a = b then some (Classical.choose h) else none h' : ∃ a, f a = b h : some (Classical.choose h') = some a ⊢ f a = b [PROOFSTEP] injection h with h [GOAL] α✝ : Sort ?u.11659 β✝ : Sort ?u.11662 γ : Sort ?u.11665 f✝ : α✝ → β✝ α : Type u_1 β : Sort u_2 f : α → β I : Injective f a : α b : β hpi : partialInv f b = if h : ∃ a, f a = b then some (Classical.choose h) else none h' : ∃ a, f a = b h : Classical.choose h' = a ⊢ f a = b [PROOFSTEP] subst h [GOAL] α✝ : Sort ?u.11659 β✝ : Sort ?u.11662 γ : Sort ?u.11665 f✝ : α✝ → β✝ α : Type u_1 β : Sort u_2 f : α → β I : Injective f b : β hpi : partialInv f b = if h : ∃ a, f a = b then some (Classical.choose h) else none h' : ∃ a, f a = b ⊢ f (Classical.choose h') = b [PROOFSTEP] apply Classical.choose_spec h' [GOAL] α✝ : Sort ?u.11659 β✝ : Sort ?u.11662 γ : Sort ?u.11665 f✝ : α✝ → β✝ α : Type u_1 β : Sort u_2 f : α → β I : Injective f a : α b : β h : partialInv f b = some a hpi : partialInv f b = if h : ∃ a, f a = b then some (Classical.choose h) else none h' : ¬∃ a, f a = b ⊢ f a = b [PROOFSTEP] rw [hpi, dif_neg h'] at h [GOAL] α✝ : Sort ?u.11659 β✝ : Sort ?u.11662 γ : Sort ?u.11665 f✝ : α✝ → β✝ α : Type u_1 β : Sort u_2 f : α → β I : Injective f a : α b : β h : none = some a hpi : partialInv f b = if h : ∃ a, f a = b then some (Classical.choose h) else none h' : ¬∃ a, f a = b ⊢ f a = b [PROOFSTEP] contradiction [GOAL] α : Sort u_1 β : Sort u_2 inst✝ : Nonempty α f : α → β a : α b : β h : ∃ a, f a = b ⊢ f (invFun f b) = b [PROOFSTEP] simp only [invFun, dif_pos h, h.choose_spec] [GOAL] α : Sort u_1 β : Sort u_2 inst✝ : Nonempty α f : α → β a : α b✝ : β g : β → α hf : Injective f hg : RightInverse g f b : β ⊢ f (invFun f b) = f (g b) [PROOFSTEP] rw [hg b] [GOAL] α : Sort u_1 β : Sort u_2 inst✝ : Nonempty α f : α → β a : α b✝ : β g : β → α hf : Injective f hg : RightInverse g f b : β ⊢ f (invFun f b) = b [PROOFSTEP] exact invFun_eq ⟨g b, hg b⟩ [GOAL] α : Sort u β✝ : α → Sort v α' : Sort w inst✝¹ : DecidableEq α inst✝ : DecidableEq α' f✝ g : (a : α) → β✝ a a✝ : α b✝ : β✝ a✝ β : Sort u_1 f : α → β a' : α b : β a : α ⊢ update f a' b a = if a = a' then b else f a [PROOFSTEP] have h2 : (h : a = a') → Eq.rec (motive := λ _ _ => β) b h.symm = b := by intro h rw [eq_rec_constant] [GOAL] α : Sort u β✝ : α → Sort v α' : Sort w inst✝¹ : DecidableEq α inst✝ : DecidableEq α' f✝ g : (a : α) → β✝ a a✝ : α b✝ : β✝ a✝ β : Sort u_1 f : α → β a' : α b : β a : α ⊢ ∀ (h : a = a'), (_ : a' = a) ▸ b = b [PROOFSTEP] intro h [GOAL] α : Sort u β✝ : α → Sort v α' : Sort w inst✝¹ : DecidableEq α inst✝ : DecidableEq α' f✝ g : (a : α) → β✝ a a✝ : α b✝ : β✝ a✝ β : Sort u_1 f : α → β a' : α b : β a : α h : a = a' ⊢ (_ : a' = a) ▸ b = b [PROOFSTEP] rw [eq_rec_constant] [GOAL] α : Sort u β✝ : α → Sort v α' : Sort w inst✝¹ : DecidableEq α inst✝ : DecidableEq α' f✝ g : (a : α) → β✝ a a✝ : α b✝ : β✝ a✝ β : Sort u_1 f : α → β a' : α b : β a : α h2 : ∀ (h : a = a'), (_ : a' = a) ▸ b = b ⊢ update f a' b a = if a = a' then b else f a [PROOFSTEP] have h3 : (λ h : a = a' => Eq.rec (motive := λ _ _ => β) b h.symm) = (λ _ : a = a' => b) := funext h2 [GOAL] α : Sort u β✝ : α → Sort v α' : Sort w inst✝¹ : DecidableEq α inst✝ : DecidableEq α' f✝ g : (a : α) → β✝ a a✝ : α b✝ : β✝ a✝ β : Sort u_1 f : α → β a' : α b : β a : α h2 : ∀ (h : a = a'), (_ : a' = a) ▸ b = b h3 : (fun h => (_ : a' = a) ▸ b) = fun x => b ⊢ update f a' b a = if a = a' then b else f a [PROOFSTEP] let f := λ x => dite (a = a') x (λ (_ : ¬a = a') => (f a)) [GOAL] α : Sort u β✝ : α → Sort v α' : Sort w inst✝¹ : DecidableEq α inst✝ : DecidableEq α' f✝¹ g : (a : α) → β✝ a a✝ : α b✝ : β✝ a✝ β : Sort u_1 f✝ : α → β a' : α b : β a : α h2 : ∀ (h : a = a'), (_ : a' = a) ▸ b = b h3 : (fun h => (_ : a' = a) ▸ b) = fun x => b f : (a = a' → β) → β := fun x => dite (a = a') x fun x => f✝ a ⊢ update f✝ a' b a = if a = a' then b else f✝ a [PROOFSTEP] exact congrArg f h3 [GOAL] α : Sort u β : α → Sort v α' : Sort w inst✝¹ : DecidableEq α inst✝ : DecidableEq α' f✝ g : (a : α) → β a a : α b : β a f : (a : α) → β a a' : α v v' : β a' h : update f a' v = update f a' v' ⊢ v = v' [PROOFSTEP] have := congr_fun h a' [GOAL] α : Sort u β : α → Sort v α' : Sort w inst✝¹ : DecidableEq α inst✝ : DecidableEq α' f✝ g : (a : α) → β a a : α b : β a f : (a : α) → β a a' : α v v' : β a' h : update f a' v = update f a' v' this : update f a' v a' = update f a' v' a' ⊢ v = v' [PROOFSTEP] rwa [update_same, update_same] at this [GOAL] α : Sort u β : α → Sort v α' : Sort w inst✝¹ : DecidableEq α inst✝ : DecidableEq α' f✝ g : (a : α) → β a a✝ : α b✝ : β a✝ f : (a : α) → β a a : α b : β a p : (a : α) → β a → Prop ⊢ (∀ (x : α), p x (update f a b x)) ↔ p a b ∧ ∀ (x : α), x ≠ a → p x (f x) [PROOFSTEP] rw [← and_forall_ne a, update_same] [GOAL] α : Sort u β : α → Sort v α' : Sort w inst✝¹ : DecidableEq α inst✝ : DecidableEq α' f✝ g : (a : α) → β a a✝ : α b✝ : β a✝ f : (a : α) → β a a : α b : β a p : (a : α) → β a → Prop ⊢ (p a b ∧ ∀ (b_1 : α), b_1 ≠ a → p b_1 (update f a b b_1)) ↔ p a b ∧ ∀ (x : α), x ≠ a → p x (f x) [PROOFSTEP] simp (config := { contextual := true }) [GOAL] α : Sort u β : α → Sort v α' : Sort w inst✝¹ : DecidableEq α inst✝ : DecidableEq α' f✝ g : (a : α) → β a a✝ : α b✝ : β a✝ f : (a : α) → β a a : α b : β a p : (a : α) → β a → Prop ⊢ (∃ x, p x (update f a b x)) ↔ p a b ∨ ∃ x x_1, p x (f x) [PROOFSTEP] rw [← not_forall_not, forall_update_iff f fun a b ↦ ¬p a b] [GOAL] α : Sort u β : α → Sort v α' : Sort w inst✝¹ : DecidableEq α inst✝ : DecidableEq α' f✝ g : (a : α) → β a a✝ : α b✝ : β a✝ f : (a : α) → β a a : α b : β a p : (a : α) → β a → Prop ⊢ ¬(¬p a b ∧ ∀ (x : α), x ≠ a → ¬p x (f x)) ↔ p a b ∨ ∃ x x_1, p x (f x) [PROOFSTEP] simp [-not_and, not_and_or] [GOAL] α : Sort u β : α → Sort v α' : Sort w inst✝¹ : DecidableEq α inst✝ : DecidableEq α' f g : (a : α) → β a a : α b : β a ⊢ update f a b = f ↔ b = f a [PROOFSTEP] simp [update_eq_iff] [GOAL] α : Sort u β : α → Sort v α' : Sort w inst✝¹ : DecidableEq α inst✝ : DecidableEq α' f g : (a : α) → β a a : α b : β a ⊢ f = update f a b ↔ f a = b [PROOFSTEP] simp [eq_update_iff] [GOAL] α✝ : Sort u β✝ : α✝ → Sort v α' : Sort w inst✝² : DecidableEq α✝ inst✝¹ : DecidableEq α' f✝ g✝ : (a : α✝) → β✝ a a : α✝ b : β✝ a ι : Sort u_1 inst✝ : DecidableEq ι α : ι → Sort u_2 β : ι → Sort u_3 f : (i : ι) → α i → β i g : (i : ι) → α i i : ι v : α i j : ι ⊢ f j (update g i v j) = update (fun k => f k (g k)) i (f i v) j [PROOFSTEP] by_cases h : j = i [GOAL] case pos α✝ : Sort u β✝ : α✝ → Sort v α' : Sort w inst✝² : DecidableEq α✝ inst✝¹ : DecidableEq α' f✝ g✝ : (a : α✝) → β✝ a a : α✝ b : β✝ a ι : Sort u_1 inst✝ : DecidableEq ι α : ι → Sort u_2 β : ι → Sort u_3 f : (i : ι) → α i → β i g : (i : ι) → α i i : ι v : α i j : ι h : j = i ⊢ f j (update g i v j) = update (fun k => f k (g k)) i (f i v) j [PROOFSTEP] subst j [GOAL] case pos α✝ : Sort u β✝ : α✝ → Sort v α' : Sort w inst✝² : DecidableEq α✝ inst✝¹ : DecidableEq α' f✝ g✝ : (a : α✝) → β✝ a a : α✝ b : β✝ a ι : Sort u_1 inst✝ : DecidableEq ι α : ι → Sort u_2 β : ι → Sort u_3 f : (i : ι) → α i → β i g : (i : ι) → α i i : ι v : α i ⊢ f i (update g i v i) = update (fun k => f k (g k)) i (f i v) i [PROOFSTEP] simp [GOAL] case neg α✝ : Sort u β✝ : α✝ → Sort v α' : Sort w inst✝² : DecidableEq α✝ inst✝¹ : DecidableEq α' f✝ g✝ : (a : α✝) → β✝ a a : α✝ b : β✝ a ι : Sort u_1 inst✝ : DecidableEq ι α : ι → Sort u_2 β : ι → Sort u_3 f : (i : ι) → α i → β i g : (i : ι) → α i i : ι v : α i j : ι h : ¬j = i ⊢ f j (update g i v j) = update (fun k => f k (g k)) i (f i v) j [PROOFSTEP] simp [h] [GOAL] α✝ : Sort u β✝ : α✝ → Sort v α' : Sort w inst✝² : DecidableEq α✝ inst✝¹ : DecidableEq α' f✝ g✝ : (a : α✝) → β✝ a a : α✝ b : β✝ a ι : Sort u_1 inst✝ : DecidableEq ι α : ι → Sort u_2 β : ι → Sort u_3 γ : ι → Sort u_4 f : (i : ι) → α i → β i → γ i g : (i : ι) → α i h : (i : ι) → β i i : ι v : α i w : β i j : ι ⊢ f j (update g i v j) (update h i w j) = update (fun k => f k (g k) (h k)) i (f i v w) j [PROOFSTEP] by_cases h : j = i [GOAL] case pos α✝ : Sort u β✝ : α✝ → Sort v α' : Sort w inst✝² : DecidableEq α✝ inst✝¹ : DecidableEq α' f✝ g✝ : (a : α✝) → β✝ a a : α✝ b : β✝ a ι : Sort u_1 inst✝ : DecidableEq ι α : ι → Sort u_2 β : ι → Sort u_3 γ : ι → Sort u_4 f : (i : ι) → α i → β i → γ i g : (i : ι) → α i h✝ : (i : ι) → β i i : ι v : α i w : β i j : ι h : j = i ⊢ f j (update g i v j) (update h✝ i w j) = update (fun k => f k (g k) (h✝ k)) i (f i v w) j [PROOFSTEP] subst j [GOAL] case pos α✝ : Sort u β✝ : α✝ → Sort v α' : Sort w inst✝² : DecidableEq α✝ inst✝¹ : DecidableEq α' f✝ g✝ : (a : α✝) → β✝ a a : α✝ b : β✝ a ι : Sort u_1 inst✝ : DecidableEq ι α : ι → Sort u_2 β : ι → Sort u_3 γ : ι → Sort u_4 f : (i : ι) → α i → β i → γ i g : (i : ι) → α i h : (i : ι) → β i i : ι v : α i w : β i ⊢ f i (update g i v i) (update h i w i) = update (fun k => f k (g k) (h k)) i (f i v w) i [PROOFSTEP] simp [GOAL] case neg α✝ : Sort u β✝ : α✝ → Sort v α' : Sort w inst✝² : DecidableEq α✝ inst✝¹ : DecidableEq α' f✝ g✝ : (a : α✝) → β✝ a a : α✝ b : β✝ a ι : Sort u_1 inst✝ : DecidableEq ι α : ι → Sort u_2 β : ι → Sort u_3 γ : ι → Sort u_4 f : (i : ι) → α i → β i → γ i g : (i : ι) → α i h✝ : (i : ι) → β i i : ι v : α i w : β i j : ι h : ¬j = i ⊢ f j (update g i v j) (update h✝ i w j) = update (fun k => f k (g k) (h✝ k)) i (f i v w) j [PROOFSTEP] simp [h] [GOAL] α✝ : Sort u β✝ : α✝ → Sort v α' : Sort w inst✝² : DecidableEq α✝ inst✝¹ : DecidableEq α' f✝ g : (a : α✝) → β✝ a a✝ : α✝ b✝ : β✝ a✝ α : Sort u_2 inst✝ : DecidableEq α β : α → Sort u_1 a b : α h : a ≠ b v : β a w : β b f : (a : α) → β a ⊢ update (update f a v) b w = update (update f b w) a v [PROOFSTEP] funext c [GOAL] case h α✝ : Sort u β✝ : α✝ → Sort v α' : Sort w inst✝² : DecidableEq α✝ inst✝¹ : DecidableEq α' f✝ g : (a : α✝) → β✝ a a✝ : α✝ b✝ : β✝ a✝ α : Sort u_2 inst✝ : DecidableEq α β : α → Sort u_1 a b : α h : a ≠ b v : β a w : β b f : (a : α) → β a c : α ⊢ update (update f a v) b w c = update (update f b w) a v c [PROOFSTEP] simp only [update] [GOAL] case h α✝ : Sort u β✝ : α✝ → Sort v α' : Sort w inst✝² : DecidableEq α✝ inst✝¹ : DecidableEq α' f✝ g : (a : α✝) → β✝ a a✝ : α✝ b✝ : β✝ a✝ α : Sort u_2 inst✝ : DecidableEq α β : α → Sort u_1 a b : α h : a ≠ b v : β a w : β b f : (a : α) → β a c : α ⊢ (if h : c = b then (_ : b = c) ▸ w else if h : c = a then (_ : a = c) ▸ v else f c) = if h : c = a then (_ : a = c) ▸ v else if h : c = b then (_ : b = c) ▸ w else f c [PROOFSTEP] by_cases h₁ : c = b [GOAL] case pos α✝ : Sort u β✝ : α✝ → Sort v α' : Sort w inst✝² : DecidableEq α✝ inst✝¹ : DecidableEq α' f✝ g : (a : α✝) → β✝ a a✝ : α✝ b✝ : β✝ a✝ α : Sort u_2 inst✝ : DecidableEq α β : α → Sort u_1 a b : α h : a ≠ b v : β a w : β b f : (a : α) → β a c : α h₁ : c = b ⊢ (if h : c = b then (_ : b = c) ▸ w else if h : c = a then (_ : a = c) ▸ v else f c) = if h : c = a then (_ : a = c) ▸ v else if h : c = b then (_ : b = c) ▸ w else f c [PROOFSTEP] by_cases h₂ : c = a [GOAL] case neg α✝ : Sort u β✝ : α✝ → Sort v α' : Sort w inst✝² : DecidableEq α✝ inst✝¹ : DecidableEq α' f✝ g : (a : α✝) → β✝ a a✝ : α✝ b✝ : β✝ a✝ α : Sort u_2 inst✝ : DecidableEq α β : α → Sort u_1 a b : α h : a ≠ b v : β a w : β b f : (a : α) → β a c : α h₁ : ¬c = b ⊢ (if h : c = b then (_ : b = c) ▸ w else if h : c = a then (_ : a = c) ▸ v else f c) = if h : c = a then (_ : a = c) ▸ v else if h : c = b then (_ : b = c) ▸ w else f c [PROOFSTEP] by_cases h₂ : c = a [GOAL] case pos α✝ : Sort u β✝ : α✝ → Sort v α' : Sort w inst✝² : DecidableEq α✝ inst✝¹ : DecidableEq α' f✝ g : (a : α✝) → β✝ a a✝ : α✝ b✝ : β✝ a✝ α : Sort u_2 inst✝ : DecidableEq α β : α → Sort u_1 a b : α h : a ≠ b v : β a w : β b f : (a : α) → β a c : α h₁ : c = b h₂ : c = a ⊢ (if h : c = b then (_ : b = c) ▸ w else if h : c = a then (_ : a = c) ▸ v else f c) = if h : c = a then (_ : a = c) ▸ v else if h : c = b then (_ : b = c) ▸ w else f c [PROOFSTEP] rw [dif_pos h₁, dif_pos h₂] [GOAL] case pos α✝ : Sort u β✝ : α✝ → Sort v α' : Sort w inst✝² : DecidableEq α✝ inst✝¹ : DecidableEq α' f✝ g : (a : α✝) → β✝ a a✝ : α✝ b✝ : β✝ a✝ α : Sort u_2 inst✝ : DecidableEq α β : α → Sort u_1 a b : α h : a ≠ b v : β a w : β b f : (a : α) → β a c : α h₁ : c = b h₂ : c = a ⊢ (_ : b = c) ▸ w = (_ : a = c) ▸ v [PROOFSTEP] cases h (h₂.symm.trans h₁) [GOAL] case neg α✝ : Sort u β✝ : α✝ → Sort v α' : Sort w inst✝² : DecidableEq α✝ inst✝¹ : DecidableEq α' f✝ g : (a : α✝) → β✝ a a✝ : α✝ b✝ : β✝ a✝ α : Sort u_2 inst✝ : DecidableEq α β : α → Sort u_1 a b : α h : a ≠ b v : β a w : β b f : (a : α) → β a c : α h₁ : c = b h₂ : ¬c = a ⊢ (if h : c = b then (_ : b = c) ▸ w else if h : c = a then (_ : a = c) ▸ v else f c) = if h : c = a then (_ : a = c) ▸ v else if h : c = b then (_ : b = c) ▸ w else f c [PROOFSTEP] rw [dif_pos h₁, dif_pos h₁, dif_neg h₂] [GOAL] case pos α✝ : Sort u β✝ : α✝ → Sort v α' : Sort w inst✝² : DecidableEq α✝ inst✝¹ : DecidableEq α' f✝ g : (a : α✝) → β✝ a a✝ : α✝ b✝ : β✝ a✝ α : Sort u_2 inst✝ : DecidableEq α β : α → Sort u_1 a b : α h : a ≠ b v : β a w : β b f : (a : α) → β a c : α h₁ : ¬c = b h₂ : c = a ⊢ (if h : c = b then (_ : b = c) ▸ w else if h : c = a then (_ : a = c) ▸ v else f c) = if h : c = a then (_ : a = c) ▸ v else if h : c = b then (_ : b = c) ▸ w else f c [PROOFSTEP] rw [dif_neg h₁, dif_neg h₁, dif_pos h₂] [GOAL] case neg α✝ : Sort u β✝ : α✝ → Sort v α' : Sort w inst✝² : DecidableEq α✝ inst✝¹ : DecidableEq α' f✝ g : (a : α✝) → β✝ a a✝ : α✝ b✝ : β✝ a✝ α : Sort u_2 inst✝ : DecidableEq α β : α → Sort u_1 a b : α h : a ≠ b v : β a w : β b f : (a : α) → β a c : α h₁ : ¬c = b h₂ : ¬c = a ⊢ (if h : c = b then (_ : b = c) ▸ w else if h : c = a then (_ : a = c) ▸ v else f c) = if h : c = a then (_ : a = c) ▸ v else if h : c = b then (_ : b = c) ▸ w else f c [PROOFSTEP] rw [dif_neg h₁, dif_neg h₁, dif_neg h₂] [GOAL] α✝ : Sort u β✝ : α✝ → Sort v α' : Sort w inst✝² : DecidableEq α✝ inst✝¹ : DecidableEq α' f✝ g : (a : α✝) → β✝ a a✝ : α✝ b : β✝ a✝ α : Sort u_2 inst✝ : DecidableEq α β : α → Sort u_1 a : α v w : β a f : (a : α) → β a ⊢ update (update f a v) a w = update f a w [PROOFSTEP] funext b [GOAL] case h α✝ : Sort u β✝ : α✝ → Sort v α' : Sort w inst✝² : DecidableEq α✝ inst✝¹ : DecidableEq α' f✝ g : (a : α✝) → β✝ a a✝ : α✝ b✝ : β✝ a✝ α : Sort u_2 inst✝ : DecidableEq α β : α → Sort u_1 a : α v w : β a f : (a : α) → β a b : α ⊢ update (update f a v) a w b = update f a w b [PROOFSTEP] by_cases h : b = a [GOAL] case pos α✝ : Sort u β✝ : α✝ → Sort v α' : Sort w inst✝² : DecidableEq α✝ inst✝¹ : DecidableEq α' f✝ g : (a : α✝) → β✝ a a✝ : α✝ b✝ : β✝ a✝ α : Sort u_2 inst✝ : DecidableEq α β : α → Sort u_1 a : α v w : β a f : (a : α) → β a b : α h : b = a ⊢ update (update f a v) a w b = update f a w b [PROOFSTEP] simp [update, h] [GOAL] case neg α✝ : Sort u β✝ : α✝ → Sort v α' : Sort w inst✝² : DecidableEq α✝ inst✝¹ : DecidableEq α' f✝ g : (a : α✝) → β✝ a a✝ : α✝ b✝ : β✝ a✝ α : Sort u_2 inst✝ : DecidableEq α β : α → Sort u_1 a : α v w : β a f : (a : α) → β a b : α h : ¬b = a ⊢ update (update f a v) a w b = update f a w b [PROOFSTEP] simp [update, h] [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort u_3 f✝ f : α → β g : α → γ e' : β → γ b : β inst✝ : Decidable (∃ a, f a = b) ⊢ extend f g e' b = if h : ∃ a, f a = b then g (Classical.choose h) else e' b [PROOFSTEP] unfold extend [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort u_3 f✝ f : α → β g : α → γ e' : β → γ b : β inst✝ : Decidable (∃ a, f a = b) ⊢ (if h : ∃ a, f a = b then g (Classical.choose h) else e' b) = if h : ∃ a, f a = b then g (Classical.choose h) else e' b [PROOFSTEP] congr [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β g : α → γ hf : FactorsThrough g f e' : β → γ a : α ⊢ extend f g e' (f a) = g a [PROOFSTEP] simp only [extend_def, dif_pos, exists_apply_eq_apply] [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β g : α → γ hf : FactorsThrough g f e' : β → γ a : α ⊢ g (Classical.choose (_ : ∃ a_1, f a_1 = f a)) = g a [PROOFSTEP] exact hf (Classical.choose_spec (exists_apply_eq_apply f a)) [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β g : α → γ e' : β → γ b : β hb : ¬∃ a, f a = b ⊢ extend f g e' b = e' b [PROOFSTEP] simp [Function.extend_def, hb] [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β g : α → γ inst✝ : Nonempty γ hf : FactorsThrough g f x : α ⊢ g x = (extend f g (const β (Classical.arbitrary γ)) ∘ f) x [PROOFSTEP] simp only [comp_apply, hf.extend_apply] [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β g : α → γ inst✝ : Nonempty γ h : ∃ e, g = e ∘ f x✝¹ x✝ : α hf : f x✝¹ = f x✝ ⊢ g x✝¹ = g x✝ [PROOFSTEP] rw [Classical.choose_spec h, comp_apply, comp_apply, hf] [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β δ : Sort u_4 g : α → γ hf : FactorsThrough g f F : γ → δ e' : β → γ b : β ⊢ F (extend f g e' b) = extend f (F ∘ g) (F ∘ e') b [PROOFSTEP] by_cases hb : ∃ a, f a = b [GOAL] case pos α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β δ : Sort u_4 g : α → γ hf : FactorsThrough g f F : γ → δ e' : β → γ b : β hb : ∃ a, f a = b ⊢ F (extend f g e' b) = extend f (F ∘ g) (F ∘ e') b case neg α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β δ : Sort u_4 g : α → γ hf : FactorsThrough g f F : γ → δ e' : β → γ b : β hb : ¬∃ a, f a = b ⊢ F (extend f g e' b) = extend f (F ∘ g) (F ∘ e') b [PROOFSTEP] case pos => rcases hb with ⟨a, ha⟩ subst b rw [hf.extend_apply, FactorsThrough.extend_apply, comp] case intro.hf => intro a b h simp only [comp_apply] apply congr_arg exact hf h [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β δ : Sort u_4 g : α → γ hf : FactorsThrough g f F : γ → δ e' : β → γ b : β hb : ∃ a, f a = b ⊢ F (extend f g e' b) = extend f (F ∘ g) (F ∘ e') b [PROOFSTEP] case pos => rcases hb with ⟨a, ha⟩ subst b rw [hf.extend_apply, FactorsThrough.extend_apply, comp] case intro.hf => intro a b h simp only [comp_apply] apply congr_arg exact hf h [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β δ : Sort u_4 g : α → γ hf : FactorsThrough g f F : γ → δ e' : β → γ b : β hb : ∃ a, f a = b ⊢ F (extend f g e' b) = extend f (F ∘ g) (F ∘ e') b [PROOFSTEP] rcases hb with ⟨a, ha⟩ [GOAL] case intro α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β δ : Sort u_4 g : α → γ hf : FactorsThrough g f F : γ → δ e' : β → γ b : β a : α ha : f a = b ⊢ F (extend f g e' b) = extend f (F ∘ g) (F ∘ e') b [PROOFSTEP] subst b [GOAL] case intro α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β δ : Sort u_4 g : α → γ hf : FactorsThrough g f F : γ → δ e' : β → γ a : α ⊢ F (extend f g e' (f a)) = extend f (F ∘ g) (F ∘ e') (f a) [PROOFSTEP] rw [hf.extend_apply, FactorsThrough.extend_apply, comp] [GOAL] case intro.hf α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β δ : Sort u_4 g : α → γ hf : FactorsThrough g f F : γ → δ e' : β → γ a : α ⊢ FactorsThrough (F ∘ g) f [PROOFSTEP] case intro.hf => intro a b h simp only [comp_apply] apply congr_arg exact hf h [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β δ : Sort u_4 g : α → γ hf : FactorsThrough g f F : γ → δ e' : β → γ a : α ⊢ FactorsThrough (F ∘ g) f [PROOFSTEP] case intro.hf => intro a b h simp only [comp_apply] apply congr_arg exact hf h [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β δ : Sort u_4 g : α → γ hf : FactorsThrough g f F : γ → δ e' : β → γ a : α ⊢ FactorsThrough (F ∘ g) f [PROOFSTEP] intro a b h [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β δ : Sort u_4 g : α → γ hf : FactorsThrough g f F : γ → δ e' : β → γ a✝ a b : α h : f a = f b ⊢ (F ∘ g) a = (F ∘ g) b [PROOFSTEP] simp only [comp_apply] [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β δ : Sort u_4 g : α → γ hf : FactorsThrough g f F : γ → δ e' : β → γ a✝ a b : α h : f a = f b ⊢ F (g a) = F (g b) [PROOFSTEP] apply congr_arg [GOAL] case h α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β δ : Sort u_4 g : α → γ hf : FactorsThrough g f F : γ → δ e' : β → γ a✝ a b : α h : f a = f b ⊢ g a = g b [PROOFSTEP] exact hf h [GOAL] case neg α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β δ : Sort u_4 g : α → γ hf : FactorsThrough g f F : γ → δ e' : β → γ b : β hb : ¬∃ a, f a = b ⊢ F (extend f g e' b) = extend f (F ∘ g) (F ∘ e') b [PROOFSTEP] case neg => rw [extend_apply' _ _ _ hb, extend_apply' _ _ _ hb, comp] [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β δ : Sort u_4 g : α → γ hf : FactorsThrough g f F : γ → δ e' : β → γ b : β hb : ¬∃ a, f a = b ⊢ F (extend f g e' b) = extend f (F ∘ g) (F ∘ e') b [PROOFSTEP] case neg => rw [extend_apply' _ _ _ hb, extend_apply' _ _ _ hb, comp] [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β δ : Sort u_4 g : α → γ hf : FactorsThrough g f F : γ → δ e' : β → γ b : β hb : ¬∃ a, f a = b ⊢ F (extend f g e' b) = extend f (F ∘ g) (F ∘ e') b [PROOFSTEP] rw [extend_apply' _ _ _ hb, extend_apply' _ _ _ hb, comp] [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β hf : Injective f e' : β → γ ⊢ Injective fun g => extend f g e' [PROOFSTEP] intro g₁ g₂ hg [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β hf : Injective f e' : β → γ g₁ g₂ : α → γ hg : (fun g => extend f g e') g₁ = (fun g => extend f g e') g₂ ⊢ g₁ = g₂ [PROOFSTEP] refine' funext fun x ↦ _ [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β hf : Injective f e' : β → γ g₁ g₂ : α → γ hg : (fun g => extend f g e') g₁ = (fun g => extend f g e') g₂ x : α ⊢ g₁ x = g₂ x [PROOFSTEP] have H := congr_fun hg (f x) [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β hf : Injective f e' : β → γ g₁ g₂ : α → γ hg : (fun g => extend f g e') g₁ = (fun g => extend f g e') g₂ x : α H : (fun g => extend f g e') g₁ (f x) = (fun g => extend f g e') g₂ (f x) ⊢ g₁ x = g₂ x [PROOFSTEP] simp only [hf.extend_apply] at H [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β hf : Injective f e' : β → γ g₁ g₂ : α → γ hg : (fun g => extend f g e') g₁ = (fun g => extend f g e') g₂ x : α H : g₁ x = g₂ x ⊢ g₁ x = g₂ x [PROOFSTEP] exact H [GOAL] α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β hf : Bijective f g : α → γ ⊢ (fun g => g ∘ f) (g ∘ surjInv (_ : Surjective f)) = g [PROOFSTEP] simp only [comp.assoc g _ f, (leftInverse_surjInv hf).comp_eq_id, comp.right_id] [GOAL] α : Sort u f : α → α h : Involutive f P : Prop inst✝ : Decidable P x : α ⊢ f (if P then x else f x) = if ¬P then x else f x [PROOFSTEP] rw [apply_ite f, h, ite_not] [GOAL] p : Prop α : Sort u_1 inst✝ : Nonempty α P : α → Prop f : p → α a : p h : P (f a) ⊢ P (sometimes f) [PROOFSTEP] rwa [sometimes_eq] [GOAL] α β : Sort u_1 h : α = β ⊢ Bijective (Eq.mp h) [PROOFSTEP] cases h [GOAL] case refl α : Sort u_1 ⊢ Bijective (Eq.mp (_ : α = α)) [PROOFSTEP] refine ⟨fun _ _ ↦ id, fun x ↦ ⟨x, rfl⟩⟩ [GOAL] α β : Sort u_1 h : α = β ⊢ Bijective (Eq.mpr h) [PROOFSTEP] cases h [GOAL] case refl α : Sort u_1 ⊢ Bijective (Eq.mpr (_ : α = α)) [PROOFSTEP] refine ⟨fun _ _ ↦ id, fun x ↦ ⟨x, rfl⟩⟩ [GOAL] α β : Sort u_1 h : α = β ⊢ Bijective (cast h) [PROOFSTEP] cases h [GOAL] case refl α : Sort u_1 ⊢ Bijective (cast (_ : α = α)) [PROOFSTEP] refine ⟨fun _ _ ↦ id, fun x ↦ ⟨x, rfl⟩⟩ [GOAL] α : Sort u_1 β : Sort u_2 γ : β → Sort v f : α → β g : β → α h : LeftInverse g f C : (a : α) → γ (f a) a : α ⊢ HEq (C (g (f a))) (C a) [PROOFSTEP] rw [h] [GOAL] α : Sort u_1 β : Sort u_2 γ : β → Sort v f : α → β g : β → α h : LeftInverse g f C : (a : α) → γ (f a) a : α ⊢ cast (_ : γ (f (g (f a))) = γ (f a)) (C (g (f a))) = C a [PROOFSTEP] rw [cast_eq_iff_heq, h]
State Before: l : Type ?u.135132 m : Type u_1 n : Type u_2 o : Type u_3 p : Type ?u.135144 q : Type ?u.135147 m' : o → Type ?u.135152 n' : o → Type ?u.135157 p' : o → Type ?u.135162 R : Type ?u.135165 S : Type ?u.135168 α : Type u_4 β : Type ?u.135174 inst✝² : DecidableEq o inst✝¹ : Zero α inst✝ : Zero β ⊢ blockDiagonal 0 = 0 State After: case a.h l : Type ?u.135132 m : Type u_1 n : Type u_2 o : Type u_3 p : Type ?u.135144 q : Type ?u.135147 m' : o → Type ?u.135152 n' : o → Type ?u.135157 p' : o → Type ?u.135162 R : Type ?u.135165 S : Type ?u.135168 α : Type u_4 β : Type ?u.135174 inst✝² : DecidableEq o inst✝¹ : Zero α inst✝ : Zero β i✝ : m × o x✝ : n × o ⊢ blockDiagonal 0 i✝ x✝ = OfNat.ofNat 0 i✝ x✝ Tactic: ext State Before: case a.h l : Type ?u.135132 m : Type u_1 n : Type u_2 o : Type u_3 p : Type ?u.135144 q : Type ?u.135147 m' : o → Type ?u.135152 n' : o → Type ?u.135157 p' : o → Type ?u.135162 R : Type ?u.135165 S : Type ?u.135168 α : Type u_4 β : Type ?u.135174 inst✝² : DecidableEq o inst✝¹ : Zero α inst✝ : Zero β i✝ : m × o x✝ : n × o ⊢ blockDiagonal 0 i✝ x✝ = OfNat.ofNat 0 i✝ x✝ State After: no goals Tactic: simp [blockDiagonal_apply]
Formal statement is: lemma prime_nat_not_dvd: assumes "prime p" "p > n" "n \<noteq> (1::nat)" shows "\<not>n dvd p" Informal statement is: If $p$ is a prime number greater than $n$, then $p$ is not divisible by $n$.
(* This Isabelle theory is produced using the TIP tool offered at the following website: https://github.com/tip-org/tools This file was originally provided as part of TIP benchmark at the following website: https://github.com/tip-org/benchmarks Yutaka Nagashima at CIIRC, CTU changed the TIP output theory file slightly to make it compatible with Isabelle2017. \:w Some proofs were added by Yutaka Nagashima.*) theory TIP_sort_nat_ISortSorts imports "../../Test_Base" begin datatype 'a list = nil2 | cons2 "'a" "'a list" datatype Nat = Z | S "Nat" fun le :: "Nat => Nat => bool" where "le (Z) y = True" | "le (S z) (Z) = False" | "le (S z) (S x2) = le z x2" fun ordered :: "Nat list => bool" where "ordered (nil2) = True" | "ordered (cons2 y (nil2)) = True" | "ordered (cons2 y (cons2 y2 xs)) = ((le y y2) & (ordered (cons2 y2 xs)))" fun insert :: "Nat => Nat list => Nat list" where "insert x (nil2) = cons2 x (nil2)" | "insert x (cons2 z xs) = (if le x z then cons2 x (cons2 z xs) else cons2 z (insert x xs))" fun isort :: "Nat list => Nat list" where "isort (nil2) = nil2" | "isort (cons2 y xs) = insert y (isort xs)" theorem property0 : "ordered (isort xs)" oops end
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! EVB-QMDFF - RPMD molecular dynamics and rate constant calculations on ! black-box generated potential energy surfaces ! ! Copyright (c) 2021 by Julien Steffen ([email protected]) ! Stefan Grimme ([email protected]) (QMDFF code) ! ! Permission is hereby granted, free of charge, to any person obtaining a ! copy of this software and associated documentation files (the "Software"), ! to deal in the Software without restriction, including without limitation ! the rights to use, copy, modify, merge, publish, distribute, sublicense, ! and/or sell copies of the Software, and to permit persons to whom the ! Software is furnished to do so, subject to the following conditions: ! ! The above copyright notice and this permission notice shall be included in ! all copies or substantial portions of the Software. ! ! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ! IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ! FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ! THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ! LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ! FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ! DEALINGS IN THE SOFTWARE. ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! subroutine ffhess: calculate the numerical QMDFF hessian based ! on the analytical gradients for parameter optimization ! ! part of QMDFF ! subroutine ffhess(n,at,xyz,q,r0ab,zab,r094,sr42,c6xy, & & n3,iadr,hessatoms,ffh,ip) implicit none integer::n,n3,ip,at(n),iadr(2,n3) integer::hessatoms(5,*) integer::i,j,ii,jj,kk,ia,jc,ja,ic,ih real(kind=8)::xyz(3,n),ffh(n3) real(kind=8)::step,step2,gl(3,n),gr(3,n),e real(kind=8)::r0ab(94,94),zab(94,94),r094(94,94) real(kind=8)::sr42(94,94),c6xy(n,n),q(n) real(kind=4),allocatable :: h(:,:) allocate(h(3*n,3*n)) h=0 step=0.001 step2=1./(2.*step) ! ! for the standard case: hessian of QMDFF minimum ! if (ip.eq.0) then do ia = 1, n do ic = 1, 3 ii = (ia-1)*3 + ic xyz(ic,ia)=xyz(ic,ia)+step call ff_eg (n,at,xyz,e,gr) call ff_nonb(n,at,xyz,q,r0ab,zab,r094, & & sr42,c6xy,e,gr) call ff_hb(n,at,xyz,e,gr) xyz(ic,ia)=xyz(ic,ia)-2.*step call ff_eg (n,at,xyz,e,gl) call ff_nonb(n,at,xyz,q,r0ab,zab,r094, & & sr42,c6xy,e,gl) call ff_hb(n,at,xyz,e,gl) xyz(ic,ia)=xyz(ic,ia)+step do ja = 1, n do jc = 1, 3 jj = (ja-1)*3 + jc h(ii,jj) =(gr(jc,ja) - gl(jc,ja)) * step2 end do end do end do end do else ! ! for Levenberg-Marquard derivations after force constants ! to fill the matrix aa (called by pderiv-routine) ! do ih=1,hessatoms(5,ip) ia=hessatoms(ih,ip) do ic = 1, 3 ii = (ia-1)*3 + ic xyz(ic,ia)=xyz(ic,ia)+step call ff_egh(n,at,xyz,e,gr,ia) xyz(ic,ia)=xyz(ic,ia)-2.*step call ff_egh(n,at,xyz,e,gl,ia) xyz(ic,ia)=xyz(ic,ia)+step do ja = 1, n do jc = 1, 3 jj = (ja-1)*3 + jc h(ii,jj) =(gr(jc,ja) - gl(jc,ja)) * step2 end do end do end do end do end if do kk=1,n3 i=iadr(1,kk) j=iadr(2,kk) ffh(kk)=(h(i,j)+h(j,i))*0.5 end do deallocate(h) return end subroutine ffhess
import tactic.interactive tactic.squeeze data.nat.modeq variables n m : nat @[simp] def is_odd_a : ℕ → bool | 0 := ff | (nat.succ n) := bnot (is_odd_a n) #reduce is_odd_a (n + 2) lemma odd_ss_a : is_odd_a (n + 2) = is_odd_a n := begin dsimp[is_odd_a], cases is_odd_a n; refl, end lemma odd_add_a : ∀ n m : ℕ , is_odd_a (n + m) = bxor (is_odd_a n) (is_odd_a m) | n 0 := by rw[is_odd_a,nat.add_zero,bxor_ff] | n (m + 1) := begin rw[nat.add_succ,is_odd_a,is_odd_a,(odd_add_a n m)], cases (is_odd_a n); cases (is_odd_a m); refl, end /- ------------------------------------------------------------ -/ @[simp] def s : ℕ × bool → ℕ × bool | ⟨n,ff⟩ := ⟨n,tt⟩ | ⟨n,tt⟩ := ⟨n.succ,ff⟩ @[simp] def ss : ℕ → ℕ × bool | 0 := ⟨0,ff⟩ | (nat.succ n) := s (ss n) def is_odd_b (n : ℕ) : bool := (ss n).2 #reduce ss (n + 2) lemma odd_ss_b : is_odd_b (n + 2) = is_odd_b n := begin dsimp[is_odd_b,ss,s], rcases (ss n) with ⟨k,tt|ff⟩;refl, end def Nb_add : ℕ × bool → ℕ × bool → ℕ × bool | ⟨n,ff⟩ ⟨m,b⟩ := ⟨n+m,b⟩ | ⟨n,tt⟩ ⟨m,ff⟩ := ⟨n+m,tt⟩ | ⟨n,tt⟩ ⟨m,tt⟩ := ⟨n+m+1,ff⟩ lemma Nb_add_s (u v) : Nb_add u (s v) = s (Nb_add u v) := begin rcases u with ⟨i,ff|tt⟩; rcases v with ⟨j,ff|tt⟩; refl, end lemma ss_add (n m : ℕ) : ss (n + m) = Nb_add (ss n) (ss m) := begin induction m with m ih_m, {rw[add_zero,ss],cases (ss n) with k b; cases b; refl}, {rw[nat.add_succ,ss,ss,ih_m,Nb_add_s],} end lemma odd_add_b : ∀ n m : ℕ, is_odd_b (n + m) = bxor (is_odd_b n) (is_odd_b m) := begin intros n m, rw[is_odd_b,is_odd_b,is_odd_b,ss_add], rcases (ss n) with ⟨i,ff|tt⟩; rcases (ss m) with ⟨j,ff|tt⟩; refl, end /- ------------------------------------------------------------ -/ @[simp] def is_odd_c (n : ℕ) : bool := if n % 2 = 0 then ff else tt lemma odd_ss_c : is_odd_c (n + 2) = is_odd_c n := begin dsimp[is_odd_c], rw [nat.add_mod_right n 2] end /- ------------------------------------------------------------ -/ mutual def is_odd_d, is_even_d with is_odd_d : nat → bool | 0 := ff | (n + 1) := is_even_d n with is_even_d : nat → bool | 0 := tt | (n + 1) := is_odd_d n #check n #reduce is_odd_d (n + 2) lemma odd_ss_d : is_odd_d (n + 2) = is_odd_d n := begin rw[is_odd_d,is_even_d], end lemma odd_even_d : ∀ (n : ℕ), is_odd_d n = bnot (is_even_d n) | 0 := by {rw[is_odd_d,is_even_d],refl} | (n + 1) := by {rw[is_odd_d,is_even_d,odd_even_d n,bnot_bnot],} @[inline] def beq : bool → bool → bool | tt tt := tt | ff ff := tt | _ _ := ff lemma even_add_d : ∀ n m : ℕ, is_even_d (n + m) = beq (is_even_d n) (is_even_d m) := begin intros n m, induction m with m ih_m, {rw[add_zero,is_even_d],cases is_even_d n;refl}, {rw[nat.add_succ,is_even_d,is_even_d,odd_even_d,odd_even_d,ih_m], cases is_even_d n;cases is_even_d m; refl, } end lemma odd_add_d : ∀ n m : ℕ, is_odd_d (n + m) = bxor (is_odd_d n) (is_odd_d m) := begin intros n m, rw[odd_even_d,odd_even_d,odd_even_d,even_add_d], cases is_even_d n;cases is_even_d m; refl, end
Formal statement is: lemma uniformly_continuous_on_add[continuous_intros]: fixes f g :: "'a::metric_space \<Rightarrow> 'b::real_normed_vector" assumes "uniformly_continuous_on s f" and "uniformly_continuous_on s g" shows "uniformly_continuous_on s (\<lambda>x. f x + g x)" Informal statement is: If $f$ and $g$ are uniformly continuous on a set $S$, then $f + g$ is uniformly continuous on $S$.
[STATEMENT] lemma vals_merge_distinct: "distinct (bt_dfs val t) \<Longrightarrow> distinct (bt_dfs val r) \<Longrightarrow> set (bt_dfs val t) \<inter> set (bt_dfs val r) = {} \<Longrightarrow> distinct (bt_dfs val (merge t r))" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<lbrakk>distinct (bt_dfs val t); distinct (bt_dfs val r); set (bt_dfs val t) \<inter> set (bt_dfs val r) = {}\<rbrakk> \<Longrightarrow> distinct (bt_dfs val (merge t r)) [PROOF STEP] by (auto simp add: bt_dfs_simp merge_def)
function a = bab ( n, alpha, beta ) %*****************************************************************************80 % %% BAB returns the BAB matrix. % % Example: % % N = 5 % ALPHA = 5, BETA = 2 % % 5 2 . . . % 2 5 2 . . % . 2 5 2 . % . . 2 5 2 % . . . 2 5 % % Properties: % % A is banded, with bandwidth 3. % % A is tridiagonal. % % Because A is tridiagonal, it has property A (bipartite). % % A is Toeplitz: constant along diagonals. % % A is symmetric: A' = A. % % Because A is symmetric, it is normal. % % Because A is normal, it is diagonalizable. % % A is persymmetric: A(I,J) = A(N+1-J,N+1-I). % % The family of matrices is nested as a function of N. % % Licensing: % % This code is distributed under the GNU LGPL license. % % Modified: % % 05 November 2007 % % Author: % % John Burkardt % % Reference: % % CM da Fonseca, J Petronilho, % Explicit Inverses of Some Tridiagonal Matrices, % Linear Algebra and Its Applications, % Volume 325, 2001, pages 7-21. % % Parameters: % % Input, integer N, the order of the matrix. % % Input, real ALPHA, BETA, the parameters. % % Output, real A(N,N), the matrix. % a = zeros ( n, n ); for i = 1 : n a(i,i) = alpha; end for i = 1 : n - 1 a(i,i+1) = beta; a(i+1,i) = beta; end return end
#ifndef SEARCHPATTERNBUILDER_HHHHH #define SEARCHPATTERNBUILDER_HHHHH #include "detail/SearchPatternBase.h" #include "SearchPattern.h" #include <vector> #include <string> #include <memory> #include <gsl/string_span> namespace MPSig { class SearchPatternBuilder { std::vector<std::unique_ptr<detail::SearchPatternBase>> m_patternSteps; public: SearchPatternBuilder(); SearchPatternBuilder& HasHexPattern(gsl::cstring_span<-1> pattern); SearchPatternBuilder& ReferencesBSTR(gsl::cwstring_span<-1> bstrText); SearchPattern Compile(); }; } #endif
theory T20 imports Main begin lemma "( (\<forall> x::nat. \<forall> y::nat. meet(x, y) = meet(y, x)) & (\<forall> x::nat. \<forall> y::nat. join(x, y) = join(y, x)) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. meet(x, meet(y, z)) = meet(meet(x, y), z)) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. join(x, join(y, z)) = join(join(x, y), z)) & (\<forall> x::nat. \<forall> y::nat. meet(x, join(x, y)) = x) & (\<forall> x::nat. \<forall> y::nat. join(x, meet(x, y)) = x) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. mult(x, join(y, z)) = join(mult(x, y), mult(x, z))) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. mult(join(x, y), z) = join(mult(x, z), mult(y, z))) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. meet(x, over(join(mult(x, y), z), y)) = x) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. meet(y, undr(x, join(mult(x, y), z))) = y) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. join(mult(over(x, y), y), x) = x) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. join(mult(y, undr(y, x)), x) = x) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. mult(meet(x, y), z) = meet(mult(x, z), mult(y, z))) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. over(x, meet(y, z)) = join(over(x, y), over(x, z))) & (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. undr(meet(x, y), z) = join(undr(x, z), undr(y, z))) & (\<forall> x::nat. \<forall> y::nat. invo(join(x, y)) = meet(invo(x), invo(y))) & (\<forall> x::nat. \<forall> y::nat. invo(meet(x, y)) = join(invo(x), invo(y))) & (\<forall> x::nat. invo(invo(x)) = x) ) \<longrightarrow> (\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. mult(x, meet(y, z)) = meet(mult(x, y), mult(x, z))) " nitpick[card nat=8,timeout=86400] oops end
/- Copyright (c) 2021 Lu-Ming Zhang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Lu-Ming Zhang -/ import linear_algebra.matrix.trace /-! # Hadamard product of matrices This file defines the Hadamard product `matrix.hadamard` and contains basic properties about them. ## Main definition - `matrix.hadamard`: defines the Hadamard product, which is the pointwise product of two matrices of the same size. ## Notation * `⊙`: the Hadamard product `matrix.hadamard`; ## References * <https://en.wikipedia.org/wiki/hadamard_product_(matrices)> ## Tags hadamard product, hadamard -/ variables {α β γ m n : Type*} variables {R : Type*} namespace matrix open_locale matrix big_operators /-- `matrix.hadamard` defines the Hadamard product, which is the pointwise product of two matrices of the same size.-/ @[simp] def hadamard [has_mul α] (A : matrix m n α) (B : matrix m n α) : matrix m n α | i j := A i j * B i j localized "infix ` ⊙ `:100 := matrix.hadamard" in matrix section basic_properties variables (A : matrix m n α) (B : matrix m n α) (C : matrix m n α) /- commutativity -/ lemma hadamard_comm [comm_semigroup α] : A ⊙ B = B ⊙ A := ext $ λ _ _, mul_comm _ _ /- associativity -/ lemma hadamard_assoc [semigroup α] : A ⊙ B ⊙ C = A ⊙ (B ⊙ C) := ext $ λ _ _, mul_assoc _ _ _ /- distributivity -/ lemma hadamard_add [distrib α] : A ⊙ (B + C) = A ⊙ B + A ⊙ C := ext $ λ _ _, left_distrib _ _ _ lemma add_hadamard [distrib α] : (B + C) ⊙ A = B ⊙ A + C ⊙ A := ext $ λ _ _, right_distrib _ _ _ /- scalar multiplication -/ section scalar @[simp] lemma smul_hadamard [has_mul α] [has_smul R α] [is_scalar_tower R α α] (k : R) : (k • A) ⊙ B = k • A ⊙ B := ext $ λ _ _, smul_mul_assoc _ _ _ @[simp] lemma hadamard_smul [has_mul α] [has_smul R α] [smul_comm_class R α α] (k : R): A ⊙ (k • B) = k • A ⊙ B := ext $ λ _ _, mul_smul_comm _ _ _ end scalar section zero variables [mul_zero_class α] @[simp] lemma hadamard_zero : A ⊙ (0 : matrix m n α) = 0 := ext $ λ _ _, mul_zero _ @[simp] lemma zero_hadamard : (0 : matrix m n α) ⊙ A = 0 := ext $ λ _ _, zero_mul _ end zero section one variables [decidable_eq n] [mul_zero_one_class α] variables (M : matrix n n α) lemma hadamard_one : M ⊙ (1 : matrix n n α) = diagonal (λ i, M i i) := by { ext, by_cases h : i = j; simp [h] } lemma one_hadamard : (1 : matrix n n α) ⊙ M = diagonal (λ i, M i i) := by { ext, by_cases h : i = j; simp [h] } end one section diagonal variables [decidable_eq n] [mul_zero_class α] lemma diagonal_hadamard_diagonal (v : n → α) (w : n → α) : diagonal v ⊙ diagonal w = diagonal (v * w) := ext $ λ _ _, (apply_ite2 _ _ _ _ _ _).trans (congr_arg _ $ zero_mul 0) end diagonal section trace variables [fintype m] [fintype n] variables (R) [semiring α] [semiring R] [module R α] lemma sum_hadamard_eq : ∑ (i : m) (j : n), (A ⊙ B) i j = trace (A ⬝ Bᵀ) := rfl lemma dot_product_vec_mul_hadamard [decidable_eq m] [decidable_eq n] (v : m → α) (w : n → α) : dot_product (vec_mul v (A ⊙ B)) w = trace (diagonal v ⬝ A ⬝ (B ⬝ diagonal w)ᵀ) := begin rw [←sum_hadamard_eq, finset.sum_comm], simp [dot_product, vec_mul, finset.sum_mul, mul_assoc], end end trace end basic_properties end matrix
-- Church numerals -- Another way of doing nat. -- The church nat, chℕ (happy to change the name) is a pi type -- and not a structure. So proofs are not done by induction! --import data.equiv --open or def chℕ := Π X : Type, (X → X) → X → X def chℕfree := {m : Π X : Type, (X → X) → X → X // ∀ (X Y : Type) (a : X → Y) (f : X → X) (x : X), m (X → Y) (λ g, g ∘ f) a x = a (m X f x)} namespace chnat -- forgetful functor definition of_chnatfree : chℕfree → chℕ := λ m, m.val -- we can go back from chℕ to ℕ definition to_nat : chℕ → ℕ := λ m, m ℕ nat.succ 0 -- there is a beauty here -- it is almost as if the structure ℕ were built to be fed into chℕ -- chℕ is the church encoding of ℕ. --open nat -- map from normal nats open nat def of_nat : ℕ → chℕ | (zero) := λ X f x, x | (succ n) := λ X f x, f (of_nat n X f x) --this works theorem nat_of_chnat_of_nat (n : ℕ) : to_nat (of_nat n) = n := begin induction n with d Hd, -- n = 0 case { refl }, -- n = d + 1 unfold of_nat, intros,unfold to_nat, unfold to_nat at Hd, rw Hd, end definition of_nat' : ℕ → chℕ | 0 := λ X f x, x | (n + 1) := λ X f x, of_nat' n X f (f x) --a bit different -- Might need to write a different destructor for ℕ? True for n implies true for 1 + n? -- broken and I don't kow why /- theorem of_nat'_is_of_nat (n : ℕ) : of_nat n = of_nat' n := begin induction n with d Hd, { refl}, unfold of_nat, unfold of_nat', funext, rw Hd, conv { to_rhs, rw ←Hd, }, --clear Hd, cases d with e, { refl}, unfold of_nat at *, unfold of_nat' at *, exact Hd, -- error is here end -/ variable (n : ℕ) #reduce (n + 1) lemma of_nat_functorial (n : ℕ) (X Y : Type) (a : X → Y) (f : X → X) (x : X) : a (of_nat n X f x) = of_nat n (X → Y) (λ g x', g (f x')) a x := begin induction n with d Hd,refl, unfold of_nat, -- I have the wrong constructor. end #check of_nat_functorial theorem of_nat_is_chnatfree (n : ℕ) : ∀ (X Y : Type) (a : X → Y) (f : X → X) (x : X), (of_nat n) (X → Y) (λ g, g ∘ f) a x = a ((of_nat n) X f x) := begin induction n with d Hd, -- base case intros,refl, -- inductive step intros,unfold of_nat, -- v1 have H1 := Hd X Y (a ∘ f) f x, -- goal : f (of_nat d X f x) = of_nat d X f (f x) have H2 := Hd X Y a f (f x), admit, end --| 0 := ⟨λ X f x, x,by intros;refl⟩ --| (succ n) := ⟨λ X f x, -- f ((of_nat n).val X f x), -- by {intros,have H := (of_nat n).property X Y a h x,simp * at *, rw ←H,sorry}⟩ -- (of_nat n).val X f $ f x, -- by {intros, have H := (of_nat n).property X Y a f (f x),rw ←H, -- show (of_nat n).val (X → Y) (λ (g : X → Y), g ∘ f) (a ∘ f) x = -- (of_nat n).val (X → Y) (λ (g : X → Y), g ∘ f) a (f x), -- exact _}⟩ -- can I close nat now? -- examples of chnats def c0 := of_nat 0 def c1 := of_nat 1 def c2 := of_nat 2 def c3 := of_nat 3 -- now we have some constants. -- what is zero? example (X f x) : c0 X f x = x := rfl -- what is one? example (X f x) : c1 X f x = f x := rfl -- what is two? example (X f x) : c2 X f x = f (f x) := rfl -- what is three? example (X f x) : c3 X f x = f (f (f x)) := rfl -- and so on -- that definition needs to be moved if we can't prove functoriality wrt succ example : to_nat c3 = 3 := rfl -- exercise: define succ def succ :chℕ → chℕ := sorry -- KB can do this one -- no notation --unit tests -- KB can pass these example : succ c0 = c1 := sorry example : succ c2 = c3 := sorry example (n : ℕ) : of_nat (nat.succ n) = succ (of_nat n) := sorry --KB can't do this one. Is it unprovable? If so, move definition of to_nat much further down. example (m : chℕ) : to_nat (succ m) = nat.succ (to_nat m) := sorry -- exercise : define add def add : chℕ → chℕ → chℕ := sorry -- KB can do this instance : has_add chℕ := ⟨add⟩ -- now we have + notation example : c2 + c1 = c3 := sorry -- KB didn't do this one yet but feels it should be true. example (m n : ℕ) : of_nat (m + n) = of_nat m + of_nat n := sorry -- exercise : define mul def mul : chℕ → chℕ → chℕ := sorry -- KB can do this instance : has_mul chℕ := ⟨mul⟩ -- incantation to give us * -- KB can do this one example : c1 + c2 + c3 = c2 * c3 := sorry -- KB didn't try this one example (m n : ℕ) : of_nat (m * n) = of_nat m * of_nat n := sorry -- exercise : define pow def pow : chℕ → chℕ → chℕ := sorry -- KB can do this one -- instance : has_pow chℕ := ⟨pow⟩ -- doesn't seem to work -- KB can do this example : pow c2 c3 + c1 = pow c3 c2 := sorry -- KB didn't try this example (m n : ℕ) : nat.pow m n = pow (of_nat m) (of_nat n) := sorry -- exercise : define Ackermann def ack : chℕ → chℕ → chℕ := sorry -- KB didn't try this one -- Is it possible? -- if it's possible, prove it agrees with usual ackermnann -- example : ack m n = ack (of_nat m) (of_nat n) := sorry -- question : Is this provable? KB couldn't do this one theorem add_comm (m n : chℕ) : m + n = n + m := sorry -- KB thinks this might be chℕ's free theorem -- KB can't prove it theorem free_chnat : ∀ (A B : Type), ∀ f : A → B, ∀ r : chℕ, ∀ a : A, r (A → B) (λ g,f) f a = r (A → B) (λ g,g) f a := sorry structure equiv' (α : Sort*) (β : Sort*) := (to_fun : α → β) (inv_fun : β → α) (left_inv : ∀ (x : α), inv_fun (to_fun x) = x) (right_inv : ∀ (y : β), to_fun (inv_fun y) = y) -- is ℕ equiv to chℕ ? theorem ij : ∀ n : ℕ, to_nat (of_nat n) = n := begin intro n, induction n with d Hd,refl, unfold of_nat, unfold to_nat, unfold to_nat at Hd, rw Hd, end -- KB can't do this one theorem ji : ∀ c : chℕ, of_nat (to_nat c) = c := sorry -- Can someone write down an uncomputable counterexample? -- so KB can't do this either definition ℕ_is_chℕ : equiv' ℕ chℕ := sorry -- idle question theorem is_it_true (X : Type) (f : X → X) (x : X) : f x = x := sorry end chnat
[STATEMENT] lemma DomAppend: "Dom L \<subseteq> Dom((a, b) # L)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. Dom L \<subseteq> Dom ((a, b) # L) [PROOF STEP] by (simp add: Dom_def, auto)
-- Andreas, 2021-12-22, issue #5705 reported by ksqsf open import Agda.Builtin.Equality crash : Set ≡ Set9223372036854775808 crash = refl -- This should fail, but crashes in Agda 2.6.2 due to Int overflow.
rn = randn(1000) bi = Binning.binindex(rn, equaldistancelimits(rn, 11)) support = binsupport(bi, 1:11) xvals = map(x->first(x), support) yvals = map(x->last(x), support) sinv = sin.(0:(pi*2/999):pi*2) bi_sinv = Binning.binindex(sinv, equaldistancelimits(sinv,11)) plot(equaldistancelimits(sinv,11), last.(binsupport(bi_sinv, 1:11)))
(* Title: HOL/Auth/n_german_lemma_inv__6_on_rules.thy Author: Yongjian Li and Kaiqiang Duan, State Key Lab of Computer Science, Institute of Software, Chinese Academy of Sciences Copyright 2016 State Key Lab of Computer Science, Institute of Software, Chinese Academy of Sciences *) header{*The n_german Protocol Case Study*} theory n_german_lemma_inv__6_on_rules imports n_german_lemma_on_inv__6 begin section{*All lemmas on causal relation between inv__6*} lemma lemma_inv__6_on_rules: assumes b1: "r \<in> rules N" and b2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__6 p__Inv4)" shows "invHoldForRule s f r (invariants N)" proof - have c1: "(\<exists> j. j\<le>N\<and>r=n_SendReqS j)\<or> (\<exists> i. i\<le>N\<and>r=n_SendReqEI i)\<or> (\<exists> i. i\<le>N\<and>r=n_SendReqES i)\<or> (\<exists> i. i\<le>N\<and>r=n_RecvReq N i)\<or> (\<exists> i. i\<le>N\<and>r=n_SendInvE i)\<or> (\<exists> i. i\<le>N\<and>r=n_SendInvS i)\<or> (\<exists> i. i\<le>N\<and>r=n_SendInvAck i)\<or> (\<exists> i. i\<le>N\<and>r=n_RecvInvAck i)\<or> (\<exists> i. i\<le>N\<and>r=n_SendGntS i)\<or> (\<exists> i. i\<le>N\<and>r=n_SendGntE N i)\<or> (\<exists> i. i\<le>N\<and>r=n_RecvGntS i)\<or> (\<exists> i. i\<le>N\<and>r=n_RecvGntE i)\<or> (\<exists> i d. i\<le>N\<and>d\<le>N\<and>r=n_Store i d)" apply (cut_tac b1, auto) done moreover { assume d1: "(\<exists> j. j\<le>N\<and>r=n_SendReqS j)" have "invHoldForRule s f r (invariants N)" apply (cut_tac b2 d1, metis n_SendReqSVsinv__6) done } moreover { assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendReqEI i)" have "invHoldForRule s f r (invariants N)" apply (cut_tac b2 d1, metis n_SendReqEIVsinv__6) done } moreover { assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendReqES i)" have "invHoldForRule s f r (invariants N)" apply (cut_tac b2 d1, metis n_SendReqESVsinv__6) done } moreover { assume d1: "(\<exists> i. i\<le>N\<and>r=n_RecvReq N i)" have "invHoldForRule s f r (invariants N)" apply (cut_tac b2 d1, metis n_RecvReqVsinv__6) done } moreover { assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendInvE i)" have "invHoldForRule s f r (invariants N)" apply (cut_tac b2 d1, metis n_SendInvEVsinv__6) done } moreover { assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendInvS i)" have "invHoldForRule s f r (invariants N)" apply (cut_tac b2 d1, metis n_SendInvSVsinv__6) done } moreover { assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendInvAck i)" have "invHoldForRule s f r (invariants N)" apply (cut_tac b2 d1, metis n_SendInvAckVsinv__6) done } moreover { assume d1: "(\<exists> i. i\<le>N\<and>r=n_RecvInvAck i)" have "invHoldForRule s f r (invariants N)" apply (cut_tac b2 d1, metis n_RecvInvAckVsinv__6) done } moreover { assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendGntS i)" have "invHoldForRule s f r (invariants N)" apply (cut_tac b2 d1, metis n_SendGntSVsinv__6) done } moreover { assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendGntE N i)" have "invHoldForRule s f r (invariants N)" apply (cut_tac b2 d1, metis n_SendGntEVsinv__6) done } moreover { assume d1: "(\<exists> i. i\<le>N\<and>r=n_RecvGntS i)" have "invHoldForRule s f r (invariants N)" apply (cut_tac b2 d1, metis n_RecvGntSVsinv__6) done } moreover { assume d1: "(\<exists> i. i\<le>N\<and>r=n_RecvGntE i)" have "invHoldForRule s f r (invariants N)" apply (cut_tac b2 d1, metis n_RecvGntEVsinv__6) done } moreover { assume d1: "(\<exists> i d. i\<le>N\<and>d\<le>N\<and>r=n_Store i d)" have "invHoldForRule s f r (invariants N)" apply (cut_tac b2 d1, metis n_StoreVsinv__6) done } ultimately show "invHoldForRule s f r (invariants N)" by satx qed end
/- Copyright (c) 2018 Chris Hughes. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Hughes, Johannes Hölzl, Jens Wagemaker Theory of univariate polynomials, represented as `ℕ →₀ α`, where α is a commutative semiring. -/ import data.finsupp algebra.euclidean_domain /-- `polynomial α` is the type of univariate polynomials over `α`. Polynomials should be seen as (semi-)rings with the additional the constructor `X`. `C` is the embedding from `α`. -/ def polynomial (α : Type*) [comm_semiring α] := ℕ →₀ α open finsupp finset lattice namespace polynomial universe u variables {α : Type u} {a b : α} {m n : ℕ} variables [decidable_eq α] section comm_semiring variables [comm_semiring α] {p q : polynomial α} instance : has_coe_to_fun (polynomial α) := finsupp.has_coe_to_fun instance : has_zero (polynomial α) := finsupp.has_zero instance : has_one (polynomial α) := finsupp.has_one instance : has_add (polynomial α) := finsupp.has_add instance : has_mul (polynomial α) := finsupp.has_mul instance : comm_semiring (polynomial α) := finsupp.to_comm_semiring instance : decidable_eq (polynomial α) := finsupp.decidable_eq instance [has_repr α] : has_repr (polynomial α) := ⟨λ p, if p = 0 then "0" else (p.support.sort (≤)).foldr (λ n a, a ++ (if a = "" then "" else " + ") ++ if n = 0 then "C (" ++ repr (p n) ++ ")" else if n = 1 then if (p n) = 1 then "X" else "C (" ++ repr (p n) ++ ") * X" else if (p n) = 1 then "X ^ " ++ repr n else "C (" ++ repr (p n) ++ ") * X ^ " ++ repr n) ""⟩ local attribute [instance] finsupp.to_comm_semiring @[simp] lemma support_zero : (0 : polynomial α).support = ∅ := rfl /-- `C a` is the constant polynomial `a`. -/ def C (a : α) : polynomial α := single 0 a /-- `X` is the polynomial variable (aka indeterminant). -/ def X : polynomial α := single 1 1 /-- `degree p` is the degree of the polynomial `p`, i.e. the largest `X`-exponent in `p`. `degree p = some n` when `p ≠ 0` and `n` is the highest power of `X` that appears in `p`, otherwise `degree 0 = ⊥`. -/ def degree (p : polynomial α) : with_bot ℕ := p.support.sup some def degree_lt_wf : well_founded (λp q : polynomial α, degree p < degree q) := inv_image.wf degree (with_bot.well_founded_lt nat.lt_wf) /-- `nat_degree p` forces `degree p` to ℕ, by fixing the zero polnomial to the 0 degree. -/ def nat_degree (p : polynomial α) : ℕ := (degree p).get_or_else 0 lemma single_eq_C_mul_X : ∀{n}, single n a = C a * X^n | 0 := by simp; refl | (n+1) := calc single (n + 1) a = single n a * X : by rw [X, single_mul_single, mul_one] ... = (C a * X^n) * X : by rw [single_eq_C_mul_X] ... = C a * X^(n+1) : by simp [pow_add, mul_assoc] lemma sum_C_mul_X_eq (p : polynomial α) : p.sum (λn a, C a * X^n) = p := eq.trans (sum_congr rfl $ assume n hn, single_eq_C_mul_X.symm) finsupp.sum_single @[elab_as_eliminator] protected lemma induction_on {M : polynomial α → Prop} (p : polynomial α) (h_C : ∀a, M (C a)) (h_add : ∀p q, M p → M q → M (p + q)) (h_monomial : ∀(n : ℕ) (a : α), M (C a * X^n) → M (C a * X^(n+1))) : M p := have ∀{n:ℕ} {a}, M (C a * X^n), begin assume n a, induction n with n ih, { simp [h_C] }, { exact h_monomial _ _ ih } end, finsupp.induction p (suffices M (C 0), by simpa [C], h_C 0) (assume n a p _ _ hp, suffices M (C a * X^n + p), by rwa [single_eq_C_mul_X], h_add _ _ this hp) @[simp] lemma zero_apply (n : ℕ) : (0 : polynomial α) n = 0 := rfl @[simp] lemma one_apply_zero (n : ℕ) : (1 : polynomial α) 0 = 1 := rfl @[simp] lemma add_apply (p q : polynomial α) (n : ℕ) : (p + q) n = p n + q n := finsupp.add_apply lemma C_apply : (C a : ℕ → α) n = ite (0 = n) a 0 := rfl @[simp] lemma C_apply_zero : (C a : ℕ → α) 0 = a := rfl @[simp] lemma X_apply_one : (X : polynomial α) 1 = 1 := rfl @[simp] lemma C_0 : C (0 : α) = 0 := by simp [C]; refl @[simp] lemma C_1 : C (1 : α) = 1 := rfl @[simp] lemma C_mul : C (a * b) = C a * C b := by simp [C, single_mul_single] @[simp] lemma C_add : C (a + b) = C a + C b := finsupp.single_add instance C.is_semiring_hom : is_semiring_hom (C : α → polynomial α) := ⟨C_0, C_1, λ _ _, C_add, λ _ _, C_mul⟩ @[simp] lemma C_mul_apply (p : polynomial α) : (C a * p) n = a * p n := begin conv in (a * _) { rw [← @sum_single _ _ _ _ _ p, sum_apply] }, rw [mul_def, C, sum_single_index], { simp [single_apply, finsupp.mul_sum], apply sum_congr rfl, assume i hi, by_cases i = n; simp [h] }, simp end lemma C_inj : C a = C b ↔ a = b := ⟨λ h, C_apply_zero.symm.trans (h.symm ▸ C_apply_zero), congr_arg C⟩ @[simp] lemma X_pow_apply (n i : ℕ) : (X ^ n : polynomial α) i = (if n = i then 1 else 0) := suffices (single n 1 : polynomial α) i = (if n = i then 1 else 0), by rw [single_eq_C_mul_X] at this; simpa, single_apply section eval₂ variables {β : Type*} [comm_semiring β] variables (f : α → β) [is_semiring_hom f] (x : β) open is_semiring_hom /-- Evaluate a polynomial `p` given a ring hom `f` from the scalar ring to the target and a value `x` for the variable in the target -/ def eval₂ (p : polynomial α) : β := p.sum (λ e a, f a * x ^ e) @[simp] lemma eval₂_C : (C a).eval₂ f x = f a := by simp [C, eval₂, sum_single_index, map_zero f] @[simp] lemma eval₂_X : X.eval₂ f x = x := by simp [X, eval₂, sum_single_index, map_zero f, map_one f] @[simp] lemma eval₂_zero : (0 : polynomial α).eval₂ f x = 0 := finsupp.sum_zero_index @[simp] lemma eval₂_add : (p + q).eval₂ f x = p.eval₂ f x + q.eval₂ f x := finsupp.sum_add_index (by simp [map_zero f]) (by simp [add_mul, map_add f]) @[simp] lemma eval₂_one : (1 : polynomial α).eval₂ f x = 1 := by rw [← C_1, eval₂_C, map_one f] @[simp] lemma eval₂_mul : (p * q).eval₂ f x = p.eval₂ f x * q.eval₂ f x := begin dunfold eval₂, rw [mul_def, finsupp.sum_mul _ p], simp [finsupp.mul_sum _ q, sum_sum_index, map_zero f, map_add f, add_mul, sum_single_index, map_mul f, pow_add], exact sum_congr rfl (assume i hi, sum_congr rfl $ assume j hj, by ac_refl) end instance eval₂.is_semiring_hom : is_semiring_hom (eval₂ f x) := ⟨eval₂_zero _ _, eval₂_one _ _, λ _ _, eval₂_add _ _, λ _ _, eval₂_mul _ _⟩ lemma eval₂_pow (n : ℕ) : (p ^ n).eval₂ f x = p.eval₂ f x ^ n := map_pow _ _ _ end eval₂ section eval variable {x : α} /-- `eval x p` is the evaluation of the polynomial `p` at `x` -/ def eval : α → polynomial α → α := eval₂ id @[simp] lemma eval_C : (C a).eval x = a := eval₂_C _ _ @[simp] lemma eval_X : X.eval x = x := eval₂_X _ _ @[simp] lemma eval_zero : (0 : polynomial α).eval x = 0 := eval₂_zero _ _ @[simp] lemma eval_add : (p + q).eval x = p.eval x + q.eval x := eval₂_add _ _ @[simp] lemma eval_one : (1 : polynomial α).eval x = 1 := eval₂_one _ _ @[simp] lemma eval_mul : (p * q).eval x = p.eval x * q.eval x := eval₂_mul _ _ instance eval.is_semiring_hom : is_semiring_hom (eval x) := eval₂.is_semiring_hom _ _ lemma eval_pow (n : ℕ) : (p ^ n).eval x = p.eval x ^ n := eval₂_pow _ _ _ /-- `is_root p x` implies `x` is a root of `p`. The evaluation of `p` at `x` is zero -/ def is_root (p : polynomial α) (a : α) : Prop := p.eval a = 0 instance : decidable (is_root p a) := by unfold is_root; apply_instance @[simp] lemma is_root.def : is_root p a ↔ p.eval a = 0 := iff.rfl lemma root_mul_left_of_is_root (p : polynomial α) {q : polynomial α} : is_root q a → is_root (p * q) a := by simp [is_root.def, eval_mul] {contextual := tt} lemma root_mul_right_of_is_root {p : polynomial α} (q : polynomial α) : is_root p a → is_root (p * q) a := by simp [is_root.def, eval_mul] {contextual := tt} end eval section map variables {β : Type*} [comm_semiring β] [decidable_eq β] variables (f : α → β) [is_semiring_hom f] /-- `map f p` maps a polynomial `p` across a ring hom `f` -/ def map : polynomial α → polynomial β := eval₂ (C ∘ f) X @[simp] lemma map_C : (C a).map f = C (f a) := eval₂_C _ _ @[simp] lemma map_X : X.map f = X := eval₂_X _ _ @[simp] lemma map_zero : (0 : polynomial α).map f = 0 := eval₂_zero _ _ @[simp] lemma map_add : (p + q).map f = p.map f + q.map f := eval₂_add _ _ @[simp] lemma map_one : (1 : polynomial α).map f = 1 := eval₂_one _ _ @[simp] lemma map_mul : (p * q).map f = p.map f * q.map f := eval₂_mul _ _ instance map.is_semiring_hom : is_semiring_hom (map f) := eval₂.is_semiring_hom _ _ lemma map_pow (n : ℕ) : (p ^ n).map f = p.map f ^ n := eval₂_pow _ _ _ end map /-- `leading_coeff p` gives the coefficient of the highest power of `X` in `p`-/ def leading_coeff (p : polynomial α) : α := p (nat_degree p) /-- a polynomial is `monic` if its leading coefficient is 1 -/ def monic (p : polynomial α) := leading_coeff p = (1 : α) lemma monic.def : monic p ↔ leading_coeff p = 1 := iff.rfl instance monic.decidable : decidable (monic p) := by unfold monic; apply_instance @[simp] lemma degree_zero : degree (0 : polynomial α) = ⊥ := rfl @[simp] lemma nat_degree_zero : nat_degree (0 : polynomial α) = 0 := by simp [nat_degree]; refl @[simp] lemma degree_C (ha : a ≠ 0) : degree (C a) = (0 : with_bot ℕ) := show sup (ite (a = 0) ∅ {0}) some = 0, by rw [if_neg ha]; refl lemma degree_C_le : degree (C a) ≤ (0 : with_bot ℕ) := by by_cases h : a = 0; simp [h]; exact le_refl _ lemma degree_one_le : degree (1 : polynomial α) ≤ (0 : with_bot ℕ) := by rw [← C_1]; exact degree_C_le lemma degree_eq_bot : degree p = ⊥ ↔ p = 0 := ⟨λ h, by rw [degree, ← max_eq_sup_with_bot] at h; exact support_eq_empty.1 (max_eq_none.1 h), λ h, h.symm ▸ rfl⟩ lemma degree_eq_nat_degree (hp : p ≠ 0) : degree p = (nat_degree p : with_bot ℕ) := let ⟨n, hn⟩ := classical.not_forall.1 (mt option.eq_none_iff_forall_not_mem.2 (mt degree_eq_bot.1 hp)) in have hn : degree p = some n := not_not.1 hn, by rw [nat_degree, hn]; refl @[simp] lemma degree_le_nat_degree : degree p ≤ nat_degree p := begin by_cases hp : p = 0, { simp [hp] }, rw [degree_eq_nat_degree hp], exact le_refl _ end lemma nat_degree_eq_of_degree_eq (h : degree p = degree q) : nat_degree p = nat_degree q := by unfold nat_degree; rw h lemma le_degree_of_ne_zero (h : p n ≠ 0) : (n : with_bot ℕ) ≤ degree p := show @has_le.le (with_bot ℕ) _ (some n : with_bot ℕ) (p.support.sup some : with_bot ℕ), from finset.le_sup ((finsupp.mem_support_iff _ _).2 h) lemma le_nat_degree_of_ne_zero (h : p n ≠ 0) : n ≤ nat_degree p := begin rw [← with_bot.coe_le_coe, ← degree_eq_nat_degree], exact le_degree_of_ne_zero h, { assume h, subst h, exact h rfl } end lemma degree_le_degree (h : q (nat_degree p) ≠ 0) : degree p ≤ degree q := begin by_cases hp : p = 0, { simp [hp] }, { rw [degree_eq_nat_degree hp], exact le_degree_of_ne_zero h } end @[simp] lemma nat_degree_C (a : α) : nat_degree (C a) = 0 := begin by_cases ha : a = 0, { have : C a = 0, { simp [ha] }, rw [nat_degree, degree_eq_bot.2 this], refl }, { rw [nat_degree, degree_C ha], refl } end @[simp] lemma degree_monomial (n : ℕ) (ha : a ≠ 0) : degree (C a * X ^ n) = n := by rw [← single_eq_C_mul_X, degree, support_single_ne_zero ha]; refl lemma degree_monomial_le (n : ℕ) (a : α) : degree (C a * X ^ n) ≤ n := if h : a = 0 then by simp [h] else le_of_eq (degree_monomial n h) lemma eq_zero_of_degree_lt (h : degree p < n) : p n = 0 := not_not.1 (mt le_degree_of_ne_zero (not_le_of_gt h)) lemma apply_nat_degree_eq_zero_of_degree_lt (h : degree p < degree q) : p (nat_degree q) = 0 := eq_zero_of_degree_lt (lt_of_lt_of_le h degree_le_nat_degree) lemma ne_zero_of_degree_gt {n : with_bot ℕ} (h : n < degree p) : p ≠ 0 := mt degree_eq_bot.2 (ne.symm (ne_of_lt (lt_of_le_of_lt bot_le h))) lemma eq_C_of_degree_le_zero (h : degree p ≤ 0) : p = C (p 0) := begin ext n, cases n, { refl }, { have : degree p < ↑(nat.succ n) := lt_of_le_of_lt h (with_bot.some_lt_some.2 (nat.succ_pos _)), rw [C_apply, if_neg (nat.succ_ne_zero _).symm, eq_zero_of_degree_lt this] } end lemma degree_add_le (p q : polynomial α) : degree (p + q) ≤ max (degree p) (degree q) := calc degree (p + q) = ((p + q).support).sup some : rfl ... ≤ (p.support ∪ q.support).sup some : sup_mono support_add ... = p.support.sup some ⊔ q.support.sup some : sup_union ... = _ : with_bot.sup_eq_max _ _ @[simp] lemma leading_coeff_zero : leading_coeff (0 : polynomial α) = 0 := rfl @[simp] lemma leading_coeff_eq_zero : leading_coeff p = 0 ↔ p = 0 := ⟨λ h, by_contradiction $ λ hp, mt (mem_support_iff _ _).1 (not_not.2 h) (mem_of_max (degree_eq_nat_degree hp)), by simp {contextual := tt}⟩ lemma degree_add_eq_of_degree_lt (h : degree p < degree q) : degree (p + q) = degree q := le_antisymm (max_eq_right_of_lt h ▸ degree_add_le _ _) $ degree_le_degree $ begin rw [add_apply, apply_nat_degree_eq_zero_of_degree_lt h, zero_add], exact mt leading_coeff_eq_zero.1 (ne_zero_of_degree_gt h) end lemma degree_add_eq_of_leading_coeff_add_ne_zero (h : leading_coeff p + leading_coeff q ≠ 0) : degree (p + q) = max p.degree q.degree := le_antisymm (degree_add_le _ _) $ match lt_trichotomy (degree p) (degree q) with | or.inl hlt := by rw [degree_add_eq_of_degree_lt hlt, max_eq_right_of_lt hlt]; exact le_refl _ | or.inr (or.inl heq) := le_of_not_gt $ assume hlt : max (degree p) (degree q) > degree (p + q), h $ show leading_coeff p + leading_coeff q = 0, begin rw [heq, max_self] at hlt, rw [leading_coeff, leading_coeff, nat_degree_eq_of_degree_eq heq, ← add_apply], exact apply_nat_degree_eq_zero_of_degree_lt hlt end | or.inr (or.inr hlt) := by rw [add_comm, degree_add_eq_of_degree_lt hlt, max_eq_left_of_lt hlt]; exact le_refl _ end lemma degree_erase_le (p : polynomial α) (n : ℕ) : degree (p.erase n) ≤ degree p := sup_mono (erase_subset _ _) lemma degree_erase_lt (hp : p ≠ 0) : degree (p.erase (nat_degree p)) < degree p := lt_of_le_of_ne (degree_erase_le _ _) $ (degree_eq_nat_degree hp).symm ▸ λ h, not_mem_erase _ _ (mem_of_max h) lemma degree_sum_le {β : Type*} [decidable_eq β] (s : finset β) (f : β → polynomial α) : degree (s.sum f) ≤ s.sup (degree ∘ f) := finset.induction_on s (by simp [finsupp.support_zero]) $ assume a s has ih, calc degree (sum (insert a s) f) ≤ max (degree (f a)) (degree (s.sum f)) : by rw sum_insert has; exact degree_add_le _ _ ... ≤ _ : by rw [sup_insert, with_bot.sup_eq_max]; exact max_le_max (le_refl _) ih lemma degree_mul_le (p q : polynomial α) : degree (p * q) ≤ degree p + degree q := calc degree (p * q) ≤ (p.support).sup (λi, degree (sum q (λj a, C (p i * a) * X ^ (i + j)))) : by simp only [single_eq_C_mul_X.symm]; exact degree_sum_le _ _ ... ≤ p.support.sup (λi, q.support.sup (λj, degree (C (p i * q j) * X ^ (i + j)))) : finset.sup_mono_fun (assume i hi, degree_sum_le _ _) ... ≤ degree p + degree q : begin refine finset.sup_le (λ a ha, finset.sup_le (λ b hb, le_trans (degree_monomial_le _ _) _)), rw [with_bot.coe_add], rw mem_support_iff at ha hb, exact add_le_add' (le_degree_of_ne_zero ha) (le_degree_of_ne_zero hb) end lemma degree_pow_le (p : polynomial α) : ∀ n, degree (p ^ n) ≤ add_monoid.smul n (degree p) | 0 := by rw [pow_zero, add_monoid.zero_smul]; exact degree_one_le | (n+1) := calc degree (p ^ (n + 1)) ≤ degree p + degree (p ^ n) : by rw pow_succ; exact degree_mul_le _ _ ... ≤ _ : by rw succ_smul; exact add_le_add' (le_refl _) (degree_pow_le _) @[simp] lemma leading_coeff_monomial (a : α) (n : ℕ) : leading_coeff (C a * X ^ n) = a := begin by_cases ha : a = 0, { simp [ha] }, { rw [leading_coeff, nat_degree, degree_monomial _ ha, ← single_eq_C_mul_X], exact finsupp.single_eq_same } end @[simp] lemma leading_coeff_C (a : α) : leading_coeff (C a) = a := suffices leading_coeff (C a * X^0) = a, by simpa, leading_coeff_monomial a 0 @[simp] lemma leading_coeff_X : leading_coeff (X : polynomial α) = 1 := suffices leading_coeff (C (1:α) * X^1) = 1, by simpa, leading_coeff_monomial 1 1 @[simp] lemma leading_coeff_one : leading_coeff (1 : polynomial α) = 1 := suffices leading_coeff (C (1:α) * X^0) = 1, by simpa, leading_coeff_monomial 1 0 @[simp] lemma monic_one : monic (1 : polynomial α) := leading_coeff_C _ lemma leading_coeff_add_of_degree_lt (h : degree p < degree q) : leading_coeff (p + q) = leading_coeff q := have p (nat_degree q) = 0, from apply_nat_degree_eq_zero_of_degree_lt h, by simp [leading_coeff, nat_degree_eq_of_degree_eq (degree_add_eq_of_degree_lt h), this] lemma leading_coeff_add_of_degree_eq (h : degree p = degree q) (hlc : leading_coeff p + leading_coeff q ≠ 0) : leading_coeff (p + q) = leading_coeff p + leading_coeff q := have nat_degree (p + q) = nat_degree p, by apply nat_degree_eq_of_degree_eq; rw [degree_add_eq_of_leading_coeff_add_ne_zero hlc, h, max_self], by simp [leading_coeff, this, nat_degree_eq_of_degree_eq h] @[simp] lemma mul_apply_degree_add_degree (p q : polynomial α) : (p * q) (nat_degree p + nat_degree q) = leading_coeff p * leading_coeff q := have ∀i, p i ≠ 0 → i ≠ nat_degree p → q.support.sum (λj, ite (i + j = nat_degree p + nat_degree q) (p i * q j) 0) = 0, begin assume i hpi hid, rw [finset.sum_eq_single (nat_degree q)]; simp [hid], assume j hqj hjd, have hi : j < nat_degree q, from lt_of_le_of_ne (le_nat_degree_of_ne_zero hqj) hjd, have hj : i < nat_degree p, from lt_of_le_of_ne (le_nat_degree_of_ne_zero hpi) hid, exact if_neg (ne_of_lt $ add_lt_add hj hi) end, begin rw [mul_def, sum_apply, finsupp.sum, finset.sum_eq_single (nat_degree p), sum_apply, finsupp.sum, finset.sum_eq_single (nat_degree q)]; simp [single_apply, leading_coeff] {contextual := tt}, assumption end lemma degree_mul_eq' (h : leading_coeff p * leading_coeff q ≠ 0) : degree (p * q) = degree p + degree q := have hp : p ≠ 0 := by refine mt _ h; simp {contextual := tt}, have hq : q ≠ 0 := by refine mt _ h; by simp {contextual := tt}, le_antisymm (degree_mul_le _ _) begin rw [degree_eq_nat_degree hp, degree_eq_nat_degree hq], refine le_degree_of_ne_zero _, rwa mul_apply_degree_add_degree end lemma nat_degree_mul_eq' (h : leading_coeff p * leading_coeff q ≠ 0) : nat_degree (p * q) = nat_degree p + nat_degree q := have hp : p ≠ 0 := mt leading_coeff_eq_zero.2 (λ h₁, by simpa [h₁] using h), have hq : q ≠ 0 := mt leading_coeff_eq_zero.2 (λ h₁, by simpa [h₁] using h), have hpq : p * q ≠ 0 := λ hpq, by rw [← mul_apply_degree_add_degree, hpq, zero_apply] at h; exact h rfl, option.some_inj.1 (show (nat_degree (p * q) : with_bot ℕ) = nat_degree p + nat_degree q, by rw [← degree_eq_nat_degree hpq, degree_mul_eq' h, degree_eq_nat_degree hp, degree_eq_nat_degree hq]) lemma leading_coeff_mul' (h : leading_coeff p * leading_coeff q ≠ 0) : leading_coeff (p * q) = leading_coeff p * leading_coeff q := begin unfold leading_coeff, rw [nat_degree_mul_eq' h, mul_apply_degree_add_degree], refl end lemma leading_coeff_pow' : leading_coeff p ^ n ≠ 0 → leading_coeff (p ^ n) = leading_coeff p ^ n := nat.rec_on n (by simp) $ λ n ih h, have h₁ : leading_coeff p ^ n ≠ 0 := λ h₁, by simpa [h₁, pow_succ] using h, have h₂ : leading_coeff p * leading_coeff (p ^ n) ≠ 0 := by rwa [pow_succ, ← ih h₁] at h, by rw [pow_succ, pow_succ, leading_coeff_mul' h₂, ih h₁] lemma degree_pow_eq' : ∀ {n}, leading_coeff p ^ n ≠ 0 → degree (p ^ n) = add_monoid.smul n (degree p) | 0 := λ h, by rw [pow_zero, ← C_1] at *; rw [degree_C h, add_monoid.zero_smul] | (n+1) := λ h, have h₁ : leading_coeff p ^ n ≠ 0 := λ h₁, by simpa [h₁, pow_succ] using h, have h₂ : leading_coeff p * leading_coeff (p ^ n) ≠ 0 := by rwa [pow_succ, ← leading_coeff_pow' h₁] at h, by rw [pow_succ, degree_mul_eq' h₂, succ_smul, degree_pow_eq' h₁] @[simp] lemma leading_coeff_X_pow : ∀ n : ℕ, leading_coeff ((X : polynomial α) ^ n) = 1 | 0 := by simp | (n+1) := if h10 : (1 : α) = 0 then by rw [pow_succ, ← one_mul X, ← C_1, h10]; simp else have h : leading_coeff (X : polynomial α) * leading_coeff (X ^ n) ≠ 0, by rw [leading_coeff_X, leading_coeff_X_pow n, one_mul]; exact h10, by rw [pow_succ, leading_coeff_mul' h, leading_coeff_X, leading_coeff_X_pow, one_mul] end comm_semiring section comm_ring variables [comm_ring α] {p q : polynomial α} instance : comm_ring (polynomial α) := finsupp.to_comm_ring instance : has_scalar α (polynomial α) := finsupp.to_has_scalar instance : module α (polynomial α) := finsupp.to_module α instance C.is_ring_hom : is_ring_hom (@C α _ _) := by apply is_ring_hom.of_semiring instance eval₂.is_ring_hom {β} [comm_ring β] (f : α → β) [is_ring_hom f] {x : β} : is_ring_hom (eval₂ f x) := by apply is_ring_hom.of_semiring instance eval.is_ring_hom {x : α} : is_ring_hom (eval x) := eval₂.is_ring_hom _ instance map.is_ring_hom {β} [comm_ring β] [decidable_eq β] (f : α → β) [is_ring_hom f] : is_ring_hom (map f) := eval₂.is_ring_hom (C ∘ f) @[simp] lemma degree_neg (p : polynomial α) : degree (-p) = degree p := by unfold degree; rw support_neg @[simp] lemma neg_apply (p : polynomial α) (n : ℕ) : (-p) n = -p n := neg_apply @[simp] lemma eval_neg (p : polynomial α) (x : α) : (-p).eval x = -p.eval x := is_ring_hom.map_neg _ @[simp] lemma eval_sub (p q : polynomial α) (x : α) : (p - q).eval x = p.eval x - q.eval x := is_ring_hom.map_sub _ lemma degree_sub_lt (hd : degree p = degree q) (hp0 : p ≠ 0) (hlc : leading_coeff p = leading_coeff q) : degree (p - q) < degree p := have hp : single (nat_degree p) (leading_coeff p) + p.erase (nat_degree p) = p := finsupp.single_add_erase, have hq : single (nat_degree q) (leading_coeff q) + q.erase (nat_degree q) = q := finsupp.single_add_erase, have hd' : nat_degree p = nat_degree q := by unfold nat_degree; rw hd, have hq0 : q ≠ 0 := mt degree_eq_bot.2 (hd ▸ mt degree_eq_bot.1 hp0), calc degree (p - q) = degree (erase (nat_degree q) p + -erase (nat_degree q) q) : by conv {to_lhs, rw [← hp, ← hq, hlc, hd', add_sub_add_left_eq_sub, sub_eq_add_neg]} ... ≤ max (degree (erase (nat_degree q) p)) (degree (erase (nat_degree q) q)) : degree_neg (erase (nat_degree q) q) ▸ degree_add_le _ _ ... < degree p : max_lt_iff.2 ⟨hd' ▸ degree_erase_lt hp0, hd.symm ▸ degree_erase_lt hq0⟩ instance : has_well_founded (polynomial α) := ⟨_, degree_lt_wf⟩ lemma ne_zero_of_ne_zero_of_monic (hp : p ≠ 0) (hq : monic q) : q ≠ 0 | h := begin rw [h, monic.def, leading_coeff_zero] at hq, rw [← mul_one p, ← C_1, ← hq, C_0, mul_zero] at hp, exact hp rfl end lemma div_wf_lemma (h : degree q ≤ degree p ∧ p ≠ 0) (hq : monic q) : degree (p - C (leading_coeff p) * X ^ (nat_degree p - nat_degree q) * q) < degree p := have hp : leading_coeff p ≠ 0 := mt leading_coeff_eq_zero.1 h.2, have hpq : leading_coeff (C (leading_coeff p) * X ^ (nat_degree p - nat_degree q)) * leading_coeff q ≠ 0, by rwa [leading_coeff_monomial, monic.def.1 hq, mul_one], if h0 : p - C (leading_coeff p) * X ^ (nat_degree p - nat_degree q) * q = 0 then h0.symm ▸ (lt_of_not_ge $ mt le_bot_iff.1 (mt degree_eq_bot.1 h.2)) else have hq0 : q ≠ 0 := ne_zero_of_ne_zero_of_monic h.2 hq, have hlt : nat_degree q ≤ nat_degree p := with_bot.coe_le_coe.1 (by rw [← degree_eq_nat_degree h.2, ← degree_eq_nat_degree hq0]; exact h.1), degree_sub_lt (by rw [degree_mul_eq' hpq, degree_monomial _ hp, degree_eq_nat_degree h.2, degree_eq_nat_degree hq0, ← with_bot.coe_add, nat.sub_add_cancel hlt]) h.2 (by rw [leading_coeff_mul' hpq, leading_coeff_monomial, monic.def.1 hq, mul_one]) def div_mod_by_monic_aux : Π (p : polynomial α) {q : polynomial α}, monic q → polynomial α × polynomial α | p := λ q hq, if h : degree q ≤ degree p ∧ p ≠ 0 then let z := C (leading_coeff p) * X^(nat_degree p - nat_degree q) in have wf : _ := div_wf_lemma h hq, let dm := div_mod_by_monic_aux (p - z * q) hq in ⟨z + dm.1, dm.2⟩ else ⟨0, p⟩ using_well_founded {dec_tac := tactic.assumption} /-- `div_by_monic` gives the quotient of `p` by a monic polynomial `q`. -/ def div_by_monic (p q : polynomial α) : polynomial α := if hq : monic q then (div_mod_by_monic_aux p hq).1 else 0 /-- `mod_by_monic` gives the remainder of `p` by a monic polynomial `q`. -/ def mod_by_monic (p q : polynomial α) : polynomial α := if hq : monic q then (div_mod_by_monic_aux p hq).2 else p infixl ` /ₘ ` : 70 := div_by_monic infixl ` %ₘ ` : 70 := mod_by_monic lemma degree_mod_by_monic_lt : ∀ (p : polynomial α) {q : polynomial α} (hq : monic q) (hq0 : q ≠ 0), degree (p %ₘ q) < degree q | p := λ q hq hq0, if h : degree q ≤ degree p ∧ p ≠ 0 then have wf : _ := div_wf_lemma ⟨h.1, h.2⟩ hq, have degree ((p - C (leading_coeff p) * X ^ (nat_degree p - nat_degree q) * q) %ₘ q) < degree q := degree_mod_by_monic_lt (p - C (leading_coeff p) * X ^ (nat_degree p - nat_degree q) * q) hq hq0, begin unfold mod_by_monic at this ⊢, unfold div_mod_by_monic_aux, rw dif_pos hq at this ⊢, rw if_pos h, exact this end else or.cases_on (not_and_distrib.1 h) begin unfold mod_by_monic div_mod_by_monic_aux, rw [dif_pos hq, if_neg h], exact lt_of_not_ge, end begin assume hp, unfold mod_by_monic div_mod_by_monic_aux, rw [dif_pos hq, if_neg h, not_not.1 hp], exact lt_of_le_of_ne bot_le (ne.symm (mt degree_eq_bot.1 hq0)), end using_well_founded {dec_tac := tactic.assumption} lemma mod_by_monic_eq_sub_mul_div : ∀ (p : polynomial α) {q : polynomial α} (hq : monic q), p %ₘ q = p - q * (p /ₘ q) | p := λ q hq, if h : degree q ≤ degree p ∧ p ≠ 0 then have wf : _ := div_wf_lemma h hq, have ih : _ := mod_by_monic_eq_sub_mul_div (p - C (leading_coeff p) * X ^ (nat_degree p - nat_degree q) * q) hq, begin unfold mod_by_monic div_by_monic div_mod_by_monic_aux, rw [dif_pos hq, if_pos h], rw [mod_by_monic, dif_pos hq] at ih, refine ih.trans _, simp [mul_add, add_mul, mul_comm, hq, h, div_by_monic] end else begin unfold mod_by_monic div_by_monic div_mod_by_monic_aux, rw [dif_pos hq, if_neg h, dif_pos hq, if_neg h], simp end using_well_founded {dec_tac := tactic.assumption} lemma subsingleton_of_monic_zero (h : monic (0 : polynomial α)) : (∀ p q : polynomial α, p = q) ∧ (∀ a b : α, a = b) := by rw [monic.def, leading_coeff_zero] at h; exact ⟨λ p q, by rw [← mul_one p, ← mul_one q, ← C_1, ← h, C_0, mul_zero, mul_zero], λ a b, by rw [← mul_one a, ← mul_one b, ← h, mul_zero, mul_zero]⟩ lemma mod_by_monic_add_div (p : polynomial α) {q : polynomial α} (hq : monic q) : p %ₘ q + q * (p /ₘ q) = p := eq_sub_iff_add_eq.1 (mod_by_monic_eq_sub_mul_div p hq) @[simp] lemma zero_mod_by_monic (p : polynomial α) : 0 %ₘ p = 0 := begin unfold mod_by_monic div_mod_by_monic_aux, split_ifs; simp * at * end @[simp] lemma zero_div_by_monic (p : polynomial α) : 0 /ₘ p = 0 := begin unfold div_by_monic div_mod_by_monic_aux, split_ifs; simp * at * end @[simp] lemma mod_by_monic_zero (p : polynomial α) : p %ₘ 0 = p := if h : monic (0 : polynomial α) then (subsingleton_of_monic_zero h).1 _ _ else begin unfold mod_by_monic div_mod_by_monic_aux, split_ifs; simp * at * end @[simp] lemma div_by_monic_zero (p : polynomial α) : p /ₘ 0 = 0 := if h : monic (0 : polynomial α) then (subsingleton_of_monic_zero h).1 _ _ else begin unfold div_by_monic div_mod_by_monic_aux, split_ifs; simp * at * end lemma div_by_monic_eq_of_not_monic (p : polynomial α) (hq : ¬monic q) : p /ₘ q = 0 := dif_neg hq lemma mod_by_monic_eq_of_not_monic (p : polynomial α) (hq : ¬monic q) : p %ₘ q = p := dif_neg hq lemma mod_by_monic_eq_self_iff (hq : monic q) (hq0 : q ≠ 0) : p %ₘ q = p ↔ degree p < degree q := ⟨λ h, h ▸ degree_mod_by_monic_lt _ hq hq0, λ h, have ¬ degree q ≤ degree p := not_le_of_gt h, by unfold mod_by_monic div_mod_by_monic_aux; simp *⟩ lemma div_by_monic_eq_zero_iff (hq : monic q) (hq0 : q ≠ 0) : p /ₘ q = 0 ↔ degree p < degree q := ⟨λ h, by have := mod_by_monic_add_div p hq; rwa [h, mul_zero, add_zero, mod_by_monic_eq_self_iff hq hq0] at this, λ h, have ¬ degree q ≤ degree p := not_le_of_gt h, by unfold div_by_monic div_mod_by_monic_aux; simp *⟩ lemma degree_add_div_by_monic (hq : monic q) (h : degree q ≤ degree p) : degree q + degree (p /ₘ q) = degree p := if hq0 : q = 0 then have ∀ (p : polynomial α), p = 0, from λ p, (@subsingleton_of_monic_zero α _ _ (hq0 ▸ hq)).1 _ _, by rw [this (p /ₘ q), this p, this q]; refl else have hdiv0 : p /ₘ q ≠ 0 := by rwa [(≠), div_by_monic_eq_zero_iff hq hq0, not_lt], have hlc : leading_coeff q * leading_coeff (p /ₘ q) ≠ 0 := by rwa [monic.def.1 hq, one_mul, (≠), leading_coeff_eq_zero], have hmod : degree (p %ₘ q) < degree (q * (p /ₘ q)) := calc degree (p %ₘ q) < degree q : degree_mod_by_monic_lt _ hq hq0 ... ≤ _ : by rw [degree_mul_eq' hlc, degree_eq_nat_degree hq0, degree_eq_nat_degree hdiv0, ← with_bot.coe_add, with_bot.coe_le_coe]; exact nat.le_add_right _ _, calc degree q + degree (p /ₘ q) = degree (q * (p /ₘ q)) : eq.symm (degree_mul_eq' hlc) ... = degree (p %ₘ q + q * (p /ₘ q)) : (degree_add_eq_of_degree_lt hmod).symm ... = _ : congr_arg _ (mod_by_monic_add_div _ hq) lemma degree_div_by_monic_le (p q : polynomial α) : degree (p /ₘ q) ≤ degree p := if hp0 : p = 0 then by simp [hp0] else if hq : monic q then have hq0 : q ≠ 0 := ne_zero_of_ne_zero_of_monic hp0 hq, if h : degree q ≤ degree p then by rw [← degree_add_div_by_monic hq h, degree_eq_nat_degree hq0, degree_eq_nat_degree (mt (div_by_monic_eq_zero_iff hq hq0).1 (not_lt.2 h))]; exact with_bot.coe_le_coe.2 (nat.le_add_left _ _) else by unfold div_by_monic div_mod_by_monic_aux; simp [dif_pos hq, h] else (div_by_monic_eq_of_not_monic p hq).symm ▸ bot_le lemma degree_div_by_monic_lt (p : polynomial α) {q : polynomial α} (hq : monic q) (hp0 : p ≠ 0) (h0q : 0 < degree q) : degree (p /ₘ q) < degree p := have hq0 : q ≠ 0 := ne_zero_of_ne_zero_of_monic hp0 hq, if hpq : degree p < degree q then begin rw [(div_by_monic_eq_zero_iff hq hq0).2 hpq, degree_eq_nat_degree hp0], exact with_bot.bot_lt_some _ end else begin rw [← degree_add_div_by_monic hq (not_lt.1 hpq), degree_eq_nat_degree hq0, degree_eq_nat_degree (mt (div_by_monic_eq_zero_iff hq hq0).1 hpq)], exact with_bot.coe_lt_coe.2 (nat.lt_add_of_pos_left (with_bot.coe_lt_coe.1 $ (degree_eq_nat_degree hq0) ▸ h0q)) end lemma dvd_iff_mod_by_monic_eq_zero (hq : monic q) : p %ₘ q = 0 ↔ q ∣ p := ⟨λ h, by rw [← mod_by_monic_add_div p hq, h, zero_add]; exact dvd_mul_right _ _, λ h, if hq0 : q = 0 then by rw hq0 at hq; exact (subsingleton_of_monic_zero hq).1 _ _ else let ⟨r, hr⟩ := exists_eq_mul_right_of_dvd h in by_contradiction (λ hpq0, have hmod : p %ₘ q = q * (r - p /ₘ q) := by rw [mod_by_monic_eq_sub_mul_div _ hq, mul_sub, ← hr], have degree (q * (r - p /ₘ q)) < degree q := hmod ▸ degree_mod_by_monic_lt _ hq hq0, have hrpq0 : leading_coeff (r - p /ₘ q) ≠ 0 := λ h, hpq0 $ leading_coeff_eq_zero.1 (by rw [hmod, leading_coeff_eq_zero.1 h, mul_zero, leading_coeff_zero]), have hlc : leading_coeff q * leading_coeff (r - p /ₘ q) ≠ 0 := by rwa [monic.def.1 hq, one_mul], by rw [degree_mul_eq' hlc, degree_eq_nat_degree hq0, degree_eq_nat_degree (mt leading_coeff_eq_zero.2 hrpq0)] at this; exact not_lt_of_ge (nat.le_add_right _ _) (with_bot.some_lt_some.1 this))⟩ end comm_ring section nonzero_comm_ring variables [nonzero_comm_ring α] {p q : polynomial α} instance : nonzero_comm_ring (polynomial α) := { zero_ne_one := λ (h : (0 : polynomial α) = 1), @zero_ne_one α _ $ calc (0 : α) = eval 0 0 : eval_zero.symm ... = eval 0 1 : congr_arg _ h ... = 1 : eval_C, ..polynomial.comm_ring } @[simp] lemma degree_one : degree (1 : polynomial α) = (0 : with_bot ℕ) := degree_C (show (1 : α) ≠ 0, from zero_ne_one.symm) @[simp] lemma degree_X : degree (X : polynomial α) = 1 := begin unfold X degree single finsupp.support, rw if_neg (zero_ne_one).symm, refl end @[simp] lemma degree_X_sub_C (a : α) : degree (X - C a) = 1 := begin rw [sub_eq_add_neg, add_comm, ← @degree_X α], by_cases ha : a = 0, { simp [ha] }, exact degree_add_eq_of_degree_lt (by rw [degree_X, degree_neg, degree_C ha]; exact dec_trivial) end @[simp] lemma degree_X_pow : ∀ (n : ℕ), degree ((X : polynomial α) ^ n) = n | 0 := by simp; refl | (n+1) := have h : leading_coeff (X : polynomial α) * leading_coeff (X ^ n) ≠ 0, by rw [leading_coeff_X, leading_coeff_X_pow n, one_mul]; exact zero_ne_one.symm, by rw [pow_succ, degree_mul_eq' h, degree_X, degree_X_pow, add_comm]; refl lemma degree_X_pow_sub_C {n : ℕ} (hn : 0 < n) (a : α) : degree ((X : polynomial α) ^ n - C a) = n := have degree (-C a) < degree ((X : polynomial α) ^ n), from calc degree (-C a) ≤ 0 : by rw degree_neg; exact degree_C_le ... < degree ((X : polynomial α) ^ n) : by rwa [degree_X_pow]; exact with_bot.coe_lt_coe.2 hn, by rw [sub_eq_add_neg, add_comm, degree_add_eq_of_degree_lt this, degree_X_pow] lemma X_pow_sub_C_ne_zero {n : ℕ} (hn : 0 < n) (a : α) : (X : polynomial α) ^ n - C a ≠ 0 := mt degree_eq_bot.2 (show degree ((X : polynomial α) ^ n - C a) ≠ ⊥, by rw degree_X_pow_sub_C hn; exact dec_trivial) @[simp] lemma not_monic_zero : ¬monic (0 : polynomial α) := by simp [monic, zero_ne_one] lemma ne_zero_of_monic (h : monic p) : p ≠ 0 := λ h₁, @not_monic_zero α _ _ (h₁ ▸ h) lemma monic_X_sub_C (a : α) : monic (X - C a) := have degree (-C a) < degree (X : polynomial α) := if ha : a = 0 then by simp [ha]; exact dec_trivial else by simp [degree_C ha]; exact dec_trivial, by unfold monic; rw [sub_eq_add_neg, add_comm, leading_coeff_add_of_degree_lt this, leading_coeff_X] lemma root_X_sub_C : is_root (X - C a) b ↔ a = b := by rw [is_root.def, eval_sub, eval_X, eval_C, sub_eq_zero_iff_eq, eq_comm] @[simp] lemma mod_by_monic_X_sub_C_eq_C_eval (p : polynomial α) (a : α) : p %ₘ (X - C a) = C (p.eval a) := have h : (p %ₘ (X - C a)).eval a = p.eval a := by rw [mod_by_monic_eq_sub_mul_div _ (monic_X_sub_C a), eval_sub, eval_mul, eval_sub, eval_X, eval_C, sub_self, zero_mul, sub_zero], have degree (p %ₘ (X - C a)) < 1 := degree_X_sub_C a ▸ degree_mod_by_monic_lt p (monic_X_sub_C a) ((degree_X_sub_C a).symm ▸ ne_zero_of_monic (monic_X_sub_C _)), have degree (p %ₘ (X - C a)) ≤ 0 := begin cases (degree (p %ₘ (X - C a))), { exact bot_le }, { exact with_bot.some_le_some.2 (nat.le_of_lt_succ (with_bot.some_lt_some.1 this)) } end, begin rw [eq_C_of_degree_le_zero this, eval_C] at h, rw [eq_C_of_degree_le_zero this, h] end lemma mul_div_by_monic_eq_iff_is_root : (X - C a) * (p /ₘ (X - C a)) = p ↔ is_root p a := ⟨λ h, by rw [← h, is_root.def, eval_mul, eval_sub, eval_X, eval_C, sub_self, zero_mul], λ h : p.eval a = 0, by conv {to_rhs, rw ← mod_by_monic_add_div p (monic_X_sub_C a)}; rw [mod_by_monic_X_sub_C_eq_C_eval, h, C_0, zero_add]⟩ lemma dvd_iff_is_root : (X - C a) ∣ p ↔ is_root p a := ⟨λ h, by rwa [← dvd_iff_mod_by_monic_eq_zero (monic_X_sub_C _), mod_by_monic_X_sub_C_eq_C_eval, ← C_0, C_inj] at h, λ h, ⟨(p /ₘ (X - C a)), by rw mul_div_by_monic_eq_iff_is_root.2 h⟩⟩ end nonzero_comm_ring section integral_domain variables [integral_domain α] {p q : polynomial α} @[simp] lemma degree_mul_eq : degree (p * q) = degree p + degree q := if hp0 : p = 0 then by simp [hp0] else if hq0 : q = 0 then by simp [hq0] else degree_mul_eq' $ mul_ne_zero (mt leading_coeff_eq_zero.1 hp0) (mt leading_coeff_eq_zero.1 hq0) @[simp] lemma degree_pow_eq (p : polynomial α) (n : ℕ) : degree (p ^ n) = add_monoid.smul n (degree p) := by induction n; simp [*, pow_succ, succ_smul] @[simp] lemma leading_coeff_mul (p q : polynomial α) : leading_coeff (p * q) = leading_coeff p * leading_coeff q := begin by_cases hp : p = 0, { simp [hp] }, { by_cases hq : q = 0, { simp [hq] }, { rw [leading_coeff_mul'], exact mul_ne_zero (mt leading_coeff_eq_zero.1 hp) (mt leading_coeff_eq_zero.1 hq) } } end @[simp] lemma leading_coeff_pow (p : polynomial α) (n : ℕ) : leading_coeff (p ^ n) = leading_coeff p ^ n := by induction n; simp [*, pow_succ] instance : integral_domain (polynomial α) := { eq_zero_or_eq_zero_of_mul_eq_zero := λ a b h, begin have : leading_coeff 0 = leading_coeff a * leading_coeff b := h ▸ leading_coeff_mul a b, rw [leading_coeff_zero, eq_comm] at this, rw [← leading_coeff_eq_zero, ← leading_coeff_eq_zero], exact eq_zero_or_eq_zero_of_mul_eq_zero this end, ..polynomial.nonzero_comm_ring } lemma root_or_root_of_root_mul (h : is_root (p * q) a) : is_root p a ∨ is_root q a := by rw [is_root, eval_mul] at h; exact eq_zero_or_eq_zero_of_mul_eq_zero h lemma degree_pos_of_root (hp : p ≠ 0) (h : is_root p a) : 0 < degree p := lt_of_not_ge $ λ hlt, begin have := eq_C_of_degree_le_zero hlt, rw [is_root, this, eval_C] at h, exact hp (ext (λ n, show p n = 0, from nat.cases_on n h (λ _, eq_zero_of_degree_lt (lt_of_le_of_lt hlt (with_bot.coe_lt_coe.2 (nat.succ_pos _)))))), end lemma degree_le_mul_left (p : polynomial α) (hq : q ≠ 0) : degree p ≤ degree (p * q) := if hp : p = 0 then by simp [hp] else by rw [degree_mul_eq, degree_eq_nat_degree hp, degree_eq_nat_degree hq]; exact with_bot.coe_le_coe.2 (nat.le_add_right _ _) lemma exists_finset_roots : ∀ {p : polynomial α} (hp : p ≠ 0), ∃ s : finset α, (s.card : with_bot ℕ) ≤ degree p ∧ ∀ x, x ∈ s ↔ is_root p x | p := λ hp, by haveI := classical.prop_decidable (∃ x, is_root p x); exact if h : ∃ x, is_root p x then let ⟨x, hx⟩ := h in have hpd : 0 < degree p := degree_pos_of_root hp hx, have hd0 : p /ₘ (X - C x) ≠ 0 := λ h, by have := mul_div_by_monic_eq_iff_is_root.2 hx; simp * at *, have wf : degree (p /ₘ _) < degree p := degree_div_by_monic_lt _ (monic_X_sub_C x) hp ((degree_X_sub_C x).symm ▸ dec_trivial), let ⟨t, htd, htr⟩ := @exists_finset_roots (p /ₘ (X - C x)) hd0 in have hdeg : degree (X - C x) ≤ degree p := begin rw [degree_X_sub_C, degree_eq_nat_degree hp], rw degree_eq_nat_degree hp at hpd, exact with_bot.coe_le_coe.2 (with_bot.coe_lt_coe.1 hpd) end, have hdiv0 : p /ₘ (X - C x) ≠ 0 := mt (div_by_monic_eq_zero_iff (monic_X_sub_C x) (ne_zero_of_monic (monic_X_sub_C x))).1 $ not_lt.2 hdeg, ⟨insert x t, calc (card (insert x t) : with_bot ℕ) ≤ card t + 1 : with_bot.coe_le_coe.2 $ finset.card_insert_le _ _ ... ≤ degree p : by rw [← degree_add_div_by_monic (monic_X_sub_C x) hdeg, degree_X_sub_C, add_comm]; exact add_le_add' (le_refl (1 : with_bot ℕ)) htd, begin assume y, rw [mem_insert, htr, eq_comm, ← root_X_sub_C], conv {to_rhs, rw ← mul_div_by_monic_eq_iff_is_root.2 hx}, exact ⟨λ h, or.cases_on h (root_mul_right_of_is_root _) (root_mul_left_of_is_root _), root_or_root_of_root_mul⟩ end⟩ else ⟨∅, (degree_eq_nat_degree hp).symm ▸ with_bot.coe_le_coe.2 (nat.zero_le _), by clear exists_finset_roots; finish⟩ using_well_founded {dec_tac := tactic.assumption} /-- `roots p` noncomputably gives a finset containing all the roots of `p` -/ noncomputable def roots (p : polynomial α) : finset α := if h : p = 0 then ∅ else classical.some (exists_finset_roots h) lemma card_roots (hp0 : p ≠ 0) : ((roots p).card : with_bot ℕ) ≤ degree p := begin unfold roots, rw dif_neg hp0, exact (classical.some_spec (exists_finset_roots hp0)).1 end @[simp] lemma mem_roots (hp : p ≠ 0) : a ∈ p.roots ↔ is_root p a := by unfold roots; rw dif_neg hp; exact (classical.some_spec (exists_finset_roots hp)).2 _ lemma card_roots_X_pow_sub_C {n : ℕ} (hn : 0 < n) (a : α) : (roots ((X : polynomial α) ^ n - C a)).card ≤ n := with_bot.coe_le_coe.1 $ calc ((roots ((X : polynomial α) ^ n - C a)).card : with_bot ℕ) ≤ degree ((X : polynomial α) ^ n - C a) : card_roots (X_pow_sub_C_ne_zero hn a) ... = n : degree_X_pow_sub_C hn a /-- `nth_roots n a` noncomputably returns the solutions to `x ^ n = a`-/ noncomputable def nth_roots {α : Type*} [integral_domain α] (n : ℕ) (a : α) : finset α := by letI := classical.prop_decidable; exact roots ((X : polynomial α) ^ n - C a) @[simp] lemma mem_nth_roots {α : Type*} [integral_domain α] {n : ℕ} (hn : 0 < n) {a x : α} : x ∈ nth_roots n a ↔ x ^ n = a := by letI := classical.prop_decidable; rw [nth_roots, mem_roots (X_pow_sub_C_ne_zero hn a), is_root.def, eval_sub, eval_C, eval_pow, eval_X, sub_eq_zero_iff_eq] lemma card_nth_roots {α : Type*} [integral_domain α] (n : ℕ) (a : α) : (nth_roots n a).card ≤ n := by letI := classical.prop_decidable; exact if hn : n = 0 then if h : (X : polynomial α) ^ n - C a = 0 then by simp [nat.zero_le, nth_roots, roots, h] else with_bot.coe_le_coe.1 (le_trans (card_roots h) (by rw [hn, pow_zero, ← @C_1 α _, ← is_ring_hom.map_sub (@C α _ _)]; exact degree_C_le)) else by rw [← with_bot.coe_le_coe, ← degree_X_pow_sub_C (nat.pos_of_ne_zero hn) a]; exact card_roots (X_pow_sub_C_ne_zero (nat.pos_of_ne_zero hn) a) end integral_domain section field variables [field α] {p q : polynomial α} instance : vector_space α (polynomial α) := { ..finsupp.to_module α } lemma monic_mul_leading_coeff_inv (h : p ≠ 0) : monic (p * C (leading_coeff p)⁻¹) := by rw [monic, leading_coeff_mul, leading_coeff_C, mul_inv_cancel (show leading_coeff p ≠ 0, from mt leading_coeff_eq_zero.1 h)] lemma degree_mul_leading_coeff_inv (h : p ≠ 0) : degree (p * C (leading_coeff p)⁻¹) = degree p := have h₁ : (leading_coeff p)⁻¹ ≠ 0 := inv_ne_zero (mt leading_coeff_eq_zero.1 h), by rw [degree_mul_eq, degree_C h₁, add_zero] def div (p q : polynomial α) := C (leading_coeff q)⁻¹ * (p /ₘ (q * C (leading_coeff q)⁻¹)) def mod (p q : polynomial α) := p %ₘ (q * C (leading_coeff q)⁻¹) private lemma quotient_mul_add_remainder_eq_aux (p q : polynomial α) : q * div p q + mod p q = p := if h : q = 0 then by simp [h, mod_by_monic, div, mod] else begin conv {to_rhs, rw ← mod_by_monic_add_div p (monic_mul_leading_coeff_inv h)}, rw [div, mod, add_comm, mul_assoc] end private lemma remainder_lt_aux (p : polynomial α) (hq : q ≠ 0) : degree (mod p q) < degree q := degree_mul_leading_coeff_inv hq ▸ degree_mod_by_monic_lt p (monic_mul_leading_coeff_inv hq) (mul_ne_zero hq (mt leading_coeff_eq_zero.2 (by rw leading_coeff_C; exact inv_ne_zero (mt leading_coeff_eq_zero.1 hq)))) instance : has_div (polynomial α) := ⟨div⟩ instance : has_mod (polynomial α) := ⟨mod⟩ lemma div_def : p / q = C (leading_coeff q)⁻¹ * (p /ₘ (q * C (leading_coeff q)⁻¹)) := rfl lemma mod_def : p % q = p %ₘ (q * C (leading_coeff q)⁻¹) := rfl lemma mod_by_monic_eq_mod (p : polynomial α) (hq : monic q) : p %ₘ q = p % q := show p %ₘ q = p %ₘ (q * C (leading_coeff q)⁻¹), by simp [monic.def.1 hq] lemma div_by_monic_eq_div (p : polynomial α) (hq : monic q) : p /ₘ q = p / q := show p /ₘ q = C (leading_coeff q)⁻¹ * (p /ₘ (q * C (leading_coeff q)⁻¹)), by simp [monic.def.1 hq] lemma mod_X_sub_C_eq_C_eval (p : polynomial α) (a : α) : p % (X - C a) = C (p.eval a) := mod_by_monic_eq_mod p (monic_X_sub_C a) ▸ mod_by_monic_X_sub_C_eq_C_eval _ _ lemma mul_div_eq_iff_is_root : (X - C a) * (p / (X - C a)) = p ↔ is_root p a := div_by_monic_eq_div p (monic_X_sub_C a) ▸ mul_div_by_monic_eq_iff_is_root instance : euclidean_domain (polynomial α) := { quotient := (/), remainder := (%), r := _, r_well_founded := degree_lt_wf, quotient_mul_add_remainder_eq := quotient_mul_add_remainder_eq_aux, remainder_lt := λ p q hq, remainder_lt_aux _ hq, mul_left_not_lt := λ p q hq, not_lt_of_ge (degree_le_mul_left _ hq) } lemma mod_eq_self_iff (hq0 : q ≠ 0) : p % q = p ↔ degree p < degree q := ⟨λ h, h ▸ euclidean_domain.mod_lt _ hq0, λ h, have ¬degree (q * C (leading_coeff q)⁻¹) ≤ degree p := not_le_of_gt $ by rwa degree_mul_leading_coeff_inv hq0, begin rw [mod_def, mod_by_monic, dif_pos (monic_mul_leading_coeff_inv hq0)], unfold div_mod_by_monic_aux, simp [this] end⟩ lemma div_eq_zero_iff (hq0 : q ≠ 0) : p / q = 0 ↔ degree p < degree q := ⟨λ h, by have := euclidean_domain.div_add_mod p q; rwa [h, mul_zero, zero_add, mod_eq_self_iff hq0] at this, λ h, have hlt : degree p < degree (q * C (leading_coeff q)⁻¹), by rwa degree_mul_leading_coeff_inv hq0, have hm : monic (q * C (leading_coeff q)⁻¹) := monic_mul_leading_coeff_inv hq0, by rw [div_def, (div_by_monic_eq_zero_iff hm (ne_zero_of_monic hm)).2 hlt, mul_zero]⟩ lemma degree_add_div (hq0 : q ≠ 0) (hpq : degree q ≤ degree p) : degree q + degree (p / q) = degree p := have degree (p % q) < degree (q * (p / q)) := calc degree (p % q) < degree q : euclidean_domain.mod_lt _ hq0 ... ≤ _ : degree_le_mul_left _ (mt (div_eq_zero_iff hq0).1 (not_lt_of_ge hpq)), by conv {to_rhs, rw [← euclidean_domain.div_add_mod p q, add_comm, degree_add_eq_of_degree_lt this, degree_mul_eq]} end field section derivative variables [comm_semiring α] {β : Type*} /-- `derivative p` formal derivative of the polynomial `p` -/ def derivative (p : polynomial α) : polynomial α := p.sum (λn a, C (a * n) * X^(n - 1)) lemma derivative_apply (p : polynomial α) (n : ℕ) : (derivative p) n = p (n + 1) * (n + 1) := begin rw [derivative], simp [finsupp.sum], rw [finset.sum_eq_single (n + 1)]; simp {contextual := tt}, assume b, cases b; simp [nat.succ_eq_add_one] {contextual := tt}, end @[simp] lemma derivative_zero : derivative (0 : polynomial α) = 0 := finsupp.sum_zero_index lemma derivative_monomial (a : α) (n : ℕ) : derivative (C a * X ^ n) = C (a * n) * X^(n - 1) := by rw [← single_eq_C_mul_X, ← single_eq_C_mul_X, derivative, sum_single_index, single_eq_C_mul_X]; simp; refl @[simp] lemma derivative_C {a : α} : derivative (C a) = 0 := suffices derivative (C a * X^0) = C (a * 0:α) * X ^ 0, by simpa, derivative_monomial a 0 @[simp] lemma derivative_X : derivative (X : polynomial α) = 1 := suffices derivative (C (1:α) * X^1) = C (1 * (1:ℕ)) * X ^ (1 - 1), by simpa, derivative_monomial 1 1 @[simp] lemma derivative_one : derivative (1 : polynomial α) = 0 := derivative_C @[simp] lemma derivative_add {f g : polynomial α} : derivative (f + g) = derivative f + derivative g := by refine finsupp.sum_add_index _ _; simp [add_mul] @[simp] lemma derivative_sum {s : finset β} {f : β → polynomial α} : derivative (s.sum f) = s.sum (λb, derivative (f b)) := begin apply (finset.sum_hom derivative _ _).symm, exact derivative_zero, exact assume x y, derivative_add end @[simp] lemma derivative_mul {f g : polynomial α} : derivative (f * g) = derivative f * g + f * derivative g := calc derivative (f * g) = f.sum (λn a, g.sum (λm b, C ((a * b) * (n + m : ℕ)) * X^((n + m) - 1))) : begin transitivity, exact derivative_sum, transitivity, { apply finset.sum_congr rfl, assume x hx, exact derivative_sum }, apply finset.sum_congr rfl, assume n hn, apply finset.sum_congr rfl, assume m hm, dsimp, transitivity, { apply congr_arg, exact single_eq_C_mul_X }, exact derivative_monomial _ _ end ... = f.sum (λn a, g.sum (λm b, (C (a * n) * X^(n - 1)) * (C b * X^m) + (C (b * m) * X^(m - 1)) * (C a * X^n))) : sum_congr rfl $ assume n hn, sum_congr rfl $ assume m hm, by cases n; cases m; simp [mul_add, add_mul, mul_assoc, mul_comm, mul_left_comm, add_assoc, add_comm, add_left_comm, pow_add, pow_succ] ... = derivative f * g + f * derivative g : begin simp [finsupp.sum_add], conv { to_rhs, congr, { rw [← sum_C_mul_X_eq f, derivative] }, { rw [← sum_C_mul_X_eq g, derivative] }, }, simp [finsupp.mul_sum, finsupp.sum_mul], simp [finsupp.sum, mul_assoc, mul_comm, mul_left_comm] end end derivative section domain variables [integral_domain α] lemma mem_support_derivative [char_zero α] (p : polynomial α) (n : ℕ) : n ∈ (derivative p).support ↔ n + 1 ∈ p.support := suffices (¬(p (n + 1) = 0 ∨ ((1 + n:ℕ) : α) = 0)) ↔ p (n + 1) ≠ 0, by simpa [derivative_apply], by rw [nat.cast_eq_zero]; simp @[simp] lemma degree_derivative_eq [char_zero α] (p : polynomial α) (hp : 0 < nat_degree p) : degree (derivative p) = (nat_degree p - 1 : ℕ) := le_antisymm (le_trans (degree_sum_le _ _) $ sup_le $ assume n hn, have n ≤ nat_degree p, begin rw [← with_bot.coe_le_coe, ← degree_eq_nat_degree], { refine le_degree_of_ne_zero _, simpa using hn }, { assume h, simpa [h] using hn } end, le_trans (degree_monomial_le _ _) $ with_bot.coe_le_coe.2 $ nat.sub_le_sub_right this _) begin refine le_sup _, rw [mem_support_derivative, nat.sub_add_cancel, mem_support_iff], { show ¬ leading_coeff p = 0, rw [leading_coeff_eq_zero], assume h, rw [h, nat_degree_zero] at hp, exact lt_irrefl 0 (lt_of_le_of_lt (zero_le _) hp), }, exact hp end end domain end polynomial
import data.set.finite import tactic section /-! ### General lemmas about finsets; don't involve social choice theory -/ variables {α : Type*} {s : finset α} {a b : α} namespace finset lemma exists_distinct_mem_of_ne_singleton (hs₁ : s.nonempty) (hs₂ : s ≠ {a}) : ∃ b ∈ s, b ≠ a := begin by_contra h, push_neg at h, apply hs₂, rw eq_singleton_iff_nonempty_unique_mem, exact ⟨hs₁, h⟩, end lemma exists_second_distinct_mem (hs : 2 ≤ s.card) (ha : a ∈ s) : ∃ b ∈ s, b ≠ a := begin classical, have hpos : 0 < (s.erase a).card, { rw card_erase_of_mem ha, exact zero_lt_one.trans_le (nat.pred_le_pred hs) }, cases card_pos.mp hpos with b hb, cases mem_erase.mp hb with hne H, exact ⟨b, H, hne⟩, end lemma exists_third_distinct_mem (hs : 2 < s.card) (ha : a ∈ s) (hb : b ∈ s) (h : a ≠ b) : ∃ c ∈ s, c ≠ a ∧ c ≠ b := begin classical, have hpos : 0 < ((s.erase b).erase a).card, { simpa only [card_erase_of_mem, mem_erase_of_ne_of_mem h ha, hb] using nat.pred_le_pred (nat.pred_le_pred hs) }, cases card_pos.mp hpos with c hc, simp_rw mem_erase at hc, exact ⟨c, hc.2.2, hc.1, hc.2.1⟩, end lemma nonempty_of_mem (ha : a ∈ s) : s.nonempty := nonempty_of_ne_empty $ ne_empty_of_mem ha end finset namespace relation lemma forall_exists_trans_gen (R : α → α → Prop) (hR : ∀ a ∈ s, ∃ b ∈ s, R b a) : ∀ a ∈ s, ∃ b ∈ s, trans_gen R b a := λ a ha, let ⟨b, hb, h⟩ := hR a ha in ⟨b, hb, trans_gen.single h⟩ end relation end open relation finset -- We think of social states as type `σ` and inidividuals as type `ι` variables {σ ι : Type*} {x y x' y' z a b : σ} {R R' : σ → σ → Prop} /-! ### Basic definitions and properties -/ --now, we have to define the 'strict' preference relation P def P (R : σ → σ → Prop) (x y : σ) : Prop := R x y ∧ ¬R y x -- accepts a relation and two social states lemma P_iff_of_iff (h₁ : R a b ↔ R' a b) (h₂ : R b a ↔ R' b a) : (P R a b ↔ P R' a b) ∧ (P R b a ↔ P R' b a) := by simp_rw [P, h₁, h₂, iff_self, and_self] -- 'indifference' I def I (R : σ → σ → Prop) (x y : σ) : Prop := R x y ∧ R y x -- Sen lemma 1*a, (i) - (iv) lemma I_trans (htrans : transitive R) (h1 : I R x y) (h2 : I R y z) : I R x z := ⟨htrans h1.1 h2.1, htrans h2.2 h1.2⟩ lemma P_trans_I (htrans : transitive R) (h1 : P R x y) (h2 : I R y z) : P R x z := ⟨htrans h1.1 h2.1, λ h, h1.2 (htrans h2.1 h)⟩ lemma I_trans_P (htrans : transitive R) (h1 : I R x y) (h2 : P R y z) : P R x z := ⟨htrans h1.1 h2.1, λ h, h2.2 (htrans h h1.1)⟩ lemma P_trans (htrans : transitive R) (h1 : P R x y) (h2 : P R y z) : P R x z := ⟨htrans h1.1 h2.1, λ h, h2.2 (htrans h h1.1)⟩ lemma R_of_nP_total (htot : total R) (h : ¬P R y x) : R x y := by { cases htot x y with hR hR, exacts [hR, not_and_not_right.mp h hR] } lemma nP_of_reverseP (h : P R x y) : ¬P R y x := not_and_not_right.mpr $ λ n, h.1 lemma nP_of_nR (h : ¬ R x y) : ¬ P R x y := begin simp only [P, not_and, not_not], intro hyp, exact false.rec _ (h hyp), end lemma false_of_P_self (h : P R x x) : false := (and_not_self _).mp h --what it means for social states to have the "same order" with respect to two relations def same_order (R R' : σ → σ → Prop) (x y x' y' : σ) : Prop := ((R x y ↔ R' x' y') ∧ (R y x ↔ R' y' x')) ∧ (P R x y ↔ P R' x' y') ∧ (P R y x ↔ P R' y' x') /- Alternate defintion of `same_order`. Can be interchanged with the original, as `P_iff_of_iff` shows. -/ -- I'm not certain this is true. I'll explain next time we meet. -Ben def same_order' (r r' : σ → σ → Prop) (s₁ s₂ s₃ s₄ : σ) : Prop := (P r s₁ s₂ ↔ P r' s₃ s₄) ∧ (P r s₂ s₁ ↔ P r' s₄ s₃) lemma same_order_iff_same_order' (hR : total R) (hR' : total R') : same_order R R' x y x y ↔ same_order' R R' x y x y := begin refine ⟨λ h, h.2, λ h, ⟨⟨⟨λ hxy, _ , λ hxy, _⟩, ⟨λ hyx, _, λ hyx, _⟩⟩, h⟩⟩; obtain ⟨h₁, h₂⟩ := ⟨h.1, h.2⟩; erw [← not_iff_not, not_and, not_not, not_and, not_not] at h₁ h₂, { by_cases hyx : R y x, { cases hR' x y with hR' hR', { exact hR' }, exact h₂.mp (imp_intro hxy) hR' }, { exact (h.1.mp ⟨hxy, hyx⟩).1 } }, { by_cases hyx : R' y x, { cases hR x y with hR hR, { exact hR }, exact h₂.mpr (imp_intro hxy) hR }, { exact (h.1.mpr ⟨hxy, hyx⟩).1 } }, { by_cases hxy : R x y, { cases hR' y x with hR' hR', { exact hR' }, exact h₁.mp (imp_intro hyx) hR' }, { exact (h.2.mp ⟨hyx, hxy⟩).1 } }, { by_cases hxy : R' x y, { cases hR y x with hR hR, { exact hR }, exact h₁.mpr (imp_intro hyx) hR }, { exact (h.2.mpr ⟨hyx, hxy⟩).1 } }, -- these subproofs are so similar - is there a way we might combine them? -Ben end lemma same_order_of_P_P' (hR : P R x y) (hR' : P R' x y) : same_order R R' x y x y := ⟨⟨⟨λ h, hR'.1, λ h, hR.1⟩, ⟨hR.2.elim, hR'.2.elim⟩⟩, ⟨⟨λ h, hR', λ h, hR⟩, ⟨(nP_of_reverseP hR).elim, (nP_of_reverseP hR').elim⟩⟩⟩ lemma same_order_of_reverseP_P' (hR : P R y x) (hR' : P R' y x) : same_order R R' x y x y := ⟨⟨⟨hR.2.elim, hR'.2.elim⟩, ⟨λ h, hR'.1, λ h, hR.1⟩⟩, ⟨⟨(nP_of_reverseP hR).elim, (nP_of_reverseP hR').elim⟩, ⟨λ h, hR', λ h, hR⟩⟩⟩ lemma same_order'_comm : same_order' R R' x y x y ↔ same_order' R R' y x y x := and.comm def is_maximal_element (x : σ) (S : finset σ) (R : σ → σ → Prop) : Prop := ∀ y ∈ S, ¬P R y x def is_best_element (x : σ) (S : finset σ) (R : σ → σ → Prop) : Prop := ∀ y ∈ S, R x y noncomputable def maximal_set (S : finset σ) (R: σ → σ → Prop) : finset σ := {x ∈ S | is_maximal_element x S R} noncomputable def choice_set (S : finset σ) (R: σ → σ → Prop) : finset σ := {x ∈ S | is_best_element x S R} lemma maximal_element_of_maximal_set {r : σ → σ → Prop} {s : finset σ} {x : σ} (h : x ∈ maximal_set s r) : is_maximal_element x s r := by simp only [maximal_set, sep_def, mem_filter] at h; exact h.2 lemma maximal_set_of_maximal_element {r: σ → σ → Prop} {s : finset σ} {x : σ} (x_in : x ∈ s) (h : is_maximal_element x s r) : x ∈ maximal_set s r := by simp only [maximal_set, sep_def, mem_filter]; exact ⟨x_in, h⟩ lemma maximal_subset (s : finset σ) (r : σ → σ → Prop) : maximal_set s r ⊆ s := by simp only [maximal_set, sep_def, filter_subset] lemma is_maximal_of_singleton {R : σ → σ → Prop} (hR : reflexive R )(x : σ) : is_maximal_element x {x} R := begin intros b b_in, simp only [mem_singleton] at b_in, rw b_in, simp only [P, not_false_iff, and_not_self], end lemma maximal_eq_empty_of_empty (R : σ → σ → Prop) : maximal_set ∅ R = ∅ := by simp only [maximal_set, sep_def, forall_false_left, filter_true_of_mem, implies_true_iff, not_mem_empty] lemma choice_eq_empty_of_empty (R : σ → σ → Prop) : choice_set ∅ R = ∅ := by simp only [choice_set, sep_def, forall_false_left, filter_true_of_mem, implies_true_iff, not_mem_empty] /- For any finite set of alternatives and for any ordering, the choice set is a subset of the maximal set. -/ lemma choice_subset_maximal (S : finset σ) (R : σ → σ → Prop) : choice_set S R ⊆ maximal_set S R := begin intros a a_in, simp only [choice_set, maximal_set, is_best_element, P, is_maximal_element, sep_def, mem_filter, not_and, not_not] at *, exact ⟨a_in.1, (λ y y_in hy, a_in.2 y y_in)⟩, end /-! ### Some results about quasi-ordering -/ /-- Quasi-ordering as a structure -/ structure quasi_order (α : Type*) := (rel : α → α → Prop) (refl : reflexive rel) (trans : transitive rel) instance (α : Type*) : has_coe_to_fun (quasi_order α) (λ _, α → α → Prop) := ⟨ λ r, r.rel⟩ lemma quasi_order.eq_coe {α : Type*} (r : quasi_order α) : r.rel = r := rfl /- Any nonempty, finite set of alternatives has a maximal element with respec to a quasi-order `r`. Sen refers to this as lemma 1*b. -/ lemma maximal_of_finite_quasi_ordered {α : Type*} (r : quasi_order α) (S : finset α) (hS : S.nonempty) : ∃ x ∈ S, is_maximal_element x S r := -- needs golfing!!! begin classical, refine finset.induction_on S _ _ hS, { rintro ⟨_, ⟨⟩⟩ }, rintro a s - IH -, by_cases h : s.nonempty, { obtain ⟨x, hx⟩ := IH h, by_cases hP : P r a x, { use a, refine ⟨by simp only [mem_insert, true_or, eq_self_iff_true], _⟩, intros b b_in, by_contra, have b_neq : b ≠ a, { by_contra h_eq, rw h_eq at h, exact h.2 (r.refl a), }, cases hx with x_in hx, exact (hx b (mem_of_mem_insert_of_ne b_in b_neq)) (P_trans r.trans h hP), }, { use x, cases hx with x_in hx, refine ⟨mem_insert_of_mem x_in, _⟩, intros b b_in, by_cases hb : b = a, { rw hb, exact hP, }, have b_in_s : b ∈ s := mem_of_mem_insert_of_ne b_in hb, exact hx b b_in_s, }, }, { suffices : {a} = insert a s, { rw ← this, exact ⟨a, mem_singleton_self a, is_maximal_of_singleton r.refl a⟩, }, simp only [not_nonempty_iff_eq_empty] at h, rw h, refl, }, end /- UNDECIDED: this is not used in latest draft -/ lemma choice_set_of_singleton {r : σ → σ → Prop} (hr: reflexive r) (x : σ) : choice_set {x} r = {x} := begin ext, simp only [choice_set, is_best_element, sep_def, mem_filter, forall_eq, and_iff_left_iff_imp, mem_singleton], intro hyp, rw hyp, exact hr x, end /- Suppose `r` is a reflexive relation. Let `x` and `y` be distinct alternatives. Then `x` is strictly better than `y` if an only if `{x}` is the choice set of `{x,y}` with respect to `r`. Sen refers to this as lemma 1*c. -/ lemma singleton_choice_set [decidable_eq σ] {r : σ → σ → Prop} (x y : σ) (not_eq : x ≠ y) (hR : reflexive r) : P r x y ↔ {x} = choice_set {x,y} r := begin -- golfing needed split, { intro h, unfold choice_set, unfold is_best_element, ext, split, { intro a_in, simp only [sep_def, mem_filter, mem_insert, forall_eq_or_imp, forall_eq, mem_singleton], refine ⟨or.inl (mem_singleton.1 a_in), _⟩, rw mem_singleton.1 a_in, exact ⟨hR x, h.1⟩, }, { simp only [and_imp, sep_def, mem_filter, mem_insert, forall_eq_or_imp, forall_eq, mem_singleton], intro hyp, cases hyp, { intros hax hay, exact hyp, }, { rw hyp, intro hyx, exfalso, exact h.2 hyx, }, }, }, { intro hyp, split; rw ext_iff at hyp, { have x_in := (hyp x).1 (mem_singleton_self x), simp only [choice_set, is_best_element, sep_def, mem_filter] at x_in, refine x_in.2 y _, simp only [mem_insert], exact or.inr (mem_singleton_self y), }, { have y_not_in := (not_congr (hyp y)).1 (not_mem_singleton.2 (ne_comm.mp not_eq)), simp only [choice_set, is_best_element, sep_def, mem_filter, not_and, mem_insert] at y_not_in, specialize y_not_in (by right; exact mem_singleton_self y), push_neg at y_not_in, rcases y_not_in with ⟨a, ha₁, ha₂⟩, cases ha₁, { rw ha₁ at ha₂, exact ha₂, }, { exfalso, simp only [mem_singleton] at ha₁, rw ha₁ at ha₂, exact ha₂ (hR y), }, }, }, end /- Suppose `r` is a quasi-ordering and `S` is a finite set of alternatives. Then if the choice set of `S` is nonempty with respect to `R`, the choice set is equal to the maximal set. Sen refers to this as lemma 1*d. -/ lemma choice_eq_maximal_of_quasi {r : quasi_order σ} (S : finset σ) (hS: (choice_set S r).nonempty) : choice_set S r = maximal_set S r := begin cases hS with x x_in, apply subset.antisymm (choice_subset_maximal S r), intros z z_in, simp only [choice_set, maximal_set, is_best_element, is_maximal_element, sep_def, mem_filter, P, not_and, not_not] at *, refine ⟨z_in.1, λ y y_in, _⟩, exact r.trans (z_in.2 x x_in.1 (x_in.2 z z_in.1)) (x_in.2 y y_in), end /- UNDECIDED IF THIS LEMMA IS WORTH KEEPING IF NOT USED IN LATEST DRAFT OF 1*e lemma is_maximal_insert_of_nP [decidable_eq σ] {r : σ → σ → Prop} {b x : σ} {s : finset σ} (b_not_in : b ∉ s) (hb : ¬ P r b x) : x ∈ maximal_set s r → x ∈ maximal_set (insert b s) r := begin intro x_in, simp only [maximal_set, sep_def, mem_filter, mem_insert] at *, refine ⟨or.inr x_in.1, _⟩, intros a a_in, cases (mem_insert.1 a_in), { rw h, exact hb }, { exact x_in.2 a h, }, end UNDECIDED IF THIS LEMMA IS WORTH KEEPING IF NOT USED IN LATEST DRAFT OF 1*e lemma maximal_of_insert_not_maximal [decidable_eq σ] {r : σ → σ → Prop} {b : σ} {s : finset σ} (hr : transitive r) (b_not_in : b ∉ s) (hb : b ∉ maximal_set (insert b s) r): maximal_set s r = maximal_set (insert b s) r := begin have : ∃ c ∈ s, P r c b, { simp only [maximal_set, is_maximal_element, true_and, sep_def, exists_prop, mem_filter, mem_insert, forall_eq_or_imp, not_and, not_not, true_or, eq_self_iff_true, not_forall] at hb, have foo : ¬ P r b b, { by_contra h, exact h.2 h.1, }, rcases hb foo with ⟨c, c_in, hc⟩, exact ⟨c, c_in, hc⟩, }, rcases this with ⟨c, c_in, hc⟩, ext, simp only [maximal_set, is_maximal_element, sep_def, mem_filter, mem_insert, forall_eq_or_imp], split, { intro ha, refine ⟨or.inr ha.1, _, ha.2⟩, by_contra, exact (ha.2 c c_in) (P_trans hr hc h), }, { intro hyp, rcases hyp with ⟨a_in, hba, ha⟩, have h_neq : ¬ a = b, { by_contra h_eq, rw ← h_eq at hc, exact (ha c c_in) hc, }, exact ⟨a_in.resolve_left h_neq, ha⟩, }, end UNDECIDED IF THIS LEMMA IS WORTH KEEPING IF NOT USED IN LATEST DRAFT OF 1*e lemma exists_maximal_of_quasi [decidable_eq σ] {a : σ} {S : finset σ} (r : quasi_order σ) (a_in : a ∈ S) : ∃ b ∈ maximal_set S r, r b a := begin by_cases ha : a ∈ maximal_set S r, { exact ⟨a, ha, r.refl a⟩, }, by_contra hb, push_neg at hb, have : ∀ c ∈ {x ∈ S | r x a ∧ x ∉ maximal_set S r}, ∃ d ∈ {x ∈ S | r x a ∧ x ∉ maximal_set S r}, P r d c, { intros c c_in, simp only [maximal_set, is_maximal_element, sep_def, exists_prop, mem_filter, not_and, not_not, not_forall] at c_in, obtain ⟨d, d_in, hdc⟩ := c_in.2.2 c_in.1, refine ⟨d, _, hdc⟩, simp only [sep_def, mem_filter], refine ⟨d_in, r.trans hdc.1 c_in.2.1, _ ⟩, by_contra hyp, exact (hb d hyp) (r.trans hdc.1 c_in.2.1), }, have hy : ∃ y ∈ {x ∈ S | r x a ∧ x ∉ maximal_set S r}, trans_gen (P r) y y, { replace this : ∀ c ∈ {x ∈ S | r x a ∧ x ∉ maximal_set S r}, ∃ d ∈ {x ∈ S | r x a ∧ x ∉ maximal_set S r}, trans_gen (P r) d c:= λ a ha, let ⟨b, hb, h⟩ := this a ha in ⟨b, hb, trans_gen.single h⟩, refine cyclical_of_no_highest _ this, use a, simp only [sep_def, mem_filter], exact ⟨a_in, r.refl a, ha⟩, }, rcases hy with ⟨y, y_in, hy⟩, have hP : transitive (P r) := λ x₁ x₂ x₃ h₁ h₂, (P_trans r.trans h₁ h₂), rw (trans_gen_eq_self hP) at hy, exact false_of_P_self hy, end -/ /- Lemma 1*e according to Sen -/ lemma maximal_indiff_iff_choice_eq_maximal' (r : quasi_order σ) (S : finset σ) (hS : S.nonempty) : (∀ x y ∈ maximal_set S r, I r x y) ↔ choice_set S r = maximal_set S r := begin classical, split, { intro hyp, by_contra sets_neq, obtain ⟨x₀, x₀_in, hx₀⟩ := maximal_of_finite_quasi_ordered r S hS, have choice_empty : choice_set S r = ∅, { by_contra, exact sets_neq (choice_eq_maximal_of_quasi S (nonempty_of_ne_empty h)), }, have x₀_not_in : x₀ ∉ choice_set S r := by rw choice_empty; exact not_mem_empty x₀, simp only [choice_set, is_best_element, sep_def, exists_prop, mem_filter, not_and, not_forall] at x₀_not_in, obtain ⟨x₁, x₁_in, hx₁⟩ := x₀_not_in x₀_in, have x₁_not_in : x₁ ∉ maximal_set S r, { by_contra x₁_in_max, refine hx₁ (hyp x₀ x₁ (maximal_set_of_maximal_element x₀_in hx₀) x₁_in_max).1, }, have h_no_max : ¬ (∃ x ∈ {z ∈ S | P r z x₁ ∧ z ∉ maximal_set S r }, is_maximal_element x {z ∈ S | P r z x₁ ∧ z ∉ maximal_set S r } r), { unfold is_maximal_element, push_neg, intros x x_in, simp only [maximal_set, is_maximal_element, sep_def, mem_filter, not_and, exists_prop, not_not, not_forall] at x_in, simp only [sep_def, exists_prop, mem_filter], obtain ⟨y, y_in, hy⟩ := (x_in.2.2 x_in.1), refine ⟨y, ⟨y_in, (P_trans r.trans hy x_in.2.1),_⟩, hy⟩, by_contra y_max, apply hx₁, exact (I_trans_P r.trans (hyp x₀ y (maximal_set_of_maximal_element x₀_in hx₀) y_max) (P_trans r.trans hy x_in.2.1)).1, }, refine h_no_max (maximal_of_finite_quasi_ordered r {z ∈ S | P r z x₁ ∧ z ∉ maximal_set S r } _), simp only [maximal_set, is_maximal_element, sep_def, exists_prop, mem_filter, not_and, not_not, not_forall] at x₁_not_in, obtain ⟨x₂, x₂_in, hx₂⟩ := x₁_not_in x₁_in, use x₂, simp only [sep_def, mem_filter], refine ⟨x₂_in, hx₂, _⟩, by_contra x₂_in_max, apply hx₁, refine r.trans (hyp x₀ x₂ (maximal_set_of_maximal_element x₀_in hx₀) x₂_in_max).1 hx₂.1, }, { intro hyp, rw ← hyp, intros x y x_in y_in, simp only [choice_set, sep_def, mem_filter] at *, exact ⟨x_in.2 y y_in.1, y_in.2 x x_in.1⟩, }, end /-! ### Definition of a preference ordering -/ /-- Preference ordering as a structure, used extensively in `arrows_theorem`. -/ structure pref_order (α : Type*) := (rel : α → α → Prop) (refl : reflexive rel) (total : total rel) (trans : transitive rel) instance (α : Type*) : has_coe_to_fun (pref_order α) (λ _, α → α → Prop) := ⟨ λ r, r.rel⟩ lemma pref_order.eq_coe {α : Type*} (r : pref_order α) : r.rel = r := rfl lemma pref_order.reverse {α : Type*} {r : pref_order α} {a b : α} (h : ¬r a b) : r b a := (r.total a b).resolve_left h /-! ### Subrelations and Compatibility -/ def is_subrelation (Q₁ Q₂ : quasi_order σ) : Prop := ∀ x y : σ, (Q₁ x y → Q₂ x y) ∧ ((Q₁ x y ∧ ¬ Q₁ y x) → ¬ Q₂ y x) def is_compatible (Q : quasi_order σ) (R : pref_order σ): Prop := ∀ x y : σ, (Q x y → R x y) ∧ ((Q x y ∧ ¬ Q y x) → ¬ R y x) /- For every quasi_order, there exists a compatible preference order. Lemma 1*f according to Sen. -/ /- lemma compatible_pref_order_of_quasi (Q : quasi_order σ) : ∃ R : pref_order σ, is_compatible Q R := begin sorry, end -/ /-! ### Quasitransitivity and Acyclicality -/ def acyclical (R : σ → σ → Prop) : Prop := ∀ x : σ, ¬trans_gen (P R) x x lemma cyclical_of_no_highest {R : σ → σ → Prop} {S : finset σ} (hS : S.nonempty) (hR : ∀ a ∈ S, ∃ b ∈ S, trans_gen R b a) : ∃ c ∈ S, trans_gen R c c := begin classical, refine finset.induction_on S _ _ hS hR, { rintro ⟨_, ⟨⟩⟩ }, rintro a s - IH - hR', obtain ⟨b, hb', ba⟩ := hR' a (mem_insert_self a s), obtain rfl | hb := mem_insert.1 hb', { exact ⟨_, mem_insert_self b s, ba⟩ }, { obtain ⟨c, hc, h⟩ := IH ⟨_, hb⟩ (λ d hd, _), { exact ⟨c, mem_insert_of_mem hc, h⟩ }, { obtain ⟨e, he, ed⟩ := hR' d (mem_insert_of_mem hd), obtain rfl | he := mem_insert.1 he, { exact ⟨_, hb, ba.trans ed⟩ }, { exact ⟨_, he, ed⟩ } } }, end /- Sen's Theorem on the existence of a choice function, referred to as lemma 1*l. If a relation is reflexive and total, then acyclicality is a necessary and sufficient condition for a choice function to be defined on every finset `X`. -/ theorem best_elem_iff_acyclical [fintype σ] (htot : total R) : (∀ X : finset σ, X.nonempty → ∃ b ∈ X, is_best_element b X R) ↔ acyclical R := begin refine ⟨λ h x hx, _, λ h_acyc X X_ne, _⟩, { obtain ⟨b, b_in, hb⟩ := h {a ∈ univ | trans_gen (P R) a x ∧ trans_gen (P R) x a} ⟨x, by simpa⟩, -- can we maybe pull this sort of thing out into its own general lemma? simp only [true_and, sep_def, mem_filter, mem_univ] at b_in, obtain ⟨c, hc₁, hc₂⟩ := trans_gen.tail'_iff.mp b_in.2, refine hc₂.2 (hb c _), simp [b_in.1.head hc₂, hx.trans_left hc₁] }, { by_contra h, suffices : ∃ c ∈ X, trans_gen (P R) c c, from let ⟨c, _, hc⟩ := this in h_acyc c hc, refine cyclical_of_no_highest X_ne (forall_exists_trans_gen _ (λ a a_in, _)), simp only [is_best_element, not_exists, not_forall] at h, obtain ⟨b, b_in, hb⟩ := h a a_in, exact ⟨b, b_in, ⟨(htot a b).resolve_left hb, hb⟩⟩ }, end
/- Source: https://primes.utm.edu/notes/proofs/infinite/euclids.html Theorem. There are more primes than found in any finite list of primes Proof. Call the primes in our finite list p_1, p_2, ..., p_r. Let P be any common multiple of these primes plus one (for example P = p_1 * p_2 * ... * p_r + 1). Now P is either prime or it is not. If it is prime, then P is a prime that was not in out list. If P is not prime, then it is divisible by some prime, call it p. Notice p can not be any of p_1, p_2, ..., p_r, otherwise p would divide 1, which is impossible. So this prime p is some prime that was not in our original list. Either way, the original list was incomplete. -/ import data.nat.prime import tactic.find namespace hidden open nat -- source: https://github.com/semorrison/lean-tidy/blob/master/examples/primes.lean theorem exists_infinite_primes : ∀ n : ℕ, ∃ p, p ≥ n ∧ prime p := λ n, let p := min_fac (fact n + 1) in have fp : fact n > 0 := fact_pos n, have f1 : fact n + 1 ≠ 1, from ne_of_gt $ succ_lt_succ $ fact_pos n, have pp : prime p, from min_fac_prime f1, have w : n ≤ p, from le_of_not_ge $ λ h, have h₁ : p ∣ fact n, from dvd_fact (min_fac_pos (fact n + 1)) h, have h₂ : p ∣ 1, from (nat.dvd_add_iff_right h₁).2 (min_fac_dvd (fact n + 1)), pp.not_dvd_one h₂, ⟨p, w, pp⟩ end hidden -- #find needs "import data.nat.prime" line -- OR -- #find needs "import tactic.find" line -- #find (_ : nat) + _ = _ + _ -- waiting time ~= 20 seconds -- nat.add_assoc: ∀ (n m k : ℕ), n + m + k = n + (m + k) -- nat.add_left_comm: ∀ (n m k : ℕ), n + (m + k) = m + (n + k) -- nat.add_comm: ∀ (n m : ℕ), n + m = m + n -- nat.succ_add_eq_succ_add: ∀ (n m : ℕ), n.succ + m = n + m.succ -- nat.add_right_comm: ∀ (n m k : ℕ), n + m + k = n + k + m
Formal statement is: lemma lmeasurable_frontier: "bounded S \<Longrightarrow> frontier S \<in> lmeasurable" Informal statement is: If $S$ is a bounded set, then the frontier of $S$ is Lebesgue measurable.
function lo=v_lpcrf2lo(rf) %V_LPCRF2LO Convert reflection coefficients to log area ratios LO=(RF) %the output values are limited to about +-14.5 % Copyright (C) Mike Brookes 1997 % Version: $Id: v_lpcrf2lo.m 10865 2018-09-21 17:22:45Z dmb $ % % VOICEBOX is a MATLAB toolbox for speech processing. % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation; either version 2 of the License, or % (at your option) any later version. % % This program is distributed in the hope that it will be useful, % but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You can obtain a copy of the GNU General Public License from % http://www.gnu.org/copyleft/gpl.html or by writing to % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% r=max(min(rf,1-1E-6),1E-6-1); lo=log((1-r)./(1+r));
Load LFindLoad. From lfind Require Import LFind. From QuickChick Require Import QuickChick. From adtind Require Import goal4. Derive Show for natural. Derive Arbitrary for natural. Instance Dec_Eq_natural : Dec_Eq natural. Proof. dec_eq. Qed. Derive Show for lst. Derive Arbitrary for lst. Instance Dec_Eq_lst : Dec_Eq lst. Proof. dec_eq. Qed. Lemma conj7synthconj3 : forall (lv0 : lst), (@eq natural (len (Cons (len lv0) lv0)) (Succ (len lv0))). Admitted. QuickChick conj7synthconj3.
-- @@stderr -- dtrace: failed to compile script test/unittest/pragma/err.D_PRAGERR.d: [D_PRAGERR] line 16: #error: this is an error message
/- Copyright (c) 2019 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ import control.monad.basic import data.fintype.basic import data.list.prod_sigma /-! Type class for finitely enumerable types. The property is stronger than `fintype` in that it assigns each element a rank in a finite enumeration. -/ universes u v open finset /-- `fin_enum α` means that `α` is finite and can be enumerated in some order, i.e. `α` has an explicit bijection with `fin n` for some n. -/ class fin_enum (α : Sort*) := (card : ℕ) (equiv [] : α ≃ fin card) [dec_eq : decidable_eq α] attribute [instance, priority 100] fin_enum.dec_eq namespace fin_enum variables {α : Type u} {β : α → Type v} /-- transport a `fin_enum` instance across an equivalence -/ def of_equiv (α) {β} [fin_enum α] (h : β ≃ α) : fin_enum β := { card := card α, equiv := h.trans (equiv α), dec_eq := (h.trans (equiv _)).decidable_eq } /-- create a `fin_enum` instance from an exhaustive list without duplicates -/ def of_nodup_list [decidable_eq α] (xs : list α) (h : ∀ x : α, x ∈ xs) (h' : list.nodup xs) : fin_enum α := { card := xs.length, equiv := ⟨λ x, ⟨xs.index_of x,by rw [list.index_of_lt_length]; apply h⟩, λ ⟨i,h⟩, xs.nth_le _ h, λ x, by simp [of_nodup_list._match_1], λ ⟨i,h⟩, by simp [of_nodup_list._match_1,*]; rw list.nth_le_index_of; apply list.nodup_erase_dup ⟩ } /-- create a `fin_enum` instance from an exhaustive list; duplicates are removed -/ def of_list [decidable_eq α] (xs : list α) (h : ∀ x : α, x ∈ xs) : fin_enum α := of_nodup_list xs.erase_dup (by simp *) (list.nodup_erase_dup _) /-- create an exhaustive list of the values of a given type -/ def to_list (α) [fin_enum α] : list α := (list.fin_range (card α)).map (equiv α).symm open function @[simp] lemma mem_to_list [fin_enum α] (x : α) : x ∈ to_list α := by simp [to_list]; existsi equiv α x; simp @[simp] lemma nodup_to_list [fin_enum α] : list.nodup (to_list α) := by simp [to_list]; apply list.nodup_map; [apply equiv.injective, apply list.nodup_fin_range] /-- create a `fin_enum` instance using a surjection -/ def of_surjective {β} (f : β → α) [decidable_eq α] [fin_enum β] (h : surjective f) : fin_enum α := of_list ((to_list β).map f) (by intro; simp; exact h _) /-- create a `fin_enum` instance using an injection -/ noncomputable def of_injective {α β} (f : α → β) [decidable_eq α] [fin_enum β] (h : injective f) : fin_enum α := of_list ((to_list β).filter_map (partial_inv f)) begin intro x, simp only [mem_to_list, true_and, list.mem_filter_map], use f x, simp only [h, function.partial_inv_left], end instance pempty : fin_enum pempty := of_list [] (λ x, pempty.elim x) instance empty : fin_enum empty := of_list [] (λ x, empty.elim x) instance punit : fin_enum punit := of_list [punit.star] (λ x, by cases x; simp) instance prod {β} [fin_enum α] [fin_enum β] : fin_enum (α × β) := of_list ( (to_list α).product (to_list β) ) (λ x, by cases x; simp) instance sum {β} [fin_enum α] [fin_enum β] : fin_enum (α ⊕ β) := of_list ( (to_list α).map sum.inl ++ (to_list β).map sum.inr ) (λ x, by cases x; simp) instance fin {n} : fin_enum (fin n) := of_list (list.fin_range _) (by simp) instance quotient.enum [fin_enum α] (s : setoid α) [decidable_rel ((≈) : α → α → Prop)] : fin_enum (quotient s) := fin_enum.of_surjective quotient.mk (λ x, quotient.induction_on x (λ x, ⟨x, rfl⟩)) /-- enumerate all finite sets of a given type -/ def finset.enum [decidable_eq α] : list α → list (finset α) | [] := [∅] | (x :: xs) := do r ← finset.enum xs, [r,{x} ∪ r] @[simp]lemma finset.mem_enum [decidable_eq α] (s : finset α) (xs : list α) : s ∈ finset.enum xs ↔ ∀ x ∈ s, x ∈ xs := begin induction xs generalizing s; simp [*,finset.enum], { simp [finset.eq_empty_iff_forall_not_mem,(∉)], refl }, { split, rintro ⟨a,h,h'⟩ x hx, cases h', { right, apply h, subst a, exact hx, }, { simp only [h', mem_union, mem_singleton] at hx ⊢, cases hx, { exact or.inl hx }, { exact or.inr (h _ hx) } }, intro h, existsi s \ ({xs_hd} : finset α), simp only [and_imp, union_comm, mem_sdiff, mem_singleton], simp only [or_iff_not_imp_left] at h, existsi h, by_cases xs_hd ∈ s, { have : {xs_hd} ⊆ s, simp only [has_subset.subset, *, forall_eq, mem_singleton], simp only [union_sdiff_of_subset this, or_true, finset.union_sdiff_of_subset, eq_self_iff_true], }, { left, symmetry, simp only [sdiff_eq_self], intro a, simp only [and_imp, mem_inter, mem_singleton, not_mem_empty], intros h₀ h₁, subst a, apply h h₀, } } end instance finset.fin_enum [fin_enum α] : fin_enum (finset α) := of_list (finset.enum (to_list α)) (by intro; simp) instance subtype.fin_enum [fin_enum α] (p : α → Prop) [decidable_pred p] : fin_enum {x // p x} := of_list ((to_list α).filter_map $ λ x, if h : p x then some ⟨_,h⟩ else none) (by rintro ⟨x,h⟩; simp; existsi x; simp *) instance (β : α → Type v) [fin_enum α] [∀ a, fin_enum (β a)] : fin_enum (sigma β) := of_list ((to_list α).bind $ λ a, (to_list (β a)).map $ sigma.mk a) (by intro x; cases x; simp) instance psigma.fin_enum [fin_enum α] [∀ a, fin_enum (β a)] : fin_enum (Σ' a, β a) := fin_enum.of_equiv _ (equiv.psigma_equiv_sigma _) instance psigma.fin_enum_prop_left {α : Prop} {β : α → Type v} [∀ a, fin_enum (β a)] [decidable α] : fin_enum (Σ' a, β a) := if h : α then of_list ((to_list (β h)).map $ psigma.mk h) (λ ⟨a,Ba⟩, by simp) else of_list [] (λ ⟨a,Ba⟩, (h a).elim) instance psigma.fin_enum_prop_right {β : α → Prop} [fin_enum α] [∀ a, decidable (β a)] : fin_enum (Σ' a, β a) := fin_enum.of_equiv {a // β a} ⟨λ ⟨x, y⟩, ⟨x, y⟩, λ ⟨x, y⟩, ⟨x, y⟩, λ ⟨x, y⟩, rfl, λ ⟨x, y⟩, rfl⟩ instance psigma.fin_enum_prop_prop {α : Prop} {β : α → Prop} [decidable α] [∀ a, decidable (β a)] : fin_enum (Σ' a, β a) := if h : ∃ a, β a then of_list [⟨h.fst,h.snd⟩] (by rintro ⟨⟩; simp) else of_list [] (λ a, (h ⟨a.fst,a.snd⟩).elim) @[priority 100] instance [fin_enum α] : fintype α := { elems := univ.map (equiv α).symm.to_embedding, complete := by intros; simp; existsi (equiv α x); simp } /-- For `pi.cons x xs y f` create a function where every `i ∈ xs` is mapped to `f i` and `x` is mapped to `y` -/ def pi.cons [decidable_eq α] (x : α) (xs : list α) (y : β x) (f : Π a, a ∈ xs → β a) : Π a, a ∈ (x :: xs : list α) → β a | b h := if h' : b = x then cast (by rw h') y else f b (list.mem_of_ne_of_mem h' h) /-- Given `f` a function whose domain is `x :: xs`, produce a function whose domain is restricted to `xs`. -/ def pi.tail {x : α} {xs : list α} (f : Π a, a ∈ (x :: xs : list α) → β a) : Π a, a ∈ xs → β a | a h := f a (list.mem_cons_of_mem _ h) /-- `pi xs f` creates the list of functions `g` such that, for `x ∈ xs`, `g x ∈ f x` -/ def pi {β : α → Type (max u v)} [decidable_eq α] : Π xs : list α, (Π a, list (β a)) → list (Π a, a ∈ xs → β a) | [] fs := [λ x h, h.elim] | (x :: xs) fs := fin_enum.pi.cons x xs <$> fs x <*> pi xs fs lemma mem_pi {β : α → Type (max u v)} [fin_enum α] [∀a, fin_enum (β a)] (xs : list α) (f : Π a, a ∈ xs → β a) : f ∈ pi xs (λ x, to_list (β x)) := begin induction xs; simp [pi,-list.map_eq_map] with monad_norm functor_norm, { ext a ⟨ ⟩ }, { existsi pi.cons xs_hd xs_tl (f _ (list.mem_cons_self _ _)), split, exact ⟨_,rfl⟩, existsi pi.tail f, split, { apply xs_ih, }, { ext x h, simp [pi.cons], split_ifs, subst x, refl, refl }, } end /-- enumerate all functions whose domain and range are finitely enumerable -/ def pi.enum (β : α → Type (max u v)) [fin_enum α] [∀a, fin_enum (β a)] : list (Π a, β a) := (pi (to_list α) (λ x, to_list (β x))).map (λ f x, f x (mem_to_list _)) lemma pi.mem_enum {β : α → Type (max u v)} [fin_enum α] [∀a, fin_enum (β a)] (f : Π a, β a) : f ∈ pi.enum β := by simp [pi.enum]; refine ⟨λ a h, f a, mem_pi _ _, rfl⟩ instance pi.fin_enum {β : α → Type (max u v)} [fin_enum α] [∀a, fin_enum (β a)] : fin_enum (Πa, β a) := of_list (pi.enum _) (λ x, pi.mem_enum _) instance pfun_fin_enum (p : Prop) [decidable p] (α : p → Type*) [Π hp, fin_enum (α hp)] : fin_enum (Π hp : p, α hp) := if hp : p then of_list ( (to_list (α hp)).map $ λ x hp', x ) (by intro; simp; exact ⟨x hp,rfl⟩) else of_list [λ hp', (hp hp').elim] (by intro; simp; ext hp'; cases hp hp') end fin_enum
PITableData <- function(columns = NULL, rows = NULL, webException = NULL) { if (is.null(columns) == FALSE) { } if (is.null(rows) == FALSE) { if (is.vector(rows) == FALSE) { return (print(paste0("Error: rows must be a vector."))) } } if (is.null(webException) == FALSE) { className <- attr(webException, "className") if ((is.null(className)) || (className != "PIWebException")) { return (print(paste0("Error: the class from the parameter webException should be PIWebException."))) } } value <- list( Columns = columns, Rows = rows, WebException = webException) valueCleaned <- rmNullObs(value) attr(valueCleaned, "className") <- "PITableData" return(valueCleaned) }
If $c \neq 0$, then the sequence $f_n c$ converges if and only if the sequence $f_n$ converges.
#redirect Ben Duax
lemma emeasure_mono_AE: assumes imp: "AE x in M. x \<in> A \<longrightarrow> x \<in> B" and B: "B \<in> sets M" shows "emeasure M A \<le> emeasure M B"
#redirect Davis Art Center
`is_element/YC` := (N::posint) -> (A::set) -> proc(x) local a,b,i,j,k,t,G,J,E,B; global reason; if not(type(x,table)) then reason := [convert(procname,string),"x is not a table",x]; return false; fi; if map(op,{indices(x)}) <> A then reason := [convert(procname,string),"x is not indexed by A",x,A]; return false; fi; for a in A do if not `is_element/R`(N)(x[a]) then reason := [convert(procname,string),"x[a] is not in R^N",a,x[a],N]; return false; fi; od; for i from 1 to N do if min(seq(x[a][i],a in A)) <> 0 then reason := [convert(procname,string),"min(x[i]) <> 0",i,x]; return false; fi; od; G := `gaps/F`(N)(A)(x); if max(G) <> 1 then reason := [convert(procname,string),"max(G) <> 1",G]; return false; fi; J := select(j -> G[j] = 1,[seq(k,k=1..N)]); E := {seq(seq([a,b],b in A),a in A)}; for j in J do t := table(); for a in A do t[a] := x[a][j]; od; B := blur_preorder(A)(t,1); E := E intersect B intersect `op/preord`(A)(B); od: if E <> {seq([a,a],a in A)} then reason := [convert(procname,string),"E <> Delta",E]; return false; fi; return true; end; `is_equal/YC` := (N::posint) -> (A::set) -> proc(x,y) local a; global reason; for a in A do if x[a] <> y[a] then reason := [convert(procname,string),"x[a] <> y[a]",a,x[a],y[a]]; return false; fi; od; return true; end; `inc/YC/F` := (N::posint) -> (A::set) -> (x) -> x; `mu_bar/YC/PP` := (N::posint) -> (A::set) -> proc(x) local i,j,k,p,m,a,b,L,A0,T0,g0,g,t,s,AA,R,RR; # DEBUG(); L := NULL; m := nops(A); for i from 1 to N do A0 := sort([op(A)],(a,b) -> x[a][i] <= x[b][i]); T0 := [seq(x[A0[j]][i],j=1..m)]; for j from 1 to m-1 do L := L,[i,A0[j],A0[j+1],T0[j+1]-T0[j]]; od; od; L := sort([L],(a,b) -> a[4] <= b[4]); k := nops(L); R := table(): t := table(): R[1] := `mu/F/PP`(N)(A)(x); t[1] := L[1][4]; s := table(): s[R[1]] := t[1]; AA := {seq(seq([a,b],b in A),a in A)}; for p from 2 to k do i,a,b,g := op(L[p-1]); RR := R[p-1][i]; RR := RR union select(xy -> member([xy[1],b],RR) and member([a,xy[2]],RR),AA); R[p] := [seq(R[p-1][j],j=1..i-1),RR,seq(R[p-1][j],j=i+1..N)]; t[p] := L[p][4] - L[p-1][4]; if t[p] > 0 then s[R[p]] := t[p]; fi; od; return eval(s); end: `sigma_bar/PP/YC` := (N::posint) -> (A::set) -> proc(t) local x,y,a,C,s,R; x := table(); for a in A do x[a] := [0$N]; od; C := map(op,[indices(t)]); for R in C do s := t[R]; y := `sigma/PP/F`(N)(A)(R); for a in A do x[a] := x[a] +~ s *~ y[a]; od; od; return eval(x); end:
module LightClick.Connection import Data.Vect import Toolkit.Decidable.Informative import Toolkit.Data.Rig import LightClick.Types import LightClick.Types.Equality import LightClick.Types.Compatibility %default total namespace Port public export data Compatible : (left : Ty (PORT l)) -> (right : Ty (PORT r)) -> Type where IsSafe : (flow : Safe dl dr) -> (sens : Sensitivity.Compatible sl sr) -> (wtype : WireType.Compatible wl wr) -> (dtype : Data.Compatible tl tr) -> Port.Compatible (TyPort l dl sl wl tl ul) (TyPort r dr sr wr tr ur) directionUnsafe : (Safe dir x -> Void) -> Compatible (TyPort l dir sense wty type usage) (TyPort r x y z t w) -> Void directionUnsafe contra (IsSafe flow sens wtype dtype) = contra flow sensitivityInCompatible : (Compatible sense y -> Void) -> Compatible (TyPort l dir sense wty type usage) (TyPort r x y z t w) -> Void sensitivityInCompatible contra (IsSafe flow sens wtype dtype) = contra sens wireTypesInCompatible : (Compatible wty z -> Void) -> Compatible (TyPort l dir sense wty type usage) (TyPort r x y z t w) -> Void wireTypesInCompatible contra (IsSafe flow sens wtype dtype) = contra wtype dataTypeInCompatible : (Compatible type t -> Void) -> Compatible (TyPort l dir sense wty type usage) (TyPort r x y z t w) -> Void dataTypeInCompatible contra (IsSafe flow sens wtype dtype) = contra dtype public export data Error = InCompatSensitivity Sensitivity.Error | InCompatDirection Direction.Safe.Error | InCompatWTypes Wire.Error | InCompatDTypes Data.Error export compatible : (left : Ty (PORT l)) -> (right : Ty (PORT r)) -> DecInfo Port.Error (Compatible left right) compatible (TyPort l dx sx wx tx ux) (TyPort r dy sy wy ty uy) with (safe dx dy) compatible (TyPort l dx sx wx tx ux) (TyPort r dy sy wy ty uy) | (Yes prfD) with (compatible sx sy) compatible (TyPort l dx sx wx tx ux) (TyPort r dy sy wy ty uy) | (Yes prfD) | (Yes prfS) with (compatible wx wy) compatible (TyPort l dx sx wx tx ux) (TyPort r dy sy wy ty uy) | (Yes prfD) | (Yes prfS) | (Yes prfW) with (compatible tx ty) compatible (TyPort l dx sx wx tx ux) (TyPort r dy sy wy ty uy) | (Yes prfD) | (Yes prfS) | (Yes prfW) | (Yes prfT) = Yes (IsSafe prfD prfS prfW prfT) compatible (TyPort l dx sx wx tx ux) (TyPort r dy sy wy ty uy) | (Yes prfD) | (Yes prfS) | (Yes prfW) | (No msg contra) = No (InCompatDTypes msg) (dataTypeInCompatible contra) compatible (TyPort l dx sx wx tx ux) (TyPort r dy sy wy ty uy) | (Yes prfD) | (Yes prfS) | (No msg contra) = No (InCompatWTypes msg) (wireTypesInCompatible contra) compatible (TyPort l dx sx wx tx ux) (TyPort r dy sy wy ty uy) | (Yes prfD) | (No msg contra) = No (InCompatSensitivity msg) (sensitivityInCompatible contra) compatible (TyPort l dx sx wx tx ux) (TyPort r dy sy wy ty uy) | (No msg contra) = No (InCompatDirection msg) (directionUnsafe contra) namespace Fanout namespace PortList public export data Compatible : (input : Ty (PORT s)) -> (fan : DVect String (Ty . PORT) n names) -> Type where Empty : PortList.Compatible i Nil Cons : {x : Ty (PORT s)} -> {rest : DVect String (Ty . PORT) n names} -> Port.Compatible i x -> PortList.Compatible i rest -> PortList.Compatible i (x::rest) headNotCompat : {xs : DVect String (Ty . PORT) n names} -> (Port.Compatible i x -> Void) -> PortList.Compatible i (x `DVect.(::)` xs) -> Void headNotCompat contra (Cons prf rest) = contra prf restNotCompat : {xs : DVect String (Ty . PORT) n names} -> (Compatible i xs -> Void) -> Compatible i (x `DVect.(::)` xs) -> Void restNotCompat contra (Cons prf rest) = contra rest public export data Error = PListError Nat (Ty (PORT s)) Port.Error export compatible : (input : Ty (PORT s)) -> (ports : DVect String (Ty . PORT) n names) -> DecInfo PortList.Error (PortList.Compatible input ports) compatible i Nil = Yes Empty compatible i (x :: xs) with (compatible i x) compatible i (x :: xs) | (Yes prfX) with (compatible i xs) compatible i (x :: xs) | (Yes prfX) | Yes prfXs = Yes (Cons prfX prfXs) compatible i (x :: xs) | (Yes prfX) | (No (PListError pos y err) contra) = No (PListError (S pos) y err) (restNotCompat contra) compatible i (x :: xs) | (No msg contra) = No (PListError Z x msg) (headNotCompat contra) public export data Compatible : (input : Ty (PORT s)) -> (fan : DVect String (Ty . PORT) (S (S n)) names) -> Type where CompatFanout : PortList.Compatible input fan -> Compatible input fan notCompatFanout : (PortList.Compatible input (x :: (y :: fan)) -> Void) -> Fanout.Compatible input (x :: (y :: fan)) -> Void notCompatFanout contra (CompatFanout prf) = contra prf export compatible : (input : Ty (PORT s)) -> (fan : DVect String (Ty . PORT) (S (S n)) names) -> DecInfo PortList.Error (Fanout.Compatible input fan) compatible input (x::y::fan) with (PortList.compatible input (x::y::fan)) compatible input (x::y::fan) | Yes prf = Yes (CompatFanout prf) compatible input (x::y::fan) | No msg contra = No msg (notCompatFanout contra) namespace Mux public export data Error = CtrlNotSafe (Ty (PORT s)) Port.Error | MuxNotSafe (PortList.Error) namespace PortList public export data Compatible : (ports : DVect String (Ty . PORT) n names) -> (o : Ty (PORT s)) -> Type where Empty : Compatible Nil o Cons : {x : Ty (PORT s)} -> {rest : DVect String (Ty . PORT) n names} -> Port.Compatible x o -> PortList.Compatible rest o -> PortList.Compatible (x::rest) o headNotCompat : {xs : DVect String (Ty . PORT) n names} -> (Port.Compatible x o -> Void) -> PortList.Compatible (x `DVect.(::)` xs) o -> Void headNotCompat contra (Cons prf rest) = contra prf restNotCompat : {xs : DVect String (Ty . PORT) n names} -> (Compatible xs o -> Void) -> Compatible (x `DVect.(::)` xs) o -> Void restNotCompat contra (Cons prf rest) = contra rest export compatible : (ports : DVect String (Ty . PORT) n names) -> (o : Ty (PORT s)) -> DecInfo PortList.Error (PortList.Compatible ports o) compatible Nil o = Yes Empty compatible (x :: xs) o with (compatible x o) compatible (x :: xs) o | (Yes prfX) with (compatible xs o) compatible (x :: xs) o | (Yes prfX) | Yes prfXs = Yes (Cons prfX prfXs) compatible (x :: xs) o | (Yes prfX) | (No (PListError pos y err) contra) = No (PListError (S pos) y err) (restNotCompat contra) compatible (x :: xs) o | (No msg contra) = No (PListError Z x msg) (headNotCompat contra) namespace Fanin public export data Compatible : (fan : DVect String (Ty . PORT) (S (S n)) names) -> (output : Ty (PORT s)) -> Type where CompatFanin : PortList.Compatible fan output -> Compatible fan output notCompatFanin : (PortList.Compatible (x :: (y :: fan)) output -> Void) -> Fanin.Compatible (x :: (y :: fan)) output -> Void notCompatFanin contra (CompatFanin prf) = contra prf export compatible : (fan : DVect String (Ty . PORT) (S (S n)) names) -> (output : Ty (PORT s)) -> DecInfo PortList.Error (Fanin.Compatible fan output) compatible (x::y::fan) output with (PortList.compatible (x::y::fan) output) compatible (x::y::fan) output | Yes prf = Yes (CompatFanin prf) compatible (x::y::fan) output | No msg contra = No msg (notCompatFanin contra) public export data Compatible : (fan : DVect String (Ty . PORT) (S (S n)) names) -> (ctrl : Ty (PORT c)) -> (output : Ty (PORT o)) -> Type where CompatMux : (fan : DVect String (Ty . PORT) (S (S n)) names) -> (ctrl : Ty (PORT c)) -> (out : Ty (PORT o)) -> (safeCTRL : Port.Compatible ctrl (Control.mkDual ctrl)) -> (safeFanIn : Fanin.Compatible fan out) -> Compatible fan ctrl out faninNotCompat : (Fanin.Compatible fan output -> Void) -> Compatible fan ctrl output -> Void faninNotCompat contra (CompatMux f c o prfCtrl prfFanin) = contra prfFanin ctrlNotCompat : {fan : DVect String (Ty . PORT) (S (S n)) names} -> (Port.Compatible ctrl (Control.mkDual ctrl) -> Void) -> Compatible fan ctrl output -> Void ctrlNotCompat contra (CompatMux f c o prfCtrl prfFanin) = contra prfCtrl export compatible : (fanin : DVect String (Ty . PORT) (S (S n)) names) -> (ctrl : Ty (PORT c)) -> (output : Ty (PORT o)) -> DecInfo Mux.Error (Compatible fanin ctrl output) compatible fan ctrl output with (Fanin.compatible fan output) compatible fan ctrl output | (Yes prfFan) with (compatible ctrl (Control.mkDual ctrl)) compatible fan ctrl output | (Yes prfFan) | Yes prfCtrl = Yes (CompatMux fan ctrl output prfCtrl prfFan) compatible fan ctrl output | (Yes prfFan) | No msg contra = No (CtrlNotSafe (Control.mkDual ctrl) msg) (ctrlNotCompat contra) compatible fan ctrl output | No msg contra = No (MuxNotSafe msg) (faninNotCompat contra) -- [ EOF ]
\section{Company} \label{sec:company}