Datasets:
AI4M
/

text
stringlengths
0
3.34M
module _ where open import Agda.Builtin.Reflection renaming (bindTC to _>>=_) open import Agda.Builtin.Equality open import Agda.Builtin.String macro m : Name → Term → TC _ m f hole = do ty ← getType f ty ← normalise ty quoteTC ty >>= unify hole open import Agda.Builtin.Nat import Agda.Builtin.Nat as Nat₁ renaming (Nat to Hombre) import Agda.Builtin.Nat as Nat₂ renaming (Nat to ℕumber) import Agda.Builtin.Nat as Nat₃ renaming (Nat to n) import Agda.Builtin.Nat as Nat₄ renaming (Nat to N) infix 0 _∋_ _∋_ : (A : Set) → A → A A ∋ x = x binderName : Term → String binderName (pi _ (abs x _)) = x binderName _ = "(no binder)" f₁ : Nat₁.Hombre → Nat f₁ x = x f₂ : Nat₂.ℕumber → Nat f₂ x = x f₃ : Nat₃.n → Nat f₃ x = x f₄ : Nat₄.N → Nat f₄ x = x _ = binderName (m f₁) ≡ "h" ∋ refl _ = binderName (m f₂) ≡ "z" ∋ refl -- Can't toLower ℕ _ = binderName (m f₃) ≡ "z" ∋ refl -- Single lower case type name, don't pick same name for binder _ = binderName (m f₄) ≡ "n" ∋ refl
module IR.Event import IR.Lens KeyCode : Type KeyCode = Int record Key : Type where MkKey : (keyCode : KeyCode) -> (keyHasAlt : Bool) -> (keyHasCmd : Bool) -> (keyHasCtrl : Bool) -> (keyHasShift : Bool) -> Key instance Eq Key where (==) (MkKey a b c d e) (MkKey a' b' c' d' e') = a == a' && b == b' && c == c' && d == d' && e == e' -- Should be the Monoid instance: infixl 3 <!> (<!>) : Ordering -> Ordering -> Ordering (<!>) EQ r = r (<!>) l r = l -- Should be the Ord instance: compareBool : Bool -> Bool -> Ordering compareBool False False = EQ compareBool False True = LT compareBool True False = GT compareBool True True = EQ instance Ord Key where compare (MkKey a b c d e) (MkKey a' b' c' d' e') = compare a a' <!> compareBool b b' <!> compareBool c c' <!> compareBool d d' <!> compareBool e e' keyCode' : Lens Key KeyCode keyCode' = lens (\(MkKey x _ _ _ _) => x) (\x, (MkKey _ a b c d) => MkKey x a b c d) keyHasAlt' : Lens Key Bool keyHasAlt' = lens (\(MkKey _ x _ _ _) => x) (\x, (MkKey a _ b c d) => MkKey a x b c d) keyHasCmd' : Lens Key Bool keyHasCmd' = lens (\(MkKey _ _ x _ _) => x) (\x, (MkKey a b _ c d) => MkKey a b x c d) keyHasCtrl' : Lens Key Bool keyHasCtrl' = lens (\(MkKey _ _ _ x _) => x) (\x, (MkKey a b c _ d) => MkKey a b c x d) keyHasShift' : Lens Key Bool keyHasShift' = lens (\(MkKey _ _ _ _ x) => x) (\x, (MkKey a b c d _) => MkKey a b c d x) data Event = KeyEvent Key | RefreshEvent | IgnoredEvent eventFromPtr : Ptr -> IO Event eventFromPtr p = do t <- mkForeign (FFun "irEventType" [FPtr] FInt) p c <- mkForeign (FFun "irEventKeyCode" [FPtr] FInt) p alt <- map (/= 0) (mkForeign (FFun "irEventKeyAlternate" [FPtr] FInt) p) cmd <- map (/= 0) (mkForeign (FFun "irEventKeyCommand" [FPtr] FInt) p) ctrl <- map (/= 0) (mkForeign (FFun "irEventKeyControl" [FPtr] FInt) p) shift <- map (/= 0) (mkForeign (FFun "irEventKeyShift" [FPtr] FInt) p) mkForeign (FFun "irEventFree" [FPtr] FUnit) p return (case t of 0 => KeyEvent (MkKey c alt cmd ctrl shift) 1 => RefreshEvent _ => IgnoredEvent)
What does "Put an Eyeball To" mean? If you hear a truck driver say "Put an Eyeball To" on their CB radio, it's just another way to say "To look at something." There are hundreds of other popular CB slang phrases - to learn more, check out the links below or browse the rest of our online CB slang dictionary.
/** * @file batchf_zdotu_sub.c * * Part of API test for Batched BLAS routines. * * @author Samuel D. Relton * @author Pedro V. Lara * @author Mawussi Zounon * @date * * @precisions normal z -> c * **/ #include <cblas.h> #include "bblas.h" #define COMPLEX void batchf_zdotu_sub( const int n, BBLAS_Complex64_t const * const * x, const int incx, BBLAS_Complex64_t const * const * y, const int incy, BBLAS_Complex64_t *dotu, const int batch_count, int *info) { /* Local variables */ int first_index = 0; int batch_iter = 0; char func_name[15] = "batchf_zdotu"; /*initialize the result */ for (batch_iter = 0; batch_iter < batch_count; batch_iter++) { dotu[batch_iter] = (BBLAS_Complex64_t)0.0; } /* Check input arguments */ if (batch_count < 0) { xerbla_batch(func_name, BBLAS_ERR_BATCH_COUNT, -1); } if (n < 0) { xerbla_batch(func_name, BBLAS_ERR_N, first_index); info[first_index] = BBLAS_ERR_N; } if (incx < 1) { xerbla_batch(func_name, BBLAS_ERR_INCX, first_index); info[first_index] = BBLAS_ERR_INCX; } if (incy < 1) { xerbla_batch(func_name, BBLAS_ERR_INCY, first_index); info[first_index] = BBLAS_ERR_INCY; } /* Call CBLAS */ for (batch_iter = 0; batch_iter < batch_count; batch_iter++) { cblas_zdotu_sub( n, (void *)x[batch_iter], incx, (void *)y[batch_iter], incy, &dotu[batch_iter]); /* Successful */ } /* End fixed size for loop */ info[first_index] = BBLAS_SUCCESS; } #undef COMPLEX
# load library library(plotly) library(dplyr) # the function takes a dataframe and colorvar as variable # and returns a barchart listing top 100 donation to specific candidate BuildBarchart <- function(map.df, colorvar, candidate.name) { # margin setting m <- list(l = 50, r = 50, b = 280, t = 100, pad = 4) # use string name as variable name # chart 1: barchart # arrange bar with total contribution desc map.df$name <- factor(map.df$name, levels = map.df$name[order(map.df$total,decreasing = TRUE)]) # build barchart with hover text of organization name, industry and total donation bar <- map.df %>% plot_ly(x = ~name, y = ~total, type = 'bar', color = eval(parse(text = colorvar)), width = 1200, height = 1000, text = ~paste0('Organization: ', name, '<br>', 'Industry: ', industry, '<br>', '$', total)) %>% layout(margin = m, autosize = F, title = paste0('Top 100 Contributions to ', candidate.name)) return(bar) } # chart 2: map # the function takes dataframe as variable # and returns a map showing where are the top 100 donations coming from BuildMap <- function(map.df) { # geo setting g <- list( scope = 'usa', projection = list(type = 'albers usa'), showland = TRUE, landcolor = toRGB("gray95"), subunitcolor = toRGB("gray85"), countrycolor = toRGB("gray85"), countrywidth = 0.5, subunitwidth = 0.5 ) # build map with color bar showing the number of contribution map <- map.df %>% plot_geo(lat = ~Latitude, lon = ~Longitude) %>% add_markers( hoverinfo = 'text', size = ~total, color = ~total, opacity = 0.8, text = ~paste0(name, ' <br>', industry, ' <br> ', '# of records' ,records, ' <br> ', '$',total)) %>% layout(title = 'Location of Top 100 Contribution<br />(Hover for details)', geo = g) return(map) } # chart 3: pie chart # this function takes a dataframe as variable # and returns a pie chart showing the parcentage of each industry's contribution BuildPie <- function(pie.df) { # build piechart pie <- pie.df %>% plot_ly(labels = ~industry, values = ~percent, type = 'pie', textposition = 'inside', textinfo = 'label+percent', hoverinfo = 'text', text = ~paste0(industry, ' <br>', '$', total), width = 800, height = 800) %>% layout(title = 'Percentage of Industry Contribution') return(pie) }
= Weather buoy =
[STATEMENT] lemma convex_hull_affinity: "convex hull ((\<lambda>x. a + c *\<^sub>R x) ` S) = (\<lambda>x. a + c *\<^sub>R x) ` (convex hull S)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. convex hull (\<lambda>x. a + c *\<^sub>R x) ` S = (\<lambda>x. a + c *\<^sub>R x) ` (convex hull S) [PROOF STEP] by (metis convex_hull_scaling convex_hull_translation image_image)
```python import numpy as np import scipy as sc import random as rand from sklearn import preprocessing, linear_model import matplotlib.pyplot as plt from core.controllers import PDController from core.dynamics import LinearSystemDynamics, ConfigurationDynamics from koopman_core.controllers import OpenLoopController, MPCController,BilinearFBLinController, PerturbedController, LinearLiftedController from koopman_core.dynamics import LinearLiftedDynamics, BilinearLiftedDynamics from koopman_core.learning import Edmd, BilinearEdmd from koopman_core.basis_functions import PlanarQuadBasis from koopman_core.learning.utils import differentiate_vec from koopman_core.systems import PlanarQuadrotorForceInput class QuadrotorPdOutput(ConfigurationDynamics): def __init__(self, dynamics, xd, t_d, n, m): ConfigurationDynamics.__init__(self, dynamics, 1) self.xd = xd self.t_d = t_d self.xd_dot = differentiate_vec(self.xd, self.t_d) self.n = n self.m = m def proportional(self, x, t): q, q_dot = x[:int(n/2)], x[int(n/2):] return self.y(q) - self.y_d(t) def derivative(self, x, t): q, q_dot = x[:int(n/2)], x[int(n/2):] return self.dydq(q)@q_dot - self.y_d_dot(t) def y(self, q): return q def dydq(self, q): return np.eye(int(self.n/2)) def d2ydq2(self, q): return np.zeros((int(self.n/2), int(self.n/2), int(self.n/2))) def y_d(self, t): return self.desired_state_(t)[:int(self.n/2)] def y_d_dot(self, t): return self.desired_state_(t)[int(self.n/2):] def y_d_ddot(self, t): return self.desired_state_dot_(t)[int(self.n/2):] def desired_state_(self, t): return [np.interp(t, self.t_d.flatten(),self.xd[:,ii].flatten()) for ii in range(self.xd.shape[1])] def desired_state_dot_(self, t): return [np.interp(t, self.t_d.flatten(),self.xd_dot[:,ii].flatten()) for ii in range(self.xd_dot.shape[1])] class PlanarQuadrotorForceInputDiscrete(PlanarQuadrotorForceInput): def __init__(self, mass, inertia, prop_arm, g=9.81, dt=1e-2): PlanarQuadrotorForceInput.__init__(self, mass, inertia, prop_arm, g=g) self.dt=dt def eval_dot(self, x, u, t): return x + self.dt*self.drift(x, t) + self.dt*np.dot(self.act(x, t),u) def get_linearization(self, x0, x1, u0, t): m, J, b, g = self.params A_lin = np.eye(self.n) + self.dt*np.array([[0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 1], [0, 0, -(1/m)*np.cos(x0[2])*u0[0] -(1/m)*np.cos(x0[2])*u0[1], 0, 0, 0], [0, 0, -(1/m)*np.sin(x0[2])*u0[0] -(1/m)*np.sin(x0[2])*u0[1], 0, 0, 0], [0, 0, 0, 0, 0, 0],]) B_lin = self.dt*np.array([[0, 0], [0, 0], [0, 0], [-(1/m)*np.sin(x0[2]), -(1/m)*np.sin(x0[2])], [(1/m)*np.cos(x0[2]), (1/m)*np.cos(x0[2])], [-b/J, b/J]]) if x1 is None: x1 = A_lin@x0 + B_lin@u0 f_d = self.eval_dot(x0,u0,t) r_lin = f_d - x1 return A_lin, B_lin, r_lin ``` /Users/carlaxelfolkestad/opt/anaconda3/envs/crazyswarm/lib/python3.8/site-packages/ray/autoscaler/_private/cli_logger.py:57: FutureWarning: Not all Ray CLI dependencies were found. In Ray 1.4+, the Ray CLI, autoscaler, and dashboard will only be usable via `pip install 'ray[default]'`. Please update your install command. warnings.warn( ## Planar Quadrotor Example Consider a planar quadrotor with states $\mathbf{x} = [y \, z \, \theta \, \dot{y} \, \dot{z} \, \dot{\theta}]^T$ and continuous-time dynamics \begin{equation} \begin{bmatrix} \ddot{y} \\ \ddot{z} \\ \ddot{\theta} \end{bmatrix} = \begin{bmatrix} 0\\-g\\0 \end{bmatrix} + \begin{bmatrix} -\frac{1}{m}\text{sin}\theta & -\frac{1}{m}\text{sin}\theta\\ \frac{1}{m}\text{cos}\theta & \frac{1}{m}\text{cos}\theta\\ -\frac{l_{arm}}{I_{xx}} & \frac{l_{arm}}{I_{xx}} \end{bmatrix} \begin{bmatrix} T_1 \\ T_2 \end{bmatrix} \end{equation} where $y,z$ describe the position of the vehicle in a fixed reference frame, $\theta$ is the orientation of the vehicle, $T_1, T_2$ are the thrust from each of the propellers, $g$ is the gravitational acceleration, $m$ is the vehicle mass, $l_{arm}$ is the distance from the vehicle's center of mass to the center of the propeller, and $I_{xx}$ is the inertia around the x-axis. ```python # Cart pole system parameters mass = 2. inertia = 1. prop_arm = 0.2 gravity = 9.81 quadrotor = PlanarQuadrotorForceInput(mass, inertia, prop_arm, g=gravity) # Linearized system specification: n, m = 6, 2 # Number of states, number of control inputs A_nom = np.array([[0., 0., 0., 1., 0., 0.], # Linearization of the true system around the origin [0., 0., 0., 0., 1., 0.], [0., 0., 0., 0., 0., 1.], [0., 0., -gravity, 0., 0., 0.], [0., 0., 0., 0., 0., 0.], [0., 0., 0., 0., 0., 0.]]) B_nom = np.array([[0., 0.], # Linearization of the true system around the origin [0., 0.], [0., 0.], [0., 0.], [1./mass, 1./mass], [-prop_arm/inertia, prop_arm/inertia]]) hover_thrust = mass*gravity/m ``` ### Collect data for learning To collect data, a nominal controller is designed with LQR on the dynamics's linearization around hover. However, any controller can be used and the method does not require the knowledge of model's linearization. In addition, a exploratory white noise is added to the controller to ensure that the data is sufficiently excited. Note that the system is underactuated and that trajectory optimization is necessary to control the position of the vehicle. We use a simplified trajectory generator based on a model predictive controller for the linearized dynamics. More careful design of the desired trajectory may be necessary for more demanding applications and this is readily compatible with our method. ```python q_dc, r_dc = 5e2, 1 # State and actuation penalty values, data collection Q_dc = q_dc * np.identity(n) # State penalty matrix, data collection R_dc = r_dc*np.identity(m) # Actuation penalty matrix, data collection P_dc = sc.linalg.solve_continuous_are(A_nom, B_nom, Q_dc, R_dc) # Algebraic Ricatti equation solution, data collection K_dc = np.linalg.inv(R_dc)@B_nom.T@P_dc # LQR feedback gain matrix, data collection K_dc_p = K_dc[:,:int(n/2)] # Proportional control gains, data collection K_dc_d = K_dc[:,int(n/2):] # Derivative control gains, data collection nominal_sys = LinearLiftedDynamics(A_nom, B_nom, np.eye(n), lambda x: x) # Data collection parameters: dt = 1.0e-2 # Time step length traj_length_dc = 2. # Trajectory length, data collection n_pred_dc = int(traj_length_dc/dt) # Number of time steps, data collection t_eval = dt * np.arange(n_pred_dc + 1) # Simulation time points n_traj_dc = 100 # Number of trajectories to execute, data collection noise_var = 5. # Exploration noise to perturb controller, data collection xmax = np.array([2, 2, np.pi/3, 2.,2.,2.]) # State constraints, trajectory generation xmin = -xmax umax = np.array([2*hover_thrust, 2*hover_thrust]) - hover_thrust # Actuation constraint, trajectory generation umin = np.array([0., 0.]) - hover_thrust x0_max = np.array([xmax[0], xmax[1], xmax[2], 1., 1., 1.]) # Initial value limits Q_trajgen = sc.sparse.diags([0,0,0,0,0,0]) # State penalty matrix, trajectory generation QN_trajgen = sc.sparse.diags([5e1,5e1,5e1,1e1,1e1,1e1]) # Final state penalty matrix, trajectory generation R_trajgen = sc.sparse.eye(m) # Actuation penalty matrix, trajectory generation sub_sample_rate = 1 # Rate to subsample data for training model_fname = 'examples/planar_quad_models' # Path to save learned models n_cols = 10 # Number of columns in training data plot save_figures = False dropbox_folder = '/Users/carlaxelfolkestad/Dropbox/Apps/Overleaf/Koopman NMPC (ICRA21)/' ``` ```python xd = np.empty((n_traj_dc, n_pred_dc + 1, n)) xs = np.empty((n_traj_dc, n_pred_dc + 1, n)) us = np.empty((n_traj_dc, n_pred_dc, m)) plt.figure(figsize=(12, 12 * n_traj_dc / (n_cols ** 2))) for ii in range(n_traj_dc): x0 = np.asarray([rand.uniform(l, u) for l, u in zip(-x0_max, x0_max)]) set_pt_dc = np.asarray([rand.uniform(l, u) for l, u in zip(-x0_max, x0_max)]) mpc_trajgen = MPCController(nominal_sys, n_pred_dc, dt, umin, umax, xmin, xmax, QN_trajgen, R_trajgen, QN_trajgen, set_pt_dc) mpc_trajgen.eval(x0, 0) xd[ii, :, :] = mpc_trajgen.parse_result().T while np.linalg.norm(x0[:3] - set_pt_dc[:3]) < 2 or np.any(np.isnan(xd[ii, :, :])): x0 = np.asarray([rand.uniform(l, u) for l, u in zip(-x0_max, x0_max)]) set_pt_dc = np.asarray([rand.uniform(l, u) for l, u in zip(-x0_max, x0_max)]) mpc_trajgen = MPCController(nominal_sys, n_pred_dc, dt, umin, umax, xmin, xmax, QN_trajgen, R_trajgen, QN_trajgen, set_pt_dc) mpc_trajgen.eval(x0, 0) xd[ii, :, :] = mpc_trajgen.parse_result().T output = QuadrotorPdOutput(quadrotor, xd[ii, :, :], t_eval, n, m) pd_controller = PDController(output, K_dc_p, K_dc_d) perturbed_pd_controller = PerturbedController(quadrotor, pd_controller, noise_var, const_offset=hover_thrust) xs[ii, :, :], us[ii, :, :] = quadrotor.simulate(x0, perturbed_pd_controller, t_eval) plt.subplot(int(np.ceil(n_traj_dc / n_cols)), n_cols, ii + 1) plt.plot(t_eval, xs[ii, :, 0], 'b', label='$y$') plt.plot(t_eval, xs[ii, :, 1], 'g', label='$z$') plt.plot(t_eval, xs[ii, :, 2], 'r', label='$\\theta$') plt.plot(t_eval, xd[ii, :, 0], '--b', label='$y_d$') plt.plot(t_eval, xd[ii, :, 1], '--g', label='$z_d$') plt.plot(t_eval, xd[ii, :, 2], '--r', label='$\\theta_d$') plt.suptitle( 'Training data \nx-axis: time (sec), y-axis: state value, $x$ - blue, $xd$ - dotted blue, $\\theta$ - red, $\\theta_d$ - dotted red', y=0.94) plt.show() ``` ### Learn a linear model with dynamic mode decomposition (DMD) To compare our method with existing techniques, we first learn a linear state space model from data. This is dubbed dynamic mode decomposition. I.e. we use linear regression with LASSO regularization to learn an approximate linear model with model structure \begin{equation} \mathbf{\dot{x}} = A_{dmd}\mathbf{x} + B_{dmd}\mathbf{u} \end{equation} ```python #DMD parameters: alpha_dmd = 9.8e-5 # Regularization strength (LASSO) DMD tune_mdl_dmd = False ``` ```python basis = lambda x: x C_dmd = np.eye(n) optimizer_dmd = linear_model.MultiTaskLasso(alpha=alpha_dmd, fit_intercept=False, selection='random') cv_dmd = linear_model.MultiTaskLassoCV(fit_intercept=False, n_jobs=-1, cv=3, selection='random') standardizer_dmd = preprocessing.StandardScaler(with_mean=False) model_dmd = Edmd(n, m, basis, n, n_traj_dc, optimizer_dmd, cv=cv_dmd, standardizer=standardizer_dmd, C=C_dmd, first_obs_const=False, continuous_mdl=False, dt=dt) xdmd, y_dmd = model_dmd.process(xs, us-hover_thrust, np.tile(t_eval,(n_traj_dc,1)), downsample_rate=sub_sample_rate) model_dmd.fit(xdmd, y_dmd, cv=tune_mdl_dmd, override_kinematics=True) sys_dmd = LinearLiftedDynamics(model_dmd.A, model_dmd.B, model_dmd.C, model_dmd.basis, continuous_mdl=False, dt=dt) if tune_mdl_dmd: print('$\\alpha$ DMD: ',model_dmd.cv.alpha_) ``` ### Learn a lifted linear model with extended dynamic mode decomposition (EDMD) In addition, we compare our method with the current state of the art of Koopman based learning, the extended dynamic mode decomposition. We use a dictionary of nonlinear functions $\boldsymbol{\phi(x)}$ to lift the state variables and learn a lifted state space model of the dynamics. I.e. we first lift and then use linear regression with LASSO regularization to learn an approximate lifted linear model with model structure \begin{equation} \mathbf{\dot{z}} = A_{edmd}\mathbf{z} + B_{edmd}\mathbf{u}, \qquad \mathbf{z} = \boldsymbol{\phi(x)} \end{equation} ```python #EDMD parameters: alpha_edmd = 2.22e-4 # Regularization strength (LASSO) EDMD tune_mdl_edmd = False ``` ```python basis = PlanarQuadBasis(n, poly_deg=3) basis.construct_basis() planar_quad_features = preprocessing.FunctionTransformer(basis.basis) planar_quad_features.fit(np.zeros((1,n))) n_lift_edmd = planar_quad_features.transform((np.zeros((1,n)))).shape[1] C_edmd = np.zeros((n,n_lift_edmd)) C_edmd[:,1:n+1] = np.eye(n) optimizer_edmd = linear_model.MultiTaskLasso(alpha=alpha_edmd, fit_intercept=False, selection='random', max_iter=2000) cv_edmd = linear_model.MultiTaskLassoCV(fit_intercept=False, n_jobs=-1, cv=3, selection='random', max_iter=2000) standardizer_edmd = preprocessing.StandardScaler(with_mean=False) model_edmd = Edmd(n, m, basis.basis, n_lift_edmd, n_traj_dc, optimizer_edmd, cv=cv_edmd, standardizer=standardizer_edmd, C=C_edmd, continuous_mdl=False, dt=dt) X_edmd, y_edmd = model_edmd.process(xs, us-hover_thrust, np.tile(t_eval,(n_traj_dc,1)), downsample_rate=sub_sample_rate) model_edmd.fit(X_edmd, y_edmd, cv=tune_mdl_edmd, override_kinematics=True) sys_edmd = LinearLiftedDynamics(model_edmd.A, model_edmd.B, model_edmd.C, model_edmd.basis, continuous_mdl=False, dt=dt) if tune_mdl_edmd: print('$\\alpha$ EDMD: ',model_edmd.cv.alpha_) ``` ### Learn a lifted bilinear model with bilinear extended mode decomposition (bEDMD) Finally, we use the method developed in the paper to learn a lifted bilinear model of the dynamics, dubbed bilinear extended mode decomposition (bEDMD). I.e. we first lift and then use linear regression with LASSO regularization to learn an approximate lifted linear model with model structure \begin{equation} \mathbf{\dot{z}}=F\mathbf{z}+\sum_{i=1}^m G_i\mathbf{z}\mathbf{u}_i, \qquad \mathbf{z} = \boldsymbol{\phi(x)} \end{equation} ```python #Bilinear EDMD parameters: alpha_bedmd = 6.9e-5 # Regularization strength (LASSO) bEDMD tune_mdl_bedmd = False ``` ```python n_lift_bedmd = n_lift_edmd C_bedmd = np.zeros((n,n_lift_bedmd)) C_bedmd[:,1:n+1] = np.eye(n) basis_bedmd = lambda x: planar_quad_features.transform(x) optimizer_bedmd = linear_model.MultiTaskLasso(alpha=alpha_bedmd, fit_intercept=False, selection='random', max_iter=1e4) cv_bedmd = linear_model.MultiTaskLassoCV(fit_intercept=False, n_jobs=-1, cv=3, selection='random') standardizer_bedmd = preprocessing.StandardScaler(with_mean=False) model_bedmd = BilinearEdmd(n, m, basis_bedmd, n_lift_bedmd, n_traj_dc, optimizer_bedmd, cv=cv_bedmd, standardizer=standardizer_bedmd, C=C_bedmd, continuous_mdl=False, dt=dt) X_bedmd, y_bedmd = model_bedmd.process(xs, us-hover_thrust, np.tile(t_eval,(n_traj_dc,1)), downsample_rate=sub_sample_rate) model_bedmd.fit(X_bedmd, y_bedmd, cv=tune_mdl_bedmd, override_kinematics=True) sys_bedmd = BilinearLiftedDynamics(model_bedmd.n_lift, m, model_bedmd.A, model_bedmd.B, model_bedmd.C, model_bedmd.basis, continuous_mdl=False, dt=dt) if tune_mdl_bedmd: print('$\\alpha$ bilinear EDMD: ', model_bedmd.cv.alpha_) ``` ### Evaluate open loop prediction performance We first evaluate the open loop prediction performance of the proposed method. This is done by generating a new data set in the same way as the training set, predicting the evolution of the system with the control sequence of each trajectory executed in the data set with each of the models, and finally comparing the mean and standard deviation of the error between the true and predicted evolution over the trajectories. The experimental results support what is to be expected from the theory as the error in the $y$ and $z$ terms are significantly lower for the bEDMD method than both DMD and EDMD. The reason for this improvement is that the bEDMD method can capture the nonlinearities present in the actuation matrix of the $(y,z)$-dynamics. ```python # Prediction performance evaluation parameters: folder_plots = 'working_files/figures/' # Path to save plots n_traj_ol = 100 # Number of trajectories to execute, open loop ``` ```python from tabulate import tabulate xs_ol = np.empty((n_traj_ol, t_eval.shape[0], n)) xs_dmd_ol = np.empty((n_traj_ol, t_eval.shape[0]-1, n)) xs_edmd_ol = np.empty((n_traj_ol, t_eval.shape[0]-1, n)) xs_bedmd_ol = np.empty((n_traj_ol, t_eval.shape[0]-1, n)) us_test = np.empty((n_traj_ol, t_eval.shape[0]-1, m)) for ii in range(n_traj_ol): x0 = np.asarray([rand.uniform(l, u) for l, u in zip(-x0_max, x0_max)]) set_pt_dc = np.asarray([rand.uniform(l, u) for l, u in zip(-x0_max, x0_max)]) mpc_trajgen = MPCController(nominal_sys, n_pred_dc, dt, umin, umax, xmin, xmax, QN_trajgen, R_trajgen, QN_trajgen, set_pt_dc) mpc_trajgen.eval(x0, 0) xd = mpc_trajgen.parse_result().T while xd[0,0] is None: x0 = np.asarray([rand.uniform(l, u) for l, u in zip(-x0_max, x0_max)]) set_pt_dc = np.asarray([rand.uniform(l, u) for l, u in zip(-x0_max, x0_max)]) mpc_trajgen = MPCController(nominal_sys, n_pred_dc, dt, umin, umax, xmin, xmax, QN_trajgen, R_trajgen, QN_trajgen, set_pt_dc) mpc_trajgen.eval(x0, 0) xd = mpc_trajgen.parse_result().T output = QuadrotorPdOutput(quadrotor, xd, t_eval, n, m) pd_controller = PDController(output, K_dc_p, K_dc_d) perturbed_pd_controller = PerturbedController(quadrotor, pd_controller, noise_var, const_offset=hover_thrust) xs_ol[ii,:,:], us_test[ii,:,:] = quadrotor.simulate(x0, perturbed_pd_controller, t_eval) ol_controller_nom = OpenLoopController(sys_bedmd, us_test[ii,:,:]-hover_thrust, t_eval[:-1]) xs_dmd_ol[ii,:,:], _ = sys_dmd.simulate(x0, ol_controller_nom, t_eval[:-1]) z_0_edmd = sys_edmd.basis(np.atleast_2d(x0)).squeeze() zs_edmd_tmp, _ = sys_edmd.simulate(z_0_edmd, ol_controller_nom, t_eval[:-1]) xs_edmd_ol[ii,:,:] = np.dot(model_edmd.C, zs_edmd_tmp.T).T z_0_bedmd = sys_bedmd.basis(np.atleast_2d(x0)).squeeze() zs_bedmd_tmp, _ = sys_bedmd.simulate(z_0_bedmd, ol_controller_nom, t_eval[:-1]) xs_bedmd_ol[ii,:,:] = np.dot(model_bedmd.C, zs_bedmd_tmp.T).T error_dmd = xs_ol[:,:-1,:] - xs_dmd_ol error_dmd_mean = np.mean(error_dmd, axis=0).T error_dmd_std = np.std(error_dmd, axis=0).T mse_dmd = np.mean(np.square(error_dmd)) std_dmd = np.std(error_dmd) error_edmd = xs_ol[:,:-1,:] - xs_edmd_ol error_edmd_mean = np.mean(error_edmd, axis=0).T error_edmd_std = np.std(error_edmd, axis=0).T mse_edmd = np.mean(np.square(error_edmd)) std_edmd = np.std(error_edmd) error_bedmd = xs_ol[:,:-1,:] - xs_bedmd_ol error_bedmd_mean = np.mean(error_bedmd, axis=0).T error_bedmd_std = np.std(error_bedmd, axis=0).T mse_bedmd = np.mean(np.square(error_bedmd)) std_bedmd = np.std(error_bedmd) print('\nOpen loop performance statistics:\n') print(tabulate([['DMD', "{:.5f}".format(mse_dmd), '-', '-', "{:.5f}".format(std_dmd), '-', '-'], ['EDMD', "{:.5f}".format(mse_edmd), "{:.2f}".format((1 - mse_edmd / mse_dmd) * 100)+' %', '-', "{:.5f}".format(std_edmd), "{:.2f}".format((1 - std_edmd / std_dmd) * 100)+' %', '-'], ['bEDMD', "{:.5f}".format(mse_bedmd), "{:.2f}".format((1 - mse_bedmd / mse_dmd) * 100)+' %', "{:.2f}".format((1 - mse_bedmd / mse_edmd) * 100)+' %', "{:.5f}".format(std_bedmd), "{:.2f}".format((1 - std_bedmd / std_dmd) * 100)+' %', "{:.2f}".format((1 - std_bedmd / std_edmd) * 100)+' %']], headers=['MSE', 'MSE improvement\nover DMD', 'MSE improvement\nover EDMD', 'Standard\ndeviation', 'std improvement\nover DMD', 'std improvement\nover EDMD'])) ``` Open loop performance statistics: MSE MSE improvement MSE improvement Standard std improvement std improvement over DMD over EDMD deviation over DMD over EDMD ----- ------- ----------------- ----------------- ----------- ----------------- ----------------- DMD 0.0944 - - 0.29415 - - EDMD 0.06139 34.97 % - 0.24754 15.85 % - bEDMD 0.00241 97.45 % 96.08 % 0.04893 83.37 % 80.23 % ```python import matplotlib.pyplot as plt import matplotlib figwidth = 12 lw = 2 fs = 16 y_lim_gain = 1.2 #Plot open loop results: ylabels = ['$e_{y}$', '$e_z$', '$e_{\\theta}$'] plt.figure(figsize=(figwidth,3)) for ii in range(3): plt.subplot(1,3,ii+1) plt.plot(t_eval[:-1], error_dmd_mean[ii,:], linewidth=lw, label='DMD') plt.fill_between(t_eval[:-1], error_dmd_mean[ii,:] - error_dmd_std[ii,:], error_dmd_mean[ii,:] + error_dmd_std[ii,:], alpha=0.2) plt.plot(t_eval[:-1], error_edmd_mean[ii, :], linewidth=lw, label='EDMD') plt.fill_between(t_eval[:-1], error_edmd_mean[ii, :] - error_edmd_std[ii, :],error_edmd_mean[ii, :] + error_edmd_std[ii, :], alpha=0.2) plt.plot(t_eval[:-1], error_bedmd_mean[ii, :], linewidth=lw, label='bEDMD') plt.fill_between(t_eval[:-1], error_bedmd_mean[ii, :] - error_bedmd_std[ii, :],error_bedmd_mean[ii, :] + error_bedmd_std[ii, :], alpha=0.2) ylim = max(max(np.abs(error_bedmd_mean[ii, :] - error_bedmd_std[ii, :])), max(np.abs(error_bedmd_mean[ii, :] + error_bedmd_std[ii, :]))) plt.ylim([-ylim * y_lim_gain, ylim * y_lim_gain]) plt.xlabel('$t$ (sec)', fontsize=fs) plt.ylabel(ylabels[ii], fontsize=fs) plt.legend(loc='upper left', fontsize=fs-4) suptitle = plt.suptitle('Open loop prediction error of DMD, EDMD and bilinear EDMD models', y=1.05, fontsize=18) matplotlib.rcParams['pdf.fonttype'] = 42 matplotlib.rcParams['ps.fonttype'] = 42 plt.tight_layout() plt.savefig(folder_plots + 'planar_quad_prediction.pdf', format='pdf', dpi=2400, bbox_extra_artists=(suptitle,), bbox_inches="tight") plt.show() ``` # Design trajectories based on learned models We now study the closed loop performance of the control design. ```python solver_settings = {} solver_settings['gen_embedded_ctrl'] = False solver_settings['warm_start'] = True solver_settings['polish'] = True solver_settings['polish_refine_iter'] = 3 solver_settings['scaling'] = True solver_settings['adaptive_rho'] = False solver_settings['check_termination'] = 25 solver_settings['max_iter'] = 4000 solver_settings['eps_abs'] = 1e-6 solver_settings['eps_rel'] = 1e-6 solver_settings['eps_prim_inf'] = 1e-4 solver_settings['eps_dual_inf'] = 1e-4 solver_settings['linsys_solver'] = 'qdldl' ``` ```python #Closed loop performance evaluation parameters: traj_length=250 t_eval = dt * np.arange(traj_length+1) # Simulation time points, closed loop Q_mpc = sc.sparse.diags([0,0,0,0,0,0]) # State penalty matrix, trajectory generation QN_mpc = sc.sparse.diags([1e5,1e5,1e5,1e5,1e5,1e5]) # Final state penalty matrix, trajectory generation R_mpc = sc.sparse.eye(m) # Actuation penalty matrix, trajectory generation ctrl_offset = np.array([[hover_thrust], [hover_thrust]]) # Design trajectory: x0_cl = np.array([-0.8, 0.1, 0.1, -0.3, -0.2, 0.15]) # Initial value, closed loop trajectory set_pt_cl = np.array([1.9, 1.2, 0., 0., 0., 0.]) # Desired final value, closed loop trajectory xmax = np.array([2, 2, np.pi/3, 2.,2.,2.]) # State constraints, trajectory generation xmin = -xmax term_constraint=False # Define initial solution for SQP algorithm: x_init = np.linspace(x0_cl, set_pt_cl, int(traj_length)+1) u_init = np.zeros((m,traj_length)).T ``` #### Design controllers for learned DMD, EDMD, and bEDMD models ```python from koopman_core.controllers import MPCController, NonlinearMPCControllerNb, BilinearMPCControllerNb # Define DMD-based controller: controller_dmd = MPCController(sys_dmd, traj_length, dt, umin, umax, xmin, xmax, Q_mpc, R_mpc, QN_mpc, set_pt_cl, terminal_constraint=term_constraint, const_offset=ctrl_offset.squeeze()) # Define EDMD-based controller: controller_edmd = MPCController(sys_edmd, traj_length, dt, umin, umax, xmin, xmax, Q_mpc, R_mpc, QN_mpc, set_pt_cl, terminal_constraint=term_constraint, const_offset=ctrl_offset.squeeze()) # Define bEDMD-based controller: controller_bedmd = BilinearMPCControllerNb(sys_bedmd, traj_length, dt, umin, umax, xmin, xmax, Q_mpc, R_mpc, QN_mpc, set_pt_cl, solver_settings, terminal_constraint=term_constraint, const_offset=ctrl_offset) z0_cl = sys_bedmd.basis(x0_cl.reshape((1,-1))).squeeze() z_init = sys_bedmd.basis(x_init) controller_bedmd.construct_controller(z_init, u_init) ``` #### Design controller using full knowledge of nonlinear controller ```python quadrotor_d = PlanarQuadrotorForceInputDiscrete(mass, inertia, prop_arm, g=gravity, dt=dt) controller_nmpc = NonlinearMPCControllerNb(quadrotor_d, traj_length, dt, umin+hover_thrust, umax+hover_thrust, xmin, xmax, Q_mpc, R_mpc, QN_mpc, set_pt_cl, solver_settings, terminal_constraint=term_constraint) controller_nmpc.construct_controller(x_init, u_init+hover_thrust) ``` #### Design trajectories with the contructed MPCs ```python max_iter = 100 controller_dmd.eval(x0_cl, 0) xr_dmd = controller_dmd.parse_result() ur_dmd = controller_dmd.get_control_prediction() + hover_thrust controller_edmd.eval(x0_cl, 0) xr_edmd = sys_edmd.C@controller_edmd.parse_result() ur_edmd = controller_edmd.get_control_prediction() + hover_thrust controller_bedmd.solve_to_convergence(z0_cl, 0., z_init, u_init, max_iter=max_iter) xr_bedmd = sys_bedmd.C@controller_bedmd.get_state_prediction().T ur_bedmd = controller_bedmd.get_control_prediction().T + hover_thrust ``` /Users/carlaxelfolkestad/Coding_projects/koopman_learning_and_control/koopman_core/controllers/bilinear_mpc_controller_numba.py:14: NumbaPerformanceWarning: np.dot() is faster on contiguous arrays, called on (array(float64, 1d, C), array(float64, 2d, A)) r_vec[i, :] = np.dot(z_init[i, :], A_reshaped[i*nx:(i+1)*nx, :]) /Users/carlaxelfolkestad/Coding_projects/koopman_learning_and_control/koopman_core/controllers/bilinear_mpc_controller_numba.py:9: NumbaPerformanceWarning: np.dot() is faster on contiguous arrays, called on (array(float64, 2d, A), array(float64, 2d, F)) B_lst_flat = (np.dot(z_init[:-1, :], B_arr)).flatten() /Users/carlaxelfolkestad/Coding_projects/koopman_learning_and_control/koopman_core/controllers/nonlinear_mpc_controller_numba.py:225: RuntimeWarning: divide by zero encountered in double_scalars while (iter == 0 or np.linalg.norm(u_prev - self.cur_u) / np.linalg.norm(u_prev) > eps) and iter < max_iter: ```python controller_nmpc.solve_to_convergence(x0_cl, 0., x_init, u_init + ctrl_offset.reshape(1,-1), max_iter=max_iter) xr_nmpc = controller_nmpc.get_state_prediction().T ur_nmpc = controller_nmpc.get_control_prediction().T ``` #### Simulate designed trajectories open loop ```python ol_controller_dmd = OpenLoopController(quadrotor, ur_dmd.T, t_eval[:-1]) xs_dmd, us_dmd = quadrotor.simulate(x0_cl, ol_controller_dmd, t_eval) xs_dmd, us_dmd = xs_dmd.T, us_dmd.T ol_controller_edmd = OpenLoopController(quadrotor, ur_edmd.T, t_eval[:-1]) xs_edmd, us_edmd = quadrotor.simulate(x0_cl, ol_controller_edmd, t_eval) xs_edmd, us_edmd = xs_edmd.T, us_edmd.T ol_controller_bedmd = OpenLoopController(quadrotor, ur_bedmd.T, t_eval[:-1]) xs_bedmd, us_bedmd = quadrotor.simulate(x0_cl, ol_controller_bedmd, t_eval) xs_bedmd, us_bedmd = xs_bedmd.T, us_bedmd.T ol_controller_nmpc = OpenLoopController(quadrotor, ur_nmpc.T, t_eval[:-1]) xs_nmpc, us_nmpc = quadrotor.simulate(x0_cl, ol_controller_nmpc, t_eval) xs_nmpc, us_nmpc = xs_nmpc.T, us_nmpc.T ``` ##### Compare performance ```python import matplotlib.pyplot as plt from matplotlib.ticker import MaxNLocator plot_inds = [0, 1, 2, 3, 4, 5, 0, 1] subplot_inds = [1, 2, 3, 5, 6, 7, 4, 8] labels = ['$y$ (m)', '$z$ (m)', '$\\theta$ (rad)', '$\\dot{y}$ (m/s)','$\\dot{z}$ (m/s)', '$\\dot{\\theta}$', '$T_1$ (N)','$T_2$ (N)'] titles = ['y-coordinates', 'z-coordinates', '$\\theta$-coordinates', 'Control inputs'] colors = ['tab:blue', 'tab:orange', 'tab:brown', 'tab:cyan'] plt.figure(figsize=(12,4)) #plt.suptitle('Trajectory designed with model predictive controllers\nsolid lines - designed trajectory | dashed lines - open loop simulated trajectory | black dotted lines - state/actuation bounds') for ii in range(8): ind = plot_inds[ii] if ii < 6: ax = plt.subplot(2,4,subplot_inds[ii]) plt.plot(t_eval, xr_dmd[ind,:], colors[0], label='DMD MPC') plt.plot(t_eval, xr_edmd[ind, :], colors[1], label='EDMD MPC') plt.plot(t_eval, xr_bedmd[ind, :], colors[2], label='K-MPC') plt.plot(t_eval, xr_nmpc[ind,:], colors[3], label='NMPC') plt.plot(t_eval, xs_dmd[ind,:], '--', color=colors[0], linewidth=1) plt.plot(t_eval, xs_edmd[ind, :], '--', color=colors[1], linewidth=1) plt.plot(t_eval, xs_bedmd[ind, :], '--', color=colors[2], linewidth=1) plt.plot(t_eval, xs_nmpc[ind,:], '--', color=colors[3], linewidth=1) plt.scatter(t_eval[0], x0_cl[ind], color='g') plt.scatter(t_eval[-1], set_pt_cl[ind], color='r') plt.ylabel(labels[ind]) ax.yaxis.set_major_locator(MaxNLocator(integer=True)) if ii >= 3: plt.plot([0, t_eval[-1]], [xmax[ind], xmax[ind]], ':k') plt.plot([0, t_eval[-1]], [xmin[ind], xmin[ind]], ':k') #plt.ylim(xmin[ind]-0.1,xmax[ind]+0.1) if subplot_inds[ii]==1: plt.legend(loc='upper left', frameon=False) elif ii < 8: ax = plt.subplot(2,4,subplot_inds[ii]) plt.plot(t_eval[:-1],ur_dmd[ind,:], color=colors[0], label='DMD MPC') plt.plot(t_eval[:-1], ur_edmd[ind, :], color=colors[1], label='EDMD MPC') plt.plot(t_eval[:-1], ur_bedmd[ind, :], color=colors[2], label='K-NMPC') plt.plot(t_eval[:-1],ur_nmpc[ind,:], color=colors[3], label='NMPC') plt.plot([0, t_eval[-1]], [umax[ind]+hover_thrust, umax[ind]+hover_thrust], ':k') plt.plot([0, t_eval[-1]], [umin[ind]+hover_thrust, umin[ind]+hover_thrust], ':k') plt.ylabel(labels[ii]) ax.yaxis.set_major_locator(MaxNLocator(integer=True)) if subplot_inds[ii] > 4: plt.xlabel('Time (sec)') else: plt.title(titles[subplot_inds[ii]-1]) if save_figures: matplotlib.rcParams['pdf.fonttype'] = 42 matplotlib.rcParams['ps.fonttype'] = 42 plt.tight_layout() plt.savefig(dropbox_folder + 'planar_quad_trajectory.pdf', format='pdf', dpi=2400) plt.show() cost_ref_dmd = (xr_dmd[:,-1]-set_pt_cl).T@QN_mpc@(xr_dmd[:,-1]-set_pt_cl) + np.sum(np.diag(ur_dmd.T@R_mpc@ur_dmd)) cost_ref_edmd = (xr_edmd[:,-1]-set_pt_cl).T@QN_mpc@(xr_edmd[:,-1]-set_pt_cl) + np.sum(np.diag(ur_edmd.T@R_mpc@ur_edmd)) cost_ref_bedmd = (xr_bedmd[:,-1]-set_pt_cl).T@QN_mpc@(xr_bedmd[:,-1]-set_pt_cl) + np.sum(np.diag(ur_bedmd.T@R_mpc@ur_bedmd)) cost_ref_nmpc = (xr_nmpc[:,-1]-set_pt_cl).T@QN_mpc@(xr_nmpc[:,-1]-set_pt_cl) + np.sum(np.diag(ur_nmpc.T@R_mpc@ur_nmpc)) dist_ol_dmd = np.linalg.norm(xs_dmd[:,-1] - set_pt_cl) dist_ol_edmd = np.linalg.norm(xs_edmd[:,-1] - set_pt_cl) dist_ol_bedmd = np.linalg.norm(xs_bedmd[:,-1] - set_pt_cl) dist_ol_nmpc = np.linalg.norm(xs_nmpc[:,-1] - set_pt_cl) print('Solution statistics:\n') print(tabulate([['DMD MPC', "{:.4f}".format(cost_ref_dmd/cost_ref_nmpc), "{:.4f}".format(dist_ol_dmd), '-','-',sum(controller_dmd.comp_time)], ['EDMD MPC', "{:.4f}".format(cost_ref_edmd/cost_ref_nmpc), "{:.4f}".format(dist_ol_edmd),'-','-',sum(controller_edmd.comp_time)], ['bEDMD MPC', "{:.4f}".format(cost_ref_bedmd/cost_ref_nmpc), "{:.4f}".format(dist_ol_bedmd), len(controller_bedmd.x_iter), "{:.4f}".format(np.mean(controller_bedmd.comp_time)), sum(controller_bedmd.comp_time)], ['NMPC (benchmark)', 1, "{:.4f}".format(dist_ol_nmpc), len(controller_nmpc.x_iter), "{:.4f}".format(np.mean(controller_nmpc.comp_time)), sum(controller_nmpc.comp_time)]], headers=['Normalized cost,\ndesigned trajectory', 'Realized terminal,\nerror', '# of SQP\niterations','Mean comp. time\nper iteration (secs)', 'Total comp.\ntime (secs)'])) ``` #### Study evolution of the solution after each iteration of the SQP-algorithm ```python n_iter = min(len(controller_nmpc.x_iter),len(controller_bedmd.x_iter)) # Calculate cost after each iteration: iter_cost_bedmd, iter_cost_nmpc = [], [] ol_controller_init = OpenLoopController(quadrotor, u_init, t_eval[:-1]) xs_init, _ = quadrotor.simulate(x0_cl, ol_controller_init, t_eval) xs_init, us_init = xs_init.T, u_init.T+hover_thrust init_cost = (xs_init[:,-1]-set_pt_cl).T@QN_mpc@(xs_init[:,-1]-set_pt_cl) + np.sum(np.diag(us_init.T@R_mpc@us_init)) iter_cost_bedmd = [init_cost] iter_cost_nmpc = [init_cost] iter_norm_dist_bedmd = [np.linalg.norm(xs_init[:,-1]-set_pt_cl)] iter_norm_dist_nmpc = [np.linalg.norm(xs_init[:,-1]-set_pt_cl)] for ii in range(len(controller_bedmd.x_iter)): ur_bedmd_iter = controller_bedmd.u_iter[ii].T+hover_thrust ol_controller_bedmd_iter = OpenLoopController(quadrotor, ur_bedmd_iter, t_eval[:-1]) xs_bedmd_iter, _ = quadrotor.simulate(x0_cl, ol_controller_bedmd_iter, t_eval) xs_bedmd_iter, us_bedmd_iter = xs_bedmd_iter.T, ur_bedmd_iter.T iter_cost_bedmd.append((xs_bedmd_iter[:,-1]-set_pt_cl).T@QN_mpc@(xs_bedmd_iter[:,-1]-set_pt_cl) + np.sum(np.diag(us_bedmd_iter.T@R_mpc@us_bedmd_iter))) iter_norm_dist_bedmd.append(np.linalg.norm(xs_bedmd_iter[:,-1]-set_pt_cl)) for ii in range(len(controller_nmpc.x_iter)): ur_nmpc_iter = controller_nmpc.u_iter[ii].T ol_controller_nmpc_iter = OpenLoopController(quadrotor, ur_nmpc_iter, t_eval[:-1]) xs_nmpc_iter, _ = quadrotor.simulate(x0_cl, ol_controller_nmpc_iter, t_eval) xs_nmpc_iter, us_nmpc_iter = xs_nmpc_iter.T, ur_nmpc_iter.T iter_cost_nmpc.append((xs_nmpc_iter[:,-1]-set_pt_cl).T@QN_mpc@(xs_nmpc_iter[:,-1]-set_pt_cl) + np.sum(np.diag(us_nmpc_iter.T@R_mpc@us_nmpc_iter))) iter_norm_dist_nmpc.append(np.linalg.norm(xs_nmpc_iter[:,-1]-set_pt_cl)) ``` ```python plt.figure(figsize=(6,4)) plt.suptitle('Control solution after each iteration of the SQP-algorithm for NMPC and K-NMPC') plt.subplot(2,1,1) plt.plot(np.arange(n_iter), iter_cost_bedmd[:n_iter]/iter_cost_nmpc[-1], color=colors[2], label='K-NMPC') plt.plot(np.arange(n_iter), iter_cost_nmpc[:n_iter]/iter_cost_nmpc[-1], color=colors[3], label='NMPC') plt.ylim(0,5) plt.title('Control effort') plt.ylabel('$||u||$') plt.legend(loc='upper right', frameon=False) plt.xlabel('SQP iteration') plt.subplot(2,1,2) plt.plot(np.arange(n_iter), iter_norm_dist_bedmd[:n_iter], color=colors[2], label=labels[2]) plt.plot(np.arange(n_iter), iter_norm_dist_nmpc[:n_iter], color=colors[3], label=labels[3]) plt.ylim(0,5) plt.title('Realized terminal distance from setpoint') plt.ylabel('$||x_N - x_d||$') plt.xlabel('SQP iteration') if save_figures: matplotlib.rcParams['pdf.fonttype'] = 42 matplotlib.rcParams['ps.fonttype'] = 42 plt.tight_layout() plt.savefig(dropbox_folder + 'planar_quad_sqp_iterations.pdf', format='pdf', dpi=2400) plt.show() print('Solution statistics\n') print(tabulate([['Nonlinear MPC', len(controller_nmpc.x_iter), np.mean(controller_nmpc.comp_time), np.std(controller_nmpc.comp_time), sum(controller_nmpc.comp_time)], ['Koopman bilinear MPC', len(controller_bedmd.x_iter), np.mean(controller_bedmd.comp_time), np.std(controller_bedmd.comp_time), sum(controller_bedmd.comp_time)]], headers=['Number of SQP\niterations','Mean comp. time per\niteration (secs)', 'Std comp. time per\niteration (secs)', 'Total comp.\ntime (secs)'])) ``` # Evaluate performance of controllers for closed-loop control #### Design finite horizon controllers ```python from koopman_core.controllers import PerturbedController Q_mpc_cl = sc.sparse.diags([1e3, 1e3, 1e3, 1e2, 1e2, 1e2]) QN_mpc_cl = Q_mpc_cl R_mpc_cl = sc.sparse.eye(m) traj_duration = 0.5 N_cl = int(traj_duration/dt) t_eval_cl=np.arange(250)*dt solver_settings_cl = solver_settings ``` ```python controller_dmd_cl = MPCController(sys_dmd, N_cl, dt, umin, umax, xmin, xmax, Q_mpc_cl, R_mpc_cl, QN_mpc_cl, set_pt_cl, add_slack=True, const_offset=ctrl_offset.squeeze()) controller_dmd_cl = PerturbedController(sys_dmd,controller_dmd_cl,0.,const_offset=hover_thrust, umin=umin, umax=umax) controller_edmd_cl = MPCController(sys_edmd, N_cl, dt, umin, umax, xmin, xmax, Q_mpc_cl, R_mpc_cl, QN_mpc_cl, set_pt_cl, add_slack=True, const_offset=ctrl_offset.squeeze()) controller_edmd_cl = PerturbedController(sys_edmd,controller_edmd_cl,0.,const_offset=hover_thrust, umin=umin, umax=umax) controller_bedmd_cl = BilinearMPCControllerNb(sys_bedmd, N_cl, dt, umin, umax, xmin, xmax, Q_mpc_cl, R_mpc_cl, QN_mpc_cl, set_pt_cl, solver_settings_cl, add_slack=True, const_offset=ctrl_offset) controller_bedmd_cl.construct_controller(controller_bedmd.cur_z[:N_cl+1,:], controller_bedmd.cur_u[:N_cl,:]) controller_bedmd_cl.solve_to_convergence(z0_cl, 0., controller_bedmd.cur_z[:N_cl+1,:], controller_bedmd.cur_u[:N_cl,:], max_iter=max_iter) _ = controller_bedmd_cl.eval(x0_cl, 0.) controller_bedmd_cl = PerturbedController(sys_bedmd,controller_bedmd_cl,0.,const_offset=hover_thrust, umin=umin, umax=umax) controller_nmpc_cl = NonlinearMPCControllerNb(quadrotor_d, N_cl, dt, umin+hover_thrust, umax+hover_thrust, xmin, xmax, Q_mpc_cl, R_mpc_cl, QN_mpc_cl, set_pt_cl, solver_settings_cl, add_slack=True) controller_nmpc_cl.construct_controller(controller_nmpc.cur_z[:N_cl+1,:], controller_nmpc.cur_u[:N_cl,:]) controller_nmpc_cl.solve_to_convergence(x0_cl, 0., controller_nmpc.cur_z[:N_cl+1,:], controller_nmpc.cur_u[:N_cl,:], max_iter=max_iter) _ = controller_nmpc_cl.eval(x0_cl, 0.) ``` ```python controller_bedmd_cl.nom_controller.comp_time, controller_bedmd_cl.nom_controller.prep_time, controller_bedmd_cl.nom_controller.qp_time, = [], [], [] controller_nmpc_cl.comp_time, controller_nmpc_cl.prep_time, controller_nmpc_cl.qp_time, = [], [], [] ``` ```python solver_settings_cl['polish'] = False solver_settings_cl['check_termination'] = 10 solver_settings_cl['max_iter'] = 10 solver_settings_cl['eps_abs'] = 1e-2 solver_settings_cl['eps_rel'] = 1e-2 solver_settings['eps_prim_inf'] = 1e-3 solver_settings['eps_dual_inf'] = 1e-3 controller_nmpc_cl.update_solver_settings(solver_settings_cl) controller_bedmd_cl.nom_controller.update_solver_settings(solver_settings_cl) ``` #### Simulate designed trajectories closed-loop ```python xs_dmd_cl, us_dmd_cl = quadrotor.simulate(x0_cl, controller_dmd_cl, t_eval_cl) xs_dmd_cl, us_dmd_cl = xs_dmd_cl.T, us_dmd_cl.T xs_edmd_cl, us_edmd_cl = quadrotor.simulate(x0_cl, controller_edmd_cl, t_eval_cl) xs_edmd_cl, us_edmd_cl = xs_edmd_cl.T, us_edmd_cl.T controller_bedmd_cl.comp_time = [] xs_bedmd_cl, us_bedmd_cl = quadrotor.simulate(x0_cl, controller_bedmd_cl, t_eval_cl) xs_bedmd_cl, us_bedmd_cl = xs_bedmd_cl.T, us_bedmd_cl.T controller_nmpc_cl.comp_time = [] xs_nmpc_cl, us_nmpc_cl = quadrotor.simulate(x0_cl, controller_nmpc_cl, t_eval_cl) xs_nmpc_cl, us_nmpc_cl = xs_nmpc_cl.T, us_nmpc_cl.T ``` #### Plot/analyze the results ```python plot_inds = [0, 1, 2, 0, 1] subplot_inds = [1, 2, 3, 4, 8] plt.figure(figsize=(12,2.5)) for ii in range(5): ind = plot_inds[ii] if ii < 3: ax = plt.subplot(1,4,subplot_inds[ii]) plt.plot(t_eval_cl, xs_dmd_cl[ind,:], colors[0], label='DMD MPC') plt.plot(t_eval_cl, xs_edmd_cl[ind, :], colors[1], label='EDMD MPC') plt.plot(t_eval_cl, xs_bedmd_cl[ind, :], colors[2], label='K-NMPC') plt.plot(t_eval_cl, xs_nmpc_cl[ind,:], colors[3], label='NMPC') plt.scatter(t_eval_cl[0], x0_cl[ind], color='g') plt.scatter(t_eval_cl[-1], set_pt_cl[ind], color='r') plt.ylabel(labels[ind]) ax.yaxis.set_major_locator(MaxNLocator(integer=True)) plt.title(titles[subplot_inds[ii]-1]) plt.xlabel('Time (sec)') if subplot_inds[ii]==1: plt.legend(loc='upper left', frameon=False) else: bx = plt.subplot(2,4,subplot_inds[ii]) plt.plot(t_eval_cl[:-1],us_dmd_cl[ind,:], color=colors[0], label='DMD MPC') plt.plot(t_eval_cl[:-1], us_edmd_cl[ind, :], color=colors[1], label='EDMD MPC') plt.plot(t_eval_cl[:-1], us_bedmd_cl[ind, :], color=colors[2], label='K-NMPC') plt.plot(t_eval_cl[:-1],us_nmpc_cl[ind,:], color=colors[3], label='NMPC') plt.plot([0, t_eval_cl[-1]], [umax[ind]+hover_thrust, umax[ind]+hover_thrust], ':k') plt.plot([0, t_eval_cl[-1]], [umin[ind]+hover_thrust, umin[ind]+hover_thrust], ':k') plt.ylabel(labels[ii+3]) ax.yaxis.set_major_locator(MaxNLocator(integer=True)) if subplot_inds[ii] == 4: plt.title('Control inputs') else: plt.xlabel('Time (sec)') if save_figures: matplotlib.rcParams['pdf.fonttype'] = 42 matplotlib.rcParams['ps.fonttype'] = 42 plt.tight_layout() plt.savefig(dropbox_folder + 'planar_quad_closed_loop.pdf', format='pdf', dpi=2400) plt.show() from matplotlib.offsetbox import AnnotationBbox, OffsetImage from scipy import ndimage draw_inds = np.arange(0,t_eval_cl.size)[::50] plt.figure(figsize=(12,2)) ax = plt.subplot(1,1,1, frameon=False) plt.plot(xs_bedmd_cl[0,:], xs_bedmd_cl[1,:], color=colors[2], label='Koopman NMPC closed loop trajectory with quadrotor orientation sampled at 2 hz') plt.xlabel('y (m)') plt.ylabel('z (m)') plt.legend(loc='upper left',frameon=False) for ii in draw_inds: im_quad = plt.imread('working_files/figures/quad_figure_rb.png') im_quad = ndimage.rotate(im_quad, xs_bedmd_cl[2,ii]*180) imagebox_quad = OffsetImage(im_quad, zoom=.11) ab = AnnotationBbox(imagebox_quad, [xs_bedmd_cl[0,ii], xs_bedmd_cl[1,ii]], frameon=False) ax.add_artist(ab) if save_figures: matplotlib.rcParams['pdf.fonttype'] = 42 matplotlib.rcParams['ps.fonttype'] = 42 plt.tight_layout() plt.savefig(dropbox_folder + 'planar_quad_closed_loop_2.pdf', format='pdf', dpi=2400) plt.show() cost_cl_dmd = np.sum(np.diag((xs_dmd_cl[:,:-1]-set_pt_cl.reshape(-1,1)).T@Q_mpc_cl@(xs_dmd_cl[:,:-1]-set_pt_cl.reshape(-1,1)))) + (xs_dmd_cl[:,-1]-set_pt_cl).T@QN_mpc_cl@(xs_dmd_cl[:,-1]-set_pt_cl) + np.sum(np.diag(us_dmd_cl.T@R_mpc_cl@us_dmd_cl)) cost_cl_edmd = np.sum(np.diag((xs_edmd_cl[:,:-1]-set_pt_cl.reshape(-1,1)).T@Q_mpc_cl@(xs_edmd_cl[:,:-1]-set_pt_cl.reshape(-1,1)))) + (xs_edmd_cl[:,-1]-set_pt_cl).T@QN_mpc_cl@(xs_edmd_cl[:,-1]-set_pt_cl) + np.sum(np.diag(us_edmd_cl.T@R_mpc_cl@us_edmd_cl)) cost_cl_bedmd = np.sum(np.diag((xs_bedmd_cl[:,:-1]-set_pt_cl.reshape(-1,1)).T@Q_mpc_cl@(xs_bedmd_cl[:,:-1]-set_pt_cl.reshape(-1,1)))) + (xs_bedmd_cl[:,-1]-set_pt_cl).T@QN_mpc_cl@(xs_bedmd_cl[:,-1]-set_pt_cl) + np.sum(np.diag(us_bedmd_cl.T@R_mpc_cl@us_bedmd_cl)) cost_cl_nmpc = np.sum(np.diag((xs_nmpc_cl[:,:-1]-set_pt_cl.reshape(-1,1)).T@Q_mpc_cl@(xs_nmpc_cl[:,:-1]-set_pt_cl.reshape(-1,1)))) + (xs_nmpc_cl[:,-1]-set_pt_cl).T@QN_mpc_cl@(xs_nmpc_cl[:,-1]-set_pt_cl) + np.sum(np.diag(us_nmpc_cl.T@R_mpc_cl@us_nmpc_cl)) print('Solution statistics:\n') print(tabulate([['DMD MPC', "{:.4f}".format(cost_cl_dmd/cost_cl_nmpc), np.mean(controller_dmd_cl.nom_controller.comp_time), np.std(controller_dmd_cl.nom_controller.comp_time)], ['EDMD MPC', "{:.4f}".format(cost_cl_edmd/cost_cl_nmpc),np.mean(controller_edmd_cl.nom_controller.comp_time), np.std(controller_edmd_cl.nom_controller.comp_time)], ['bEDMD MPC', "{:.4f}".format(cost_cl_bedmd/cost_cl_nmpc), np.mean(controller_bedmd_cl.nom_controller.comp_time), np.std(controller_bedmd_cl.nom_controller.comp_time)], ['NMPC (benchmark, known model)',1, np.mean(controller_nmpc_cl.comp_time), np.std(controller_nmpc_cl.comp_time)]], headers=['Normalized cost,\nrealized trajectory', 'Mean comp. time (secs)', 'std comp. time (secs)'])) ``` ```python print('\nSolution time profiling:\n') print(tabulate([['NMPC', np.mean(controller_nmpc_cl.comp_time), np.mean(controller_nmpc_cl.prep_time), np.mean(controller_nmpc_cl.qp_time)], ['Koopman bilinear MPC', np.mean(controller_bedmd_cl.nom_controller.comp_time), np.mean(controller_bedmd_cl.nom_controller.prep_time), np.mean(controller_bedmd_cl.nom_controller.qp_time)]], headers=['Total comp time', 'setup time', 'qp solve time' ])) ``` Solution time profiling: Total comp time setup time qp solve time -------------------- ----------------- ------------ --------------- NMPC 0.00412956 0.00358561 0.000543945 Koopman bilinear MPC 0.00706125 0.00222308 0.00483817 ```python ```
(* Title: JinjaThreads/Framework/FWLifting.thy Author: Andreas Lochbihler *) header {* \isaheader{Lifting of thread-local properties to the multithreaded case} *} theory FWLifting imports FWWellform begin text{* Lifting for properties that only involve thread-local state information and the shared memory. *} definition ts_ok :: "('t \<Rightarrow> 'x \<Rightarrow> 'm \<Rightarrow> bool) \<Rightarrow> ('l, 't,'x) thread_info \<Rightarrow> 'm \<Rightarrow> bool" where "ts_ok P ts m \<equiv> \<forall>t. case (ts t) of None \<Rightarrow> True | \<lfloor>(x, ln)\<rfloor> \<Rightarrow> P t x m" lemma ts_okI: "\<lbrakk> \<And>t x ln. ts t = \<lfloor>(x, ln)\<rfloor> \<Longrightarrow> P t x m \<rbrakk> \<Longrightarrow> ts_ok P ts m" by(auto simp add: ts_ok_def) lemma ts_okE: "\<lbrakk> ts_ok P ts m; \<lbrakk> \<And>t x ln. ts t = \<lfloor>(x, ln)\<rfloor> \<Longrightarrow> P t x m \<rbrakk> \<Longrightarrow> Q \<rbrakk> \<Longrightarrow> Q" by(auto simp add: ts_ok_def) lemma ts_okD: "\<lbrakk> ts_ok P ts m; ts t = \<lfloor>(x, ln)\<rfloor> \<rbrakk> \<Longrightarrow> P t x m" by(auto simp add: ts_ok_def) lemma ts_ok_True [simp]: "ts_ok (\<lambda>t m x. True) ts m" by(auto intro: ts_okI) lemma ts_ok_conj: "ts_ok (\<lambda>t x m. P t x m \<and> Q t x m) = (\<lambda>ts m. ts_ok P ts m \<and> ts_ok Q ts m)" by(auto intro: ts_okI intro!: ext dest: ts_okD) lemma ts_ok_mono: "\<lbrakk> ts_ok P ts m; \<And>t x. P t x m \<Longrightarrow> Q t x m \<rbrakk> \<Longrightarrow> ts_ok Q ts m" by(auto intro!: ts_okI dest: ts_okD) text{* Lifting for properites, that also require additional data that does not change during execution *} definition ts_inv :: "('i \<Rightarrow> 't \<Rightarrow> 'x \<Rightarrow> 'm \<Rightarrow> bool) \<Rightarrow> ('t \<rightharpoonup> 'i) \<Rightarrow> ('l,'t,'x) thread_info \<Rightarrow> 'm \<Rightarrow> bool" where "ts_inv P I ts m \<equiv> \<forall>t. case (ts t) of None \<Rightarrow> True | \<lfloor>(x, ln)\<rfloor> \<Rightarrow> \<exists>i. I t = \<lfloor>i\<rfloor> \<and> P i t x m" lemma ts_invI: "\<lbrakk> \<And>t x ln. ts t = \<lfloor>(x, ln)\<rfloor> \<Longrightarrow> \<exists>i. I t = \<lfloor>i\<rfloor> \<and> P i t x m \<rbrakk> \<Longrightarrow> ts_inv P I ts m" by(simp add: ts_inv_def) lemma ts_invE: "\<lbrakk> ts_inv P I ts m; \<forall>t x ln. ts t = \<lfloor>(x, ln)\<rfloor> \<longrightarrow> (\<exists>i. I t = \<lfloor>i\<rfloor> \<and> P i t x m) \<Longrightarrow> R \<rbrakk> \<Longrightarrow> R" by(auto simp add: ts_inv_def) lemma ts_invD: "\<lbrakk> ts_inv P I ts m; ts t = \<lfloor>(x, ln)\<rfloor> \<rbrakk> \<Longrightarrow> \<exists>i. I t = \<lfloor>i\<rfloor> \<and> P i t x m" by(auto simp add: ts_inv_def) text {* Wellformedness properties for lifting *} definition ts_inv_ok :: "('l,'t,'x) thread_info \<Rightarrow> ('t \<rightharpoonup> 'i) \<Rightarrow> bool" where "ts_inv_ok ts I \<equiv> \<forall>t. ts t = None \<longleftrightarrow> I t = None" lemma ts_inv_okI: "(\<And>t. ts t = None \<longleftrightarrow> I t = None) \<Longrightarrow> ts_inv_ok ts I" by(clarsimp simp add: ts_inv_ok_def) lemma ts_inv_okI2: "(\<And>t. (\<exists>v. ts t = \<lfloor>v\<rfloor>) \<longleftrightarrow> (\<exists>v. I t = \<lfloor>v\<rfloor>)) \<Longrightarrow> ts_inv_ok ts I" by(force simp add: ts_inv_ok_def) lemma ts_inv_okE: "\<lbrakk> ts_inv_ok ts I; \<forall>t. ts t = None \<longleftrightarrow> I t = None \<Longrightarrow> P \<rbrakk> \<Longrightarrow> P" by(force simp add: ts_inv_ok_def) lemma ts_inv_okE2: "\<lbrakk> ts_inv_ok ts I; \<forall>t. (\<exists>v. ts t = \<lfloor>v\<rfloor>) \<longleftrightarrow> (\<exists>v. I t = \<lfloor>v\<rfloor>) \<Longrightarrow> P \<rbrakk> \<Longrightarrow> P" by(force simp add: ts_inv_ok_def) lemma ts_inv_okD: "ts_inv_ok ts I \<Longrightarrow> (ts t = None) \<longleftrightarrow> (I t = None)" by(erule ts_inv_okE, blast) lemma ts_inv_okD2: "ts_inv_ok ts I \<Longrightarrow> (\<exists>v. ts t = \<lfloor>v\<rfloor>) \<longleftrightarrow> (\<exists>v. I t = \<lfloor>v\<rfloor>)" by(erule ts_inv_okE2, blast) lemma ts_inv_ok_conv_dom_eq: "ts_inv_ok ts I \<longleftrightarrow> (dom ts = dom I)" proof - have "ts_inv_ok ts I \<longleftrightarrow> (\<forall>t. ts t = None \<longleftrightarrow> I t = None)" unfolding ts_inv_ok_def by blast also have "\<dots> \<longleftrightarrow> (\<forall>t. t \<in> - dom ts \<longleftrightarrow> t \<in> - dom I)" by(force) also have "\<dots> \<longleftrightarrow> dom ts = dom I" by auto finally show ?thesis . qed lemma ts_inv_ok_upd_ts: "\<lbrakk> ts t = \<lfloor>x\<rfloor>; ts_inv_ok ts I \<rbrakk> \<Longrightarrow> ts_inv_ok (ts(t \<mapsto> x')) I" by(auto dest!: ts_inv_okD intro!: ts_inv_okI split: if_splits) lemma ts_inv_upd_map_option: assumes "ts_inv P I ts m" and "\<And>x ln. ts t = \<lfloor>(x, ln)\<rfloor> \<Longrightarrow> P (the (I t)) t (fst (f (x, ln))) m" shows "ts_inv P I (ts(t := (map_option f (ts t)))) m" using assms by(fastforce intro!: ts_invI split: split_if_asm dest: ts_invD) fun upd_inv :: "('t \<rightharpoonup> 'i) \<Rightarrow> ('i \<Rightarrow> 't \<Rightarrow> 'x \<Rightarrow> 'm \<Rightarrow> bool) \<Rightarrow> ('t,'x,'m) new_thread_action \<Rightarrow> ('t \<rightharpoonup> 'i)" where "upd_inv I P (NewThread t x m) = I(t \<mapsto> SOME i. P i t x m)" | "upd_inv I P _ = I" fun upd_invs :: "('t \<rightharpoonup> 'i) \<Rightarrow> ('i \<Rightarrow> 't \<Rightarrow> 'x \<Rightarrow> 'm \<Rightarrow> bool) \<Rightarrow> ('t,'x,'m) new_thread_action list \<Rightarrow> ('t \<rightharpoonup> 'i)" where "upd_invs I P [] = I" | "upd_invs I P (ta#tas) = upd_invs (upd_inv I P ta) P tas" lemma upd_invs_append [simp]: "upd_invs I P (xs @ ys) = upd_invs (upd_invs I P xs) P ys" by(induct xs arbitrary: I)(auto) lemma ts_inv_ok_upd_inv': "ts_inv_ok ts I \<Longrightarrow> ts_inv_ok (redT_updT' ts ta) (upd_inv I P ta)" by(cases ta)(auto intro!: ts_inv_okI elim: ts_inv_okD del: iffI) lemma ts_inv_ok_upd_invs': "ts_inv_ok ts I \<Longrightarrow> ts_inv_ok (redT_updTs' ts tas) (upd_invs I P tas)" proof(induct tas arbitrary: ts I) case Nil thus ?case by simp next case (Cons TA TAS TS I) note IH = `\<And>ts I. ts_inv_ok ts I \<Longrightarrow> ts_inv_ok (redT_updTs' ts TAS) (upd_invs I P TAS)` note esok = `ts_inv_ok TS I` from esok have "ts_inv_ok (redT_updT' TS TA) (upd_inv I P TA)" by -(rule ts_inv_ok_upd_inv') hence "ts_inv_ok (redT_updTs' (redT_updT' TS TA) TAS) (upd_invs (upd_inv I P TA) P TAS)" by (rule IH) thus ?case by simp qed lemma ts_inv_ok_upd_inv: "ts_inv_ok ts I \<Longrightarrow> ts_inv_ok (redT_updT ts ta) (upd_inv I P ta)" apply(cases ta) apply(auto intro!: ts_inv_okI elim: ts_inv_okD del: iffI) done lemma ts_inv_ok_upd_invs: "ts_inv_ok ts I \<Longrightarrow> ts_inv_ok (redT_updTs ts tas) (upd_invs I P tas)" proof(induct tas arbitrary: ts I) case Nil thus ?case by simp next case (Cons TA TAS TS I) note IH = `\<And>ts I. ts_inv_ok ts I \<Longrightarrow> ts_inv_ok (redT_updTs ts TAS) (upd_invs I P TAS)` note esok = `ts_inv_ok TS I` from esok have "ts_inv_ok (redT_updT TS TA) (upd_inv I P TA)" by -(rule ts_inv_ok_upd_inv) hence "ts_inv_ok (redT_updTs (redT_updT TS TA) TAS) (upd_invs (upd_inv I P TA) P TAS)" by (rule IH) thus ?case by simp qed lemma ts_inv_ok_inv_ext_upd_inv: "\<lbrakk> ts_inv_ok ts I; thread_ok ts ta \<rbrakk> \<Longrightarrow> I \<subseteq>\<^sub>m upd_inv I P ta" by(cases ta)(auto intro!: map_le_same_upd dest: ts_inv_okD) lemma ts_inv_ok_inv_ext_upd_invs: "\<lbrakk> ts_inv_ok ts I; thread_oks ts tas\<rbrakk> \<Longrightarrow> I \<subseteq>\<^sub>m upd_invs I P tas" proof(induct tas arbitrary: ts I) case Nil thus ?case by simp next case (Cons TA TAS TS I) note IH = `\<And>ts I. \<lbrakk> ts_inv_ok ts I; thread_oks ts TAS\<rbrakk> \<Longrightarrow> I \<subseteq>\<^sub>m upd_invs I P TAS` note esinv = `ts_inv_ok TS I` note cct = `thread_oks TS (TA # TAS)` from esinv cct have "I \<subseteq>\<^sub>m upd_inv I P TA" by(auto intro: ts_inv_ok_inv_ext_upd_inv) also from esinv cct have "ts_inv_ok (redT_updT' TS TA) (upd_inv I P TA)" by(auto intro: ts_inv_ok_upd_inv') with cct have "upd_inv I P TA \<subseteq>\<^sub>m upd_invs (upd_inv I P TA) P TAS" by(auto intro: IH) finally show ?case by simp qed lemma upd_invs_Some: "\<lbrakk> thread_oks ts tas; I t = \<lfloor>i\<rfloor>; ts t = \<lfloor>x\<rfloor> \<rbrakk> \<Longrightarrow> upd_invs I Q tas t = \<lfloor>i\<rfloor>" proof(induct tas arbitrary: ts I) case Nil thus ?case by simp next case (Cons TA TAS TS I) note IH = `\<And>ts I. \<lbrakk>thread_oks ts TAS; I t = \<lfloor>i\<rfloor>; ts t = \<lfloor>x\<rfloor>\<rbrakk> \<Longrightarrow> upd_invs I Q TAS t = \<lfloor>i\<rfloor>` note cct = `thread_oks TS (TA # TAS)` note it = `I t = \<lfloor>i\<rfloor>` note est = `TS t = \<lfloor>x\<rfloor>` from cct have cctta: "thread_ok TS TA" and ccttas: "thread_oks (redT_updT' TS TA) TAS" by auto from cctta it est have "upd_inv I Q TA t = \<lfloor>i\<rfloor>" by(cases TA, auto) moreover have "redT_updT' TS TA t = \<lfloor>x\<rfloor>" using cctta est by - (rule redT_updT'_Some) ultimately have "upd_invs (upd_inv I Q TA) Q TAS t = \<lfloor>i\<rfloor>" using ccttas by -(erule IH) thus ?case by simp qed lemma upd_inv_Some_eq: "\<lbrakk> thread_ok ts ta; ts t = \<lfloor>x\<rfloor> \<rbrakk> \<Longrightarrow> upd_inv I Q ta t = I t" by(cases ta, auto) lemma upd_invs_Some_eq: "\<lbrakk> thread_oks ts tas; ts t = \<lfloor>x\<rfloor> \<rbrakk> \<Longrightarrow> upd_invs I Q tas t = I t" proof(induct tas arbitrary: ts I) case Nil thus ?case by simp next case (Cons TA TAS TS I) note IH = `\<And>ts I. \<lbrakk>thread_oks ts TAS; ts t = \<lfloor>x\<rfloor>\<rbrakk> \<Longrightarrow> upd_invs I Q TAS t = I t` note cct = `thread_oks TS (TA # TAS)` note est = `TS t = \<lfloor>x\<rfloor>` from cct est have "upd_invs (upd_inv I Q TA) Q TAS t = upd_inv I Q TA t" apply(clarsimp) apply(erule IH) by(rule redT_updT'_Some) also from cct est have "\<dots> = I t" by(auto elim: upd_inv_Some_eq) finally show ?case by simp qed lemma SOME_new_thread_upd_invs: assumes Qsome: "Q (SOME i. Q i t x m) t x m" and nt: "NewThread t x m \<in> set tas" and cct: "thread_oks ts tas" shows "\<exists>i. upd_invs I Q tas t = \<lfloor>i\<rfloor> \<and> Q i t x m" proof(rule exI[where x="SOME i. Q i t x m"]) from nt cct have "upd_invs I Q tas t = \<lfloor>SOME i. Q i t x m\<rfloor>" proof(induct tas arbitrary: ts I) case Nil thus ?case by simp next case (Cons TA TAS TS I) note IH = `\<And>ts I. \<lbrakk> NewThread t x m \<in> set TAS; thread_oks ts TAS \<rbrakk> \<Longrightarrow> upd_invs I Q TAS t = \<lfloor>SOME i. Q i t x m\<rfloor>` note nt = `NewThread t x m \<in> set (TA # TAS)` note cct = `thread_oks TS (TA # TAS)` { assume nt': "NewThread t x m \<in> set TAS" from cct have ?case apply(clarsimp) by(rule IH[OF nt']) } moreover { assume ta: "TA = NewThread t x m" with cct have rup: "redT_updT' TS TA t = \<lfloor>(undefined, no_wait_locks)\<rfloor>" by(simp) from cct have cctta: "thread_oks (redT_updT' TS TA) TAS" by simp from ta have "upd_inv I Q TA t = \<lfloor>SOME i. Q i t x m\<rfloor>" by(simp) hence ?case by(clarsimp simp add: upd_invs_Some_eq[OF cctta, OF rup]) } ultimately show ?case using nt by auto qed with Qsome show "upd_invs I Q tas t = \<lfloor>SOME i. Q i t x m\<rfloor> \<and> Q (SOME i. Q i t x m) t x m" by(simp) qed lemma ts_ok_into_ts_inv_const: assumes "ts_ok P ts m" obtains I where "ts_inv (\<lambda>_. P) I ts m" proof - from assms have "ts_inv (\<lambda>_. P) (\<lambda>t. if t \<in> dom ts then Some undefined else None) ts m" by(auto intro!: ts_invI dest: ts_okD) thus thesis by(rule that) qed lemma ts_inv_const_into_ts_ok: "ts_inv (\<lambda>_. P) I ts m \<Longrightarrow> ts_ok P ts m" by(auto intro!: ts_okI dest: ts_invD) lemma ts_inv_into_ts_ok_Ex: "ts_inv Q I ts m \<Longrightarrow> ts_ok (\<lambda>t x m. \<exists>i. Q i t x m) ts m" by(rule ts_okI)(blast dest: ts_invD) lemma ts_ok_Ex_into_ts_inv: "ts_ok (\<lambda>t x m. \<exists>i. Q i t x m) ts m \<Longrightarrow> \<exists>I. ts_inv Q I ts m" by(rule exI[where x="\<lambda>t. \<lfloor>SOME i. Q i t (fst (the (ts t))) m\<rfloor>"])(auto 4 4 dest: ts_okD intro: someI intro: ts_invI) lemma Ex_ts_inv_conv_ts_ok: "(\<exists>I. ts_inv Q I ts m) \<longleftrightarrow> (ts_ok (\<lambda>t x m. \<exists>i. Q i t x m) ts m)" by(auto dest: ts_inv_into_ts_ok_Ex ts_ok_Ex_into_ts_inv) end
\chapter{Introduction} \section{Motivation} \label{sec:motivation} According to the World Health Organization (WHO)\footnote{\href{https://www.who.int/news-room/fact-sheets/detail/dementia}{https://www.who.int/news-room/fact-sheets/detail/dementia}}, there are currently around 50 million people suffering from dementia around the word. Despite the already high number of cases and an expectation of 152 million patients by 2050, there is, as of today, no treatment to cure the disease or slow its progression down. However, the quality of life of the patients can be improved when the disease is detected in an early stage. There is therefore a need to build tools that can predict whether a person has the disease or not. Additionally, there is currently no clear understanding of the causes of dementia. Overall there is a need for a better understanding of the disease. The recent improvements on the machine learning models and the overall better explainability of their outputs motivates their application to the field of dementia detection. \section{Problem Statement} \label{sec:problem_statement} This thesis aims at provides a machine learning model to automatically detect dementia. The outcome model has the constrain of having reasonable performances in terms of the different losses and metrics defined in section~\ref{sec:losses_metrics} and must be able to explain its predictions. In our approach, we chose to work with a three-dimensional scan of the brain as input. Namely the raw T1-weighted Magnetic Resonance Images (MRI) of the patient brain. This data is a scan that encodes the anatomy of the brain. Our final goal is in a first phase to feed these MRI to the Convolutional Neural Network defined in section~\ref{sec:standard_cnn} in order to obtain a prediction. In a second phase, we explain the previously obtained prediction using the fullgrad algorithm explains in section~\ref{sec:fullgrad}. Finally, the outcome of the two previous phases are visualized using the brain viewer from annex~\ref{chap:brainviewer}. This brain viewer can be used by a clinician to see the original individual scan of the brain, the attention map and the predicted diagnostic. \section{Research Question & Contributions} This thesis tackles the following questions: \begin{itemize} \item How can raw MRI scans be used as input to a deep learning model to predict dementia? \item Which information does a deep learning model use in order to make its prediction? \end{itemize} In order to answer these questions, the thesis provides the following contribution \begin{itemize} \item We present a prepocessing pipeline that prepares the MRI brain scans for a deep learning model. \item We introduce a deep learning model that predicts if a brain scans presents dementia. \item We further present a model that visually shows the region of the brain the model used in order to give its prediction \item We develop a brain viewer tool that any non-machine learning expert can use to analyze the output and the explanation of the model. \end{itemize} \section{Thesis Structure} \label{sec:structure} This thesis starts with chapter~\ref{chap:background} which quickly introduces the reader to the dementia diseases in section \ref{sec:medical_background} before listing the different machine learning blocks that will be used during the entire work. This chapter end itself by describing, in section~\ref{sec:model_explaination}, the different techniques used to gain a better understanding of the model's outputs. The following chapter~\ref{chap:data} describes the type of data used and how it has been preporcessed for the models. The thesis continues with chapter~\ref{chap:models}, which presents the different models and their architecture. In chapter~\ref{chap:experiments} we briefly explain how the models were trained and the performances obtained from them. This chapter ends by showing the results on models explainability. Finally, in the last chapter~\ref{chap:conculusion} we conclude the thesis and propose some future work that could be done to improve either the performance or the explanabilty of the models.
#include "NumCpp.hpp" #include <Eigen/Dense> #include <iostream> typedef Eigen::Matrix<int, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> EigenIntMatrix; typedef Eigen::Map<EigenIntMatrix> EigenIntMatrixMap; int main() { // construct some NumCpp arrays auto ncA = nc::random::randInt<int>({ 5, 5 }, 0, 10); auto ncB = nc::random::randInt<int>({ 5, 5 }, 0, 10); std::cout << "ncA:\n" << ncA << std::endl; std::cout << "ncB:\n" << ncB << std::endl; // map the arrays to Eigen auto eigenA = EigenIntMatrixMap(ncA.data(), ncA.numRows(), ncA.numCols()); auto eigenB = EigenIntMatrixMap(ncB.data(), ncB.numRows(), ncB.numCols()); // add the two Eigen matrices auto eigenC = eigenA + eigenB; // add the two NumCpp arrays for a sanity check auto ncC = ncA + ncB; // convert the Eigen result back to NumCpp int* dataPtr = new int[eigenC.rows() * eigenC.cols()]; EigenIntMatrixMap(dataPtr, eigenC.rows(), eigenC.cols()) = eigenC; constexpr bool takeOwnership = true; auto ncCeigen = nc::NdArray<int>(dataPtr, eigenC.rows(), eigenC.cols(), takeOwnership); // compare the two outputs if (nc::array_equal(ncC, ncCeigen)) { std::cout << "Arrays are equal." << std::endl; std::cout << ncC << std::endl; } else { std::cout << "Arrays are not equal." << std::endl; std::cout << "ncCeigen:\n" << ncCeigen << std::endl; std::cout << "ncC:\n" << ncC << std::endl; } return 0; }
#ifndef PROXY_HTTP_PARSER_BODY_WITH_LENGTH_PARSER_HPP #define PROXY_HTTP_PARSER_BODY_WITH_LENGTH_PARSER_HPP #include <boost/logic/tribool.hpp> #include <boost/tuple/tuple.hpp> namespace proxy { namespace http_parser { /// Parser for incoming body with length. class body_with_length_parser { public: /// Reset to initial parser state. void reset(unsigned long long length); /// Parse some data. The tribool return value is true when a complete body /// has been parsed, false if the data is invalid, indeterminate when more /// data is required. The InputIterator return value indicates how much of the /// input has been consumed. template <typename InputIterator> [[nodiscard]] boost::tuple<boost::tribool, InputIterator> parse(InputIterator begin, InputIterator end) { if (remaining_body_count_ == 0) { boost::tribool result = true; return boost::make_tuple(result, begin); } size_t skip = end - begin; if (skip >= remaining_body_count_) { begin += remaining_body_count_; remaining_body_count_ = 0; boost::tribool result = true; return boost::make_tuple(result, begin); } else { begin = end; remaining_body_count_ -= skip; boost::tribool result = boost::indeterminate; return boost::make_tuple(result, begin); } } unsigned long long remaining_body_count_{0}; }; } // namespace http_parser } // namespace proxy #endif // PROXY_HTTP_PARSER_BODY_WITH_LENGTH_PARSER_HPP
Is a marble splashback a good idea? Have fun and join in our monthly styling challenges! This month we’re challenging you to style your bathroom and by joining in, you could win a fab prize pack valued at over $200! Find all the details here. Looking at buying a rug soon? Then listen up to what these styling experts have to say about finding ‘the right’ rug for your space… or rather what not to do!
#include "test_file_writer.hpp" #include "asioext/read_file.hpp" #include "asioext/open.hpp" #include <boost/test/unit_test.hpp> #include <boost/mpl/list.hpp> ASIOEXT_NS_BEGIN BOOST_AUTO_TEST_SUITE(asioext_read_file) // BOOST_AUTO_TEST_SUITE() gives us a unique NS, so we don't need to // prefix our variables. static const char* empty_filename = "asioext_readfile_empty"; static const char* test_filename = "asioext_readfile_test"; static const wchar_t* test_filenamew = L"asioext_readfile_test"; static const char test_data[] = "hello world!"; static const std::size_t test_data_size = sizeof(test_data) - 1; typedef boost::mpl::list<char, signed char, unsigned char> char_types; static void write_empty_file() { static test_file_writer file(empty_filename, 0, 0); } static void write_test_file() { static test_file_writer file(test_filename, test_data, test_data_size); } template <typename T1, typename T2> static bool compare_characters(T1 a1, T2 a2) { return static_cast<unsigned char>(a1) == static_cast<unsigned char>(a2); } template <class C> static boost::test_tools::predicate_result compare_with_test_data(const C& c) { if (test_data_size != c.size()) { boost::test_tools::predicate_result res(false); res.message() << "Different sizes [" << test_data_size << "!=" << c.size() << "]"; return res; } for (std::size_t i = 0; i != test_data_size; ++i) { if (compare_characters(test_data[i], c[i])) continue; boost::test_tools::predicate_result res(false); res.message() << "Mismatch at " << i; res.message() << " [" << test_data[i] << " != " << c[i] << "]"; return res; } return true; } BOOST_AUTO_TEST_CASE(empty) { write_empty_file(); std::string str; asioext::error_code ec; asioext::read_file(empty_filename, str, ec); BOOST_REQUIRE(!ec); BOOST_CHECK_EQUAL(0, str.size()); std::vector<char> vec; asioext::read_file(empty_filename, vec, ec); BOOST_REQUIRE(!ec); BOOST_CHECK_EQUAL(0, vec.size()); // MutableBufferSequence char buffer[1]; asioext::read_file(empty_filename, asio::buffer(buffer, 0), ec); BOOST_REQUIRE(!ec); asioext::read_file(empty_filename, asio::buffer(buffer, 1), ec); BOOST_CHECK_EQUAL(ec, asio::error::eof); } BOOST_AUTO_TEST_CASE(nonexistent) { std::string str; asioext::error_code ec; asioext::read_file("nosuchfile", str, ec); BOOST_REQUIRE(ec); BOOST_CHECK_EQUAL(0, str.size()); // MutableBufferSequence char buffer[1]; asioext::read_file("nosuchfile", asio::buffer(buffer, 0), ec); BOOST_REQUIRE(ec); } BOOST_AUTO_TEST_CASE(read_file_string) { write_test_file(); std::string str; asioext::error_code ec; // read a file into an empty string. asioext::read_file(test_filename, str, ec); BOOST_REQUIRE(!ec); BOOST_CHECK_EQUAL(test_data_size, str.size()); BOOST_CHECK_EQUAL(test_data, str); // re-use the already filled string object to read a file. asioext::read_file(test_filename, str, ec); BOOST_REQUIRE(!ec); BOOST_CHECK_EQUAL(test_data_size, str.size()); BOOST_CHECK_EQUAL(test_data, str); } BOOST_AUTO_TEST_CASE_TEMPLATE(read_file_vector, T, char_types) { write_test_file(); asioext::error_code ec; std::vector<T> vec; // read a file into an empty vector. asioext::read_file(test_filename, vec, ec); BOOST_REQUIRE(!ec); BOOST_CHECK(compare_with_test_data(vec)); // re-use the already filled vector object to read a file. asioext::read_file(test_filename, vec, ec); BOOST_REQUIRE(!ec); BOOST_CHECK(compare_with_test_data(vec)); } BOOST_AUTO_TEST_CASE(read_file_buffer) { write_test_file(); char buffer[test_data_size + 1] = {'\0'}; asioext::error_code ec; asioext::read_file(test_filename, asio::buffer(buffer, test_data_size), ec); BOOST_REQUIRE(!ec); BOOST_CHECK_EQUAL(test_data, buffer); } #if defined(ASIOEXT_WINDOWS) BOOST_AUTO_TEST_CASE(read_file_wide_filename) { write_test_file(); std::string str; asioext::error_code ec; // read a file into an empty string. asioext::read_file(test_filenamew, str, ec); BOOST_REQUIRE(!ec); BOOST_CHECK_EQUAL(test_data_size, str.size()); BOOST_CHECK_EQUAL(test_data, str); // re-use the already filled string object to read a file. asioext::read_file(test_filenamew, str, ec); BOOST_REQUIRE(!ec); BOOST_CHECK_EQUAL(test_data_size, str.size()); BOOST_CHECK_EQUAL(test_data, str); } BOOST_AUTO_TEST_CASE_TEMPLATE(read_file_vector_wide_filename, T, char_types) { write_test_file(); asioext::error_code ec; std::vector<T> vec; // read a file into an empty vector. asioext::read_file(test_filenamew, vec, ec); BOOST_REQUIRE(!ec); BOOST_CHECK(compare_with_test_data(vec)); // re-use the already filled vector object to read a file. asioext::read_file(test_filenamew, vec, ec); BOOST_REQUIRE(!ec); BOOST_CHECK(compare_with_test_data(vec)); } BOOST_AUTO_TEST_CASE(read_file_buffer_wide_filename) { write_test_file(); char buffer[test_data_size + 1] = {'\0'}; asioext::error_code ec; asioext::read_file(test_filenamew, asio::buffer(buffer, test_data_size), ec); BOOST_REQUIRE(!ec); BOOST_CHECK_EQUAL(test_data, buffer); } #endif BOOST_AUTO_TEST_SUITE_END() ASIOEXT_NS_END
Operation: Restore Maximum Freedom (O:RMF) is a nonprofit all ages DIY music festival put on roughly twice a year by KDVS 90.3FM in Davis. This event has a rich history of bringing killer audio projects from the radiowaves of KDVS to the soundwaves of Plainfield Station, the venue chosen for its awesome burgers, cheap beer, and rural location in the middle of Yolo county. The music is still healthy in Sacto/Davis, where KDVS DJs fight the good fight against corporate hegemony of homogeny. Using freeform radio and a grand variety of live shows, we bring the best tunes to the region, as we have for decades. In todays Davis Politics political climate, while personal freedoms have been undermined by the current regime, one studentrun, communitypowered radio station has endeavored to make the most of what freedom is left; Freeform KDVS 90.3 FM in Davis has chosen to support the new, creative music of the most sincere artistic scruples, thereby offering a true, outstanding alternative choice to music fans who refuse to settle for less. For people whove grown weary of corporatecontrolled rebellion and partying in bars with bros brodawgs and hoochiemamas where every flash of the horns and socalled act of revelry is so formulaic and seemingly scripted Max Freedom offers you a totally different way to parties party. Plainfield Station is located at 23944 County Road 98, just across the bridge at the intersection of Road 98 & 29. Technically part of Woodland, it’s closer to Davis. From Davis, take 5th street/Russell blvd west, then turn right on Road 98 and travel north. From I80, take 113 north, then Road 29 west. Grill and beer bar, so bring cash for chow and cheer. If you don’t have a car, how the hell are you going to get out there? Easy. Tough up and ride your bike on the 5th street route, its only a few miles if youre not afraid of the people driving home from the bars at 10PM... Press http://www.newsreview.com/sacramento/freedomisntfreejust10/content?oid2032607 Freedom isnt free (just 10 bucks) SN&R 5/12/11 http://www.newsreview.com/sacramento/letmecountthegoodvibes/content?oid1854408 Let me count the good vibes SN&R 10/7/10 http://www.newsreview.com/sacramento/talkinboutfreedom/content?oid1282560 Talkin bout freedom SN&R 10/1/09 http://www.zumonline.com/zine/?x14 Operation: Restore Maximum Freedom VII Zum 5/16/09 http://theaggie.org/article/2996 Best Davis Event Aggie 2/19/09 (3rd place) http://www.sfbg.com/blogs/music/2008/10/operation_restore.html The Latest Mission? SFBG 11/07/08 http://www.newsreview.com/sacramento/Content?oid223095 Maximum Freedom Fighters SN&R 10/5/06 http://sfbayguardian.com/entry.php?catid85&entry_id1791 Restoration Hardcore SF Bay Guardian 10/3/06 http://www.sfgate.com/cgibin/blogs/sfgate/detail?blogid3&entry_id5730 Restore Maximum Freedom SF Gate 6/1/06 Operation: Restore Maximum Freedom 12 is on May 19th this year and is featuring the weirdest, sickest lineup yet. Check out the facebook: https://www.facebook.com/events/354341997949107/ and get your tickets early at either Delta of Venus or Records in Sacramento. The Future 20130518 (XIII) Rat Columns Insightful VerBS Sick Spits / OGC Fine Steps iji Healing Potpourri Malditos Caged Animal Pookie & the Poodlez Genuis Lotion Randy McKeans Wild Horsey Ride UC Davis Samba School UC Davis Gamelan Ensemble Past lineups 20120519 (XII) Dibia$e Raleigh Moncrief Twin Steps No Babies Yi World Hood Headboggle Brothers Amor West Nile Ramblers Buk Buk Bigups Burglars Mondo Lava UC Davis Gamelan Ensemble 20100514 (XI) R. Stevie Moore Zach Hill Appetite NO BUNNY Ellie Fortune Charles Albright Moonpearl Alak Kites Sail High Produce Produce Gaarth UC Davis Samba School 20101022 (X) AIDS WOLF The Ganglians Dreamdate Wounded Lion Super Wild Horses Mattress Greg Ashley Young Prisms Buk Buk Bigups Big Black Cloud Psychic Reality Random Abiladeze 20100523 (IX) AFrames X (Australia) Moon Duo Jacuzzi Boys Foot Village Chelsea Wolfe Robedoor Rank/Xerox Mucky the Ducky English Singles Delorean UC Davis Gamelan Ensemble October 3rd, 2009 (VIII) Rapes of Grath Post Mortem Vomit The American Splits Face the Rail MOM Foul Mouths Migraine New Thrill Parade Nothing People The Four Eyes G. Green The Mantles Yellow Fever May 16th, 2009 (VII) http://www.myspace.com/woodenshjips Wooden Shjips (SF) http://www.myspace.com/ohsees Thee Oh Sees (SF) http://www.myspace.com/luckydragons Lucky Dragons (LA) Mayyors (Sacramento) http://www.myspace.com/eternaltapestry Eternal Tapestry (Portland) http://www.myspace.com/methteethmusic Meth Teeth (Portland) http://www.myspace.com/stripmallseizures Strip Mall Seizures (Oakland) D.M.P.H. (Sacramento) http://www.myspace.com/1150715 The Nothing (SF) http://www.myspace.com/silverdarling Silver Darling (Sacramento) http://www.myspace.com/gloomprarie Pregnant (Placerville) http://www.myspace.com/quietourselves Please Quiet Ourselves (Berkeley) October 11th, 2008 LSD and the Search for God Traditional Fools Blackblack Hexlove Ohioan Incaore Beware of the Knight Countless Others Religous Girls San Fransisco Water Cooler June 2nd, 2007 Lemonade White Rainbow Righteous Movement Boss the Big Bit http://www.youtube.com/watch?v8SsYqPPKdnM (View Footage) The Standard Tribesman Black Fiction Griznar Music Collective Seekers Who Are Lovers Ghosting Valet Battleship Dead Western The Bananas Buildings Breeding Ovipositor San Kazakgascar Press: http://www.razorcake.org/site/modules.php?nameNews&filearticle&sid10744 Razorcake Review http://www.sfbg.com/blogs/music/2007/06/report_going_bananas_at_daviss_1.html San Francisco Bay Guardian Review October 7th, 2006 Kid 606 Third Sight Feat. DStyles Michael Hurley Scarcity of Tanks (feat. Michael Yonkers) LSD March (Japan) http://www.youtube.com/watch?vVHHhglAkRo (View Footage) New Rock Syndicate (Japan) http://www.youtube.com/watch?vSj46cqwQVtg (View Footage) Numbers Th Losin Streaks Hank IV Sic Alps Whos Your Favorite Son, God? The Weasel Walter Quartet Obo Martin The Trashies Big Sammy and Whoduk Haunted George June 3rd, 2006 http://www.outoforderrecords.com/opmax3.html (View Photos) The Advantage Erase Errata Clipd Beaks ...Worms Night Wounds Micose & the Mau Maus Ettrick http://www.youtube.com/watch?vPJ69YPoqjVs (View Footage) Oaxacan Eddie the Rat Art Lessing Sholi Betsy & the Teen Takeover The Megacools October 1st, 2005 http://www.outoforderrecords.com/opmax2.html (View Photos) http://www.pbase.com/pistolswing/kdvs_part2_2005 (More Photos) Growing Residual Echoes The Intelligence The Hospitals The Zebra Attack Mammatus Hustler White Wet Confetti The Rebel http://www.youtube.com/watch?v5TbntohLPHI (View Footage) Ezee Tiger Hot Girls, Cool Guys Kool Teen! May 21st, 2005 http://www.outoforderrecords.com/oprmf.html (View Photos) http://www.pbase.com/pistolswing/kdvs_2005 (More Photos) Sightings No Doctors Burmese A Hawk and a Hacksaw Death Sentence: Panda! Le Flange du Mal Zoms Zoms YipYip Walking in the Neon The Weegs Earn Your Feathers Black Dahlias Gift of Goats The Knightmares Hotel Pistol Eat the People Oh Dark Thirty Carquinez Straits Boss the Big Bit The Playboy Millionaires 20060531 12:55:40 nbsp Anyone carpooling to this? (Or does everyone bike home from Woodland at midnight?) Users/SteveDavison Perhaps freedom to get there/back safely isnt included. Why not have a shuttle bus for this? Just flash your concert ticket/stub and ride beteen the MU and Plainfield Station. (There was a 25cent bus taking people from the Domes to the Cannery last night, and this is further, later, involves alcohol, and is on highspeed bikelaneless roads.) I guess well just have to have a death to get this implemented; volunteers? Users/SteveDavison 20060531 13:19:41 nbsp Its not uncommon for people to ride their bikes. Last year some guys rode their bikes from Oakland. Users/ArlenAbraham Biking home from a bar(!) at night(!!) on a poorly lit road(!!!) with anemic bike lanes(!!!!) sounds like just about the unsafest thing ever. Users/TravisGrathwell To be fair, he didnt say it was a good idea, just that its not uncommon. Its not uncommon for people to get drunk at bars and drive home either. Since Im not trying out for the Darwin award at this time, I think Ill pass on the bike suggestion. Users/SteveDavison As far as bike safety is concerned, I know that the people from the Bay Area, Sacramento, and Davis who biked to the event numbered in the 20 range, and they all made it home safe without incident. The entire Davis bike contingent looked like an honesttogoodness peloton when I passed them on Road 29 at approximately 12:20 a.m. They had plenty of flashing lights, reflective fabrics, and safety in numbers. It looks like biking to Max Freedom will be a strong tradition as long as there is a Max Freedom. 20060601 01:43:22 nbsp question: is it $7 for students for both advance ticket purchases and at the door, or does the student rate only apply if students purchase in advance? Users/EliseKane Seems pretty clearly stated that its $7 for students either way. Therefore students would have no advantage in getting advance tickets, except if there was a possibility of selling out. For nonstudents, the price nearly doubles (why so steep?!). Users/SteveDavison I think everyone knows that the Plainfield Station wont sell out (they claim their backyard has a capacity of 700+), but some students do buy advance tickets if only so that we may have some momentum going into the event. For those of us organizing and working the event, advance ticket sales revenue greatly helps us to have a slush fund for lastminute needs, change for the door, and a good guage as far as how many people will eventually show up. This time, we had double the advance ticket revenue at the beginning. Three bands were able to be paid before we even welcomed one guest at the door. It gave us a sense of relief that the hard work would inevitably pay off, and we would not be forced to pay bands out of our own pockets. It is strange to me, however, that the price for this event might be considered steep. That we can do these festivals for so little money is actually just short of miraculous to me. This was 13 bands of quality and variety happening in a unique setting right in our own backyard. Meanwhile, the Heritage Festival was happening a few miles away...it, too, was an allday music event in a parklike setting. It cost $35 and featured Jackie Greene, Mumbo Gumbo, and a host of smoothed out blues and smoothed out jazz bands from the local area. Cigar bar fare. And, really, when you compare it to a lot of allday music festivals, $35 is on the cheap side. In any event, were really happy that so many people came to O:RMF III. We had an estimated 340 people there, plus 48 musicians...nearly 400 people took that portapotty #1 to the limit. The bands seemed really happy with the fans and Plainfield. We feel like O:RMF III gives us the momentum to make O:RMF IV the best time yet. Stay tuned here for more info on that as it develops. Thanks! Users/RickEle 20061004 13:16:52 nbsp Maximum Freedom IV is seriously one of the best music festivals on the west coast this year. For the price, great quality of diverse acts, and real noncorporate b.s., nothing beats it. Users/BrendanBoyle 20070603 15:07:53 nbsp What a great time! Thanks for the shuttle, too! ORMF is further proof that Davis beats the Bay Area hands down. Users/NoahPretentious 20120426 17:29:32 nbsp ORMF 12 is announced! Lineup above. May 19, 2012. SHOW YR PRETTY FACES Users/SharmiBasu
/** \file * Analyze CSA output traces responding to pulses for ENC evaluation. */ #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <math.h> #include <string.h> #include <unistd.h> #include <gsl/gsl_histogram2d.h> #include "common.h" #include "filters.h" #include "hdf5rawWaveformIo.h" typedef SCOPE_DATA_TYPE IN_WFM_BASE_TYPE; typedef SCOPE_DATA_TYPE OUT_WFM_BASE_TYPE; /** Parameters settable from commandline */ typedef struct param { size_t diffSep; //!< rise-time in samples for pulse finding double riseFrac; //!< fraction of max pulse height for pulse edge location double fltM; //!< exp decay constant for Trapezoidal filter size_t sPre; //!< samples before rising edge size_t sLen; //!< total number of samples of a pulse size_t sHscale; //!< histogram sample scaling factor } param_t; param_t param_default = { .diffSep = 150, .riseFrac = 0.5, .fltM = -1.0, .sPre = 1000, .sLen = 4000, .sHscale = 4 }; void print_usage(const param_t *pm) { printf("Usage:\n"); printf(" -r rise time in samples[%zd]\n", pm->diffSep); printf(" -f riseFrac[%g]\n", pm->riseFrac); printf(" -m fltM[%g]\n", pm->fltM); printf(" -p sPre[%zd]\n", pm->sPre); printf(" -l sLen[%zd]\n", pm->sLen); printf(" -s iStart[0] -e iStop[-1] starting and stopping(+1) eventid\n"); printf(" inFileName(.h5) outFileName\n"); } /** Find pulses by their rising edges. * * @param[out] npulse number of pulses found * @param[in] fltH input waveform should be loaded into it already * @param[in] diffSep basically the rise time in samples * @param[in] riseFrac fraction of max pulse height to set pulse edge location * @param[in] M exp decay constant for Trapezoidal filter * @return the list of rising edge positions (times) */ size_t *find_pulses(size_t *npulse, filters_t *fltH, size_t diffSep, double riseFrac, double M) { size_t n, nc = 1024; size_t *pulseRiseT = NULL, *pulseRiseT1; size_t flt_k = 2*diffSep, flt_l = 2*flt_k; double flt_M = M, max, dV; ssize_t i, j, sep, prev; if((pulseRiseT = calloc(nc, sizeof(size_t))) == NULL) { error_printf("calloc failed for pulseRiseT in %s()\n", __FUNCTION__); return NULL; } filters_trapezoidal(fltH, flt_k, flt_l, flt_M); max = 0.0; for(i=0; i<fltH->wavLen; i++) if(fltH->outWav[i] > max) max = fltH->outWav[i]; sep = flt_k + flt_l; prev = 0; n = 0; for(i=0; i<fltH->wavLen; i++) { j = ((i+diffSep)>=fltH->wavLen)?(fltH->wavLen-1):(i+diffSep); dV = fltH->inWav[j] - fltH->inWav[i]; if(dV > max * riseFrac) { if(i-prev > sep) { pulseRiseT[n] = j; n++; if(n >= nc) { nc *= 2; if((pulseRiseT1 = realloc(pulseRiseT, nc * sizeof(size_t))) == NULL) { error_printf("realloc failed for pulseRiseT in %s()\n", __FUNCTION__); *npulse = n; return pulseRiseT; } pulseRiseT = pulseRiseT1; } prev = i; } } } *npulse = n; return pulseRiseT; } int main(int argc, char **argv) { int optC = 0; param_t pm; char *inFileName, *outFileName; struct hdf5rawWaveformIo_waveform_file *inWfmFile; struct waveform_attribute inWfmAttr; struct hdf5rawWaveformIo_waveform_event inWfmEvent; IN_WFM_BASE_TYPE *inWfmBuf; // OUT_WFM_BASE_TYPE *outWfmBuf; filters_t *fltHdl; ssize_t iStart=0, iStop=-1, i, j, k, iCh; size_t nEventsInFile, chGrpLen, npulse, *pulseRiseT, nSep; unsigned int v, c; size_t chGrpIdx[SCOPE_NCH] = {0}; double frameSize, val, sep, sepMu, sepSigma; gsl_histogram2d *wav2H, *flt2H; memcpy(&pm, &param_default, sizeof(pm)); // parse switches while((optC = getopt(argc, argv, "e:f:l:m:p:r:s:")) != -1) { switch(optC) { case 'e': iStop = atoll(optarg); break; case 'f': pm.riseFrac = atof(optarg); break; case 'l': pm.sLen = atoll(optarg); break; case 'm': pm.fltM = atof(optarg); break; case 'p': pm.sPre = atoll(optarg); break; case 'r': pm.diffSep = atoll(optarg); break; case 's': iStart = atoll(optarg); break; default: print_usage(&pm); return EXIT_FAILURE; break; } } argc -= optind; argv += optind; if(argc<2 || argc>=3) { print_usage(&pm); return EXIT_FAILURE; } inFileName = argv[0]; outFileName = argv[1]; inWfmFile = hdf5rawWaveformIo_open_file_for_read(inFileName); hdf5rawWaveformIo_read_waveform_attribute_in_file_header(inWfmFile, &inWfmAttr); fprintf(stderr, "waveform_attribute:\n" " chMask = 0x%04x\n" " nPt = %zd\n" " nFrames = %zd\n" " dt = %g\n" " t0 = %g\n" " ymult = %g %g %g %g\n" " yoff = %g %g %g %g\n" " yzero = %g %g %g %g\n", inWfmAttr.chMask, inWfmAttr.nPt, inWfmAttr.nFrames, inWfmAttr.dt, inWfmAttr.t0, inWfmAttr.ymult[0], inWfmAttr.ymult[1], inWfmAttr.ymult[2], inWfmAttr.ymult[3], inWfmAttr.yoff[0], inWfmAttr.yoff[1], inWfmAttr.yoff[2], inWfmAttr.yoff[3], inWfmAttr.yzero[0], inWfmAttr.yzero[1], inWfmAttr.yzero[2], inWfmAttr.yzero[3]); nEventsInFile = hdf5rawWaveformIo_get_number_of_events(inWfmFile); fprintf(stderr, "Number of events in file: %zd\n", nEventsInFile); if(iStart < 0) iStart = 0; if(iStart >= nEventsInFile) iStart = nEventsInFile - 1; if(iStop < 0) iStop = nEventsInFile; if(iStop <= iStart) iStop = iStart + 1; if(inWfmAttr.nFrames > 0) { frameSize = inWfmAttr.nPt / (double)inWfmAttr.nFrames; } else { frameSize = (double)inWfmAttr.nPt; } v = inWfmAttr.chMask; for(c=0; v; c++) v &= v - 1; /* Brian Kernighan's way of counting bits */ chGrpLen = inWfmFile->nCh / c; i=0; for(v=0; v<SCOPE_NCH; v++) if((inWfmAttr.chMask >> v) & 0x01) { chGrpIdx[i] = v; i++; } inWfmBuf = (IN_WFM_BASE_TYPE*)malloc(inWfmFile->nPt * inWfmFile->nCh * sizeof(IN_WFM_BASE_TYPE)); inWfmEvent.wavBuf = inWfmBuf; fltHdl = filters_init(NULL, inWfmFile->nPt); wav2H = gsl_histogram2d_alloc(pm.sLen/pm.sHscale, 128); gsl_histogram2d_set_ranges_uniform(wav2H, -0.5 * inWfmAttr.dt, (pm.sLen+0.5) * inWfmAttr.dt, inWfmAttr.yzero[chGrpIdx[0]] + (-128.5 - inWfmAttr.yoff[chGrpIdx[0]]) * inWfmAttr.ymult[chGrpIdx[0]], inWfmAttr.yzero[chGrpIdx[0]] + ( 127.5 - inWfmAttr.yoff[chGrpIdx[0]]) * inWfmAttr.ymult[chGrpIdx[0]]); flt2H = gsl_histogram2d_alloc(pm.sLen/pm.sHscale, 256); gsl_histogram2d_set_ranges_uniform(flt2H, -0.5 * inWfmAttr.dt, (pm.sLen+0.5) * inWfmAttr.dt, -0.01, -0.01 + 256 * inWfmAttr.ymult[chGrpIdx[0]]); nSep = 0; sepMu = 0.0; sepSigma = 0.0; for(inWfmEvent.eventId = iStart; inWfmEvent.eventId < iStop; inWfmEvent.eventId++) { hdf5rawWaveformIo_read_event(inWfmFile, &inWfmEvent); for(iCh=0; iCh < 1 /* inWfmFile->nCh */; iCh++) { for(i=0; i<inWfmFile->nPt; i++) { val = (inWfmBuf[(size_t)(iCh * inWfmFile->nPt + i)] - inWfmAttr.yoff[chGrpIdx[iCh]]) * inWfmAttr.ymult[chGrpIdx[iCh]] + inWfmAttr.yzero[chGrpIdx[iCh]]; fltHdl->inWav[i] = val; } } pulseRiseT = find_pulses(&npulse, fltHdl, pm.diffSep, pm.riseFrac, pm.fltM); fprintf(stderr, "eventId = %zd, npulse = %zd, first at %zd\n", inWfmEvent.eventId, npulse, pulseRiseT[0]); for(i=0; i<npulse-1; i++) { sep = pulseRiseT[i+1] - pulseRiseT[i]; sepMu += sep; sepSigma += sep * sep; nSep++; } for(i=1; i<npulse-1; i++) { for(j=0; j<pm.sLen; j++) { k = pulseRiseT[i]-pm.sPre + j; gsl_histogram2d_increment(wav2H, j*inWfmAttr.dt, fltHdl->inWav[k]); gsl_histogram2d_increment(flt2H, j*inWfmAttr.dt, fltHdl->outWav[k]); } } free(pulseRiseT); } sepMu /= (double)nSep; sepSigma = sqrt(1.0/(double)(nSep-1) * (sepSigma - nSep * sepMu * sepMu)); printf("nSep = %zd, sepMu = %g, sepSigma = %g\n", nSep, sepMu, sepSigma); FILE *ofp; if((ofp = fopen(outFileName, "w"))==NULL) { perror(outFileName); goto Exit; } gsl_histogram2d_fprintf(ofp, wav2H, "%24.16e", "%g"); fprintf(ofp, "\n\n"); gsl_histogram2d_fprintf(ofp, flt2H, "%24.16e", "%g"); fprintf(ofp, "\n\n"); fprintf(ofp, "# baseline distribution"); double yl, yu; for(i=0; i<gsl_histogram2d_ny(wav2H); i++) { gsl_histogram2d_get_yrange(wav2H, i, &yl, &yu); fprintf(ofp, "%24.16e, %g\n", yl, gsl_histogram2d_get(wav2H, 0, i)); } fprintf(ofp, "\n\n"); fprintf(ofp, "# filtered distribution"); for(i=0; i<gsl_histogram2d_ny(flt2H); i++) { gsl_histogram2d_get_yrange(flt2H, i, &yl, &yu); fprintf(ofp, "%24.16e, %g\n", yl, gsl_histogram2d_get(flt2H, (pm.sPre+3*pm.diffSep)/pm.sHscale, i)); } fclose(ofp); Exit: free(inWfmBuf); inWfmBuf = NULL; gsl_histogram2d_free(wav2H); gsl_histogram2d_free(flt2H); filters_close(fltHdl); hdf5rawWaveformIo_close_file(inWfmFile); return EXIT_SUCCESS; }
/- Copyright (c) 2021 Markus Himmel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ import category_theory.monoidal.free.basic import category_theory.discrete_category /-! # The monoidal coherence theorem In this file, we prove the monoidal coherence theorem, stated in the following form: the free monoidal category over any type `C` is thin. We follow a proof described by Ilya Beylin and Peter Dybjer, which has been previously formalized in the proof assistant ALF. The idea is to declare a normal form (with regard to association and adding units) on objects of the free monoidal category and consider the discrete subcategory of objects that are in normal form. A normalization procedure is then just a functor `full_normalize : free_monoidal_category C ⥤ discrete (normal_monoidal_object C)`, where functoriality says that two objects which are related by associators and unitors have the same normal form. Another desirable property of a normalization procedure is that an object is isomorphic (i.e., related via associators and unitors) to its normal form. In the case of the specific normalization procedure we use we not only get these isomorphismns, but also that they assemble into a natural isomorphism `𝟭 (free_monoidal_category C) ≅ full_normalize ⋙ inclusion`. But this means that any two parallel morphisms in the free monoidal category factor through a discrete category in the same way, so they must be equal, and hence the free monoidal category is thin. ## References * [Ilya Beylin and Peter Dybjer, Extracting a proof of coherence for monoidal categories from a proof of normalization for monoids][beylin1996] -/ universe u namespace category_theory open monoidal_category namespace free_monoidal_category variables {C : Type u} section variables (C) /-- We say an object in the free monoidal category is in normal form if it is of the form `(((𝟙_ C) ⊗ X₁) ⊗ X₂) ⊗ ⋯`. -/ @[nolint has_inhabited_instance] inductive normal_monoidal_object : Type u | unit : normal_monoidal_object | tensor : normal_monoidal_object → C → normal_monoidal_object end local notation `F` := free_monoidal_category local notation `N` := discrete ∘ normal_monoidal_object local infixr ` ⟶ᵐ `:10 := hom /-- Auxiliary definition for `inclusion`. -/ @[simp] def inclusion_obj : normal_monoidal_object C → F C | normal_monoidal_object.unit := unit | (normal_monoidal_object.tensor n a) := tensor (inclusion_obj n) (of a) /-- The discrete subcategory of objects in normal form includes into the free monoidal category. -/ @[simp] def inclusion : N C ⥤ F C := discrete.functor inclusion_obj /-- Auxiliary definition for `normalize`. -/ @[simp] def normalize_obj : F C → normal_monoidal_object C → normal_monoidal_object C | unit n := n | (of X) n := normal_monoidal_object.tensor n X | (tensor X Y) n := normalize_obj Y (normalize_obj X n) @[simp] lemma normalize_obj_unitor (n : N C) : normalize_obj (𝟙_ (F C)) n = n := rfl @[simp] lemma normalize_obj_tensor (X Y : F C) (n : N C) : normalize_obj (X ⊗ Y) n = normalize_obj Y (normalize_obj X n) := rfl section open hom /-- Auxiliary definition for `normalize`. Here we prove that objects that are related by associators and unitors map to the same normal form. -/ @[simp] def normalize_map_aux : Π {X Y : F C}, (X ⟶ᵐ Y) → ((discrete.functor (normalize_obj X) : _ ⥤ N C) ⟶ discrete.functor (normalize_obj Y)) | _ _ (id _) := 𝟙 _ | _ _ (α_hom _ _ _) := ⟨λ X, 𝟙 _⟩ | _ _ (α_inv _ _ _) := ⟨λ X, 𝟙 _⟩ | _ _ (l_hom _) := ⟨λ X, 𝟙 _⟩ | _ _ (l_inv _) := ⟨λ X, 𝟙 _⟩ | _ _ (ρ_hom _) := ⟨λ X, 𝟙 _⟩ | _ _ (ρ_inv _) := ⟨λ X, 𝟙 _⟩ | X Y (@comp _ U V W f g) := normalize_map_aux f ≫ normalize_map_aux g | X Y (@hom.tensor _ T U V W f g) := ⟨λ X, (normalize_map_aux g).app (normalize_obj T X) ≫ (discrete.functor (normalize_obj W) : _ ⥤ N C).map ((normalize_map_aux f).app X), by tidy⟩ end section variables (C) /-- Our normalization procedure works by first defining a functor `F C ⥤ (N C ⥤ N C)` (which turns out to be very easy), and then obtain a functor `F C ⥤ N C` by plugging in the normal object `𝟙_ C`. -/ @[simp] def normalize : F C ⥤ N C ⥤ N C := { obj := λ X, discrete.functor (normalize_obj X), map := λ X Y, quotient.lift normalize_map_aux (by tidy) } /-- A variant of the normalization functor where we consider the result as an object in the free monoidal category (rather than an object of the discrete subcategory of objects in normal form). -/ @[simp] def normalize' : F C ⥤ N C ⥤ F C := normalize C ⋙ (whiskering_right _ _ _).obj inclusion /-- The normalization functor for the free monoidal category over `C`. -/ def full_normalize : F C ⥤ N C := { obj := λ X, ((normalize C).obj X).obj normal_monoidal_object.unit, map := λ X Y f, ((normalize C).map f).app normal_monoidal_object.unit } /-- Given an object `X` of the free monoidal category and an object `n` in normal form, taking the tensor product `n ⊗ X` in the free monoidal category is functorial in both `X` and `n`. -/ @[simp] def tensor_func : F C ⥤ N C ⥤ F C := { obj := λ X, discrete.functor (λ n, (inclusion.obj n) ⊗ X), map := λ X Y f, ⟨λ n, 𝟙 _ ⊗ f, by tidy⟩ } lemma tensor_func_map_app {X Y : F C} (f : X ⟶ Y) (n) : ((tensor_func C).map f).app n = 𝟙 _ ⊗ f := rfl lemma tensor_func_obj_map (Z : F C) {n n' : N C} (f : n ⟶ n') : ((tensor_func C).obj Z).map f = inclusion.map f ⊗ 𝟙 Z := by tidy /-- Auxiliary definition for `normalize_iso`. Here we construct the isomorphism between `n ⊗ X` and `normalize X n`. -/ @[simp] def normalize_iso_app : Π (X : F C) (n : N C), ((tensor_func C).obj X).obj n ≅ ((normalize' C).obj X).obj n | (of X) n := iso.refl _ | unit n := ρ_ _ | (tensor X Y) n := (α_ _ _ _).symm ≪≫ tensor_iso (normalize_iso_app X n) (iso.refl _) ≪≫ normalize_iso_app _ _ @[simp] lemma normalize_iso_app_tensor (X Y : F C) (n : N C) : normalize_iso_app C (X ⊗ Y) n = (α_ _ _ _).symm ≪≫ tensor_iso (normalize_iso_app C X n) (iso.refl _) ≪≫ normalize_iso_app _ _ _ := rfl @[simp] lemma normalize_iso_app_unitor (n : N C) : normalize_iso_app C (𝟙_ (F C)) n = ρ_ _ := rfl /-- Auxiliary definition for `normalize_iso`. -/ @[simp] def normalize_iso_aux (X : F C) : (tensor_func C).obj X ≅ (normalize' C).obj X := nat_iso.of_components (normalize_iso_app C X) (by tidy) /-- The isomorphism between `n ⊗ X` and `normalize X n` is natural (in both `X` and `n`, but naturality in `n` is trivial and was "proved" in `normalize_iso_aux`). This is the real heart of our proof of the coherence theorem. -/ def normalize_iso : tensor_func C ≅ normalize' C := nat_iso.of_components (normalize_iso_aux C) begin rintros X Y f, apply quotient.induction_on f, intro f, ext n, induction f generalizing n, { simp only [mk_id, functor.map_id, category.id_comp, category.comp_id] }, { dsimp, simp only [id_tensor_associator_inv_naturality_assoc, ←pentagon_inv_assoc, tensor_hom_inv_id_assoc, tensor_id, category.id_comp, discrete.functor_map_id, comp_tensor_id, iso.cancel_iso_inv_left, category.assoc], dsimp, simp only [category.comp_id] }, { dsimp, simp only [discrete.functor_map_id, comp_tensor_id, category.assoc, pentagon_inv_assoc, ←associator_inv_naturality_assoc, tensor_id, iso.cancel_iso_inv_left], dsimp, simp only [category.comp_id],}, { dsimp, rw triangle_assoc_comp_right_assoc, simp only [discrete.functor_map_id, category.assoc], dsimp, simp only [category.comp_id] }, { dsimp, simp only [triangle_assoc_comp_left_inv_assoc, inv_hom_id_tensor_assoc, tensor_id, category.id_comp, discrete.functor_map_id], dsimp, simp only [category.comp_id] }, { dsimp, rw [←(iso.inv_comp_eq _).2 (right_unitor_tensor _ _), category.assoc, ←right_unitor_naturality], simp only [discrete.functor_map_id, iso.cancel_iso_inv_left, category.assoc], dsimp, simp only [category.comp_id] }, { dsimp, simp only [←(iso.eq_comp_inv _).1 (right_unitor_tensor_inv _ _), iso.hom_inv_id_assoc, right_unitor_conjugation, discrete.functor_map_id, category.assoc], dsimp, simp only [category.comp_id], }, { dsimp at *, rw [id_tensor_comp, category.assoc, f_ih_g ⟦f_g⟧, ←category.assoc, f_ih_f ⟦f_f⟧, category.assoc, ←functor.map_comp], congr' 2 }, { dsimp at *, rw associator_inv_naturality_assoc, slice_lhs 2 3 { rw [←tensor_comp, f_ih_f ⟦f_f⟧] }, conv_lhs { rw [←@category.id_comp (F C) _ _ _ ⟦f_g⟧] }, simp only [category.comp_id, tensor_comp, category.assoc], congr' 2, rw [←mk_tensor, quotient.lift_mk], dsimp, rw [functor.map_comp, ←category.assoc, ←f_ih_g ⟦f_g⟧, ←@category.comp_id (F C) _ _ _ ⟦f_g⟧, ←category.id_comp ((discrete.functor inclusion_obj).map _), tensor_comp], dsimp, simp only [category.assoc, category.comp_id], congr' 1, convert (normalize_iso_aux C f_Z).hom.naturality ((normalize_map_aux f_f).app n), exact (tensor_func_obj_map _ _ _).symm } end /-- The isomorphism between an object and its normal form is natural. -/ def full_normalize_iso : 𝟭 (F C) ≅ full_normalize C ⋙ inclusion := nat_iso.of_components (λ X, (λ_ X).symm ≪≫ ((normalize_iso C).app X).app normal_monoidal_object.unit) begin intros X Y f, dsimp, rw [left_unitor_inv_naturality_assoc, category.assoc, iso.cancel_iso_inv_left], exact congr_arg (λ f, nat_trans.app f normal_monoidal_object.unit) ((normalize_iso.{u} C).hom.naturality f), end end /-- The monoidal coherence theorem. -/ instance subsingleton_hom {X Y : F C} : subsingleton (X ⟶ Y) := ⟨λ f g, have (full_normalize C).map f = (full_normalize C).map g, from subsingleton.elim _ _, begin rw [←functor.id_map f, ←functor.id_map g], simp [←nat_iso.naturality_2 (full_normalize_iso.{u} C), this] end⟩ section groupoid section open hom /-- Auxiliary construction for showing that the free monoidal category is a groupoid. Do not use this, use `is_iso.inv` instead. -/ def inverse_aux : Π {X Y : F C}, (X ⟶ᵐ Y) → (Y ⟶ᵐ X) | _ _ (id X) := id X | _ _ (α_hom _ _ _) := α_inv _ _ _ | _ _ (α_inv _ _ _) := α_hom _ _ _ | _ _ (ρ_hom _) := ρ_inv _ | _ _ (ρ_inv _) := ρ_hom _ | _ _ (l_hom _) := l_inv _ | _ _ (l_inv _) := l_hom _ | _ _ (comp f g) := (inverse_aux g).comp (inverse_aux f) | _ _ (hom.tensor f g) := (inverse_aux f).tensor (inverse_aux g) end instance : groupoid.{u} (F C) := { inv := λ X Y, quotient.lift (λ f, ⟦inverse_aux f⟧) (by tidy), ..(infer_instance : category (F C)) } end groupoid end free_monoidal_category end category_theory
/* ** ECM - eigenvector centrality mapping using full matrix ** ** G.Lohmann, MPI-KYB, Nov 2018 */ #include <viaio/Vlib.h> #include <viaio/VImage.h> #include <viaio/mu.h> #include <viaio/option.h> #include <gsl/gsl_matrix.h> #include <gsl/gsl_vector.h> #include <gsl/gsl_errno.h> #include <gsl/gsl_cblas.h> #include <gsl/gsl_blas.h> #include <stdio.h> #include <stdlib.h> #include <math.h> #ifdef _OPENMP #include <omp.h> #endif /*_OPENMP*/ #define SQR(x) ((x) * (x)) /* check if matrix is irreducible. ** If it is not, then Perron-Frobenius theorem does not apply */ void CheckReducibility(float *A,size_t nvox) { size_t i,j,k,n; float umin = 99999; n=0; for (i=0; i<nvox; i++) { for (j=0; j<i; j++) { k=j+i*(i+1)/2; if (A[k] > 0) n++; if (A[k] > 0 && A[k] < umin) umin = A[k]; } for (j=i+1; j<nvox; j++) { k=i+j*(j+1)/2; if (A[k] > 0) n++; } } if (n < nvox) { VWarning(" matrix is not irreducible, correction term is applied."); for (i=0; i<nvox; i++) { for (j=0; j<i; j++) { k=j+i*(i+1)/2; if (A[k] < umin) A[k] = umin*0.5; } } } } /* re-implementation of cblas_sspmv, cblas_sspmv causes problems */ void my_sspmv(float *A,float *x,float *y,size_t n) { size_t i,j,k,kk; float tmp1=0,tmp2=0; kk = k = 0; for (j=0; j<n; j++) { y[j] = 0; tmp1 = x[j]; tmp2 = 0; k = kk; for (i=0; i<j; i++) { y[i] += tmp1 * A[k]; tmp2 += A[k] * x[i]; k++; } y[j] += tmp1*A[kk+j] + tmp2; kk += (j+1); } } void MatrixPowerIteration(float *A,float *ev,size_t nvox,int maxiter) { int i,iter; float sum,d,nx; fprintf(stderr," power iteration...\n"); float *y = (float *) VCalloc(nvox,sizeof(float)); nx = (double)nvox; for (i=0; i<nvox; i++) ev[i] = y[i] = 1.0/nx; for (iter=0; iter < maxiter; iter++) { /* y = Ax, A symmetric and lower-triangular */ /* cblas_sspmv(CblasRowMajor,CblasLower,(int)n,1.0f,A,ev,1,1.0f,y,1); */ my_sspmv(A,ev,y,nvox); /* normalize */ sum = 0; for (i=0; i<nvox; i++) sum += y[i]*y[i]; sum = sqrt(sum); /* check convergence */ d = 0; for (i=0; i<nvox; i++) { y[i] /= sum; d += SQR(ev[i] - y[i]); ev[i] = y[i]; } fprintf(stderr," %5d %f\n",(int)iter,d); if (iter > 2 && d < 1.0e-6) break; } VFree(y); } float CorrMetric(float z,int type) { switch (type) { case 1: /* add */ z += 1.0; break; case 2: /* pos */ if (z < 0) z = 0; break; case 3: /* abs */ z = fabs(z); break; case 4: /* neg */ if (z < 0) z = -z; else z = 0; break; default: VError("illegal type"); } return z; } double ECMcorrelation(const float *arr1,const float *arr2,size_t nt,int type) { size_t i; double sum=0,z=0,kx=(double)nt; if ((type > 0 && type < 5) || (type==6)) { sum=0; for (i=0; i<nt; i++) { const double u = (double)arr1[i]; const double v = (double)arr2[i]; sum += u*v; } z = sum/kx; } switch (type) { case 0: /* RLC positive */ sum=0; for (i=0; i<nt; i++) { const double u = (double)arr1[i]; const double v = (double)arr2[i]; sum += u*v + fabs(u*v); } z = sum/(2.0*kx); break; case 1: /* add */ z += 1.0; break; case 2: /* pos */ if (z < 0) z = 0; break; case 3: /* abs */ z = fabs(z); break; case 4: /* neg */ if (z < 0) z = -z; else z = 0; break; case 5: /* Gaussian of Euclidean distance */ sum=0; for (i=0; i<nt; i++) { const double u = (double)arr1[i]; const double v = (double)arr2[i]; const double d = u-v; sum += d*d; } z = sum/kx; z = exp(-0.5*z*z); break; case 7: /* RLC negative */ sum=0; for (i=0; i<nt; i++) { const double u = (double)arr1[i]; const double v = (double)arr2[i]; sum += (fabs(u*v) - u*v); } z = sum/(2.0*kx); break; default: ; } return z; } void VMatrixECM(gsl_matrix_float *X,float *ev,int type,int maxiter,VImage map) { size_t i,j; size_t nvox = X->size1; size_t nt = X->size2; /* compute similarity matrix */ size_t m = (nvox*(nvox+1))/2; float *A = (float *) calloc(m,sizeof(float)); if (!A) VError(" err allocating correlation matrix (too big)"); memset(A,0,m*sizeof(float)); size_t progress=0; #pragma omp parallel for shared(progress) private(j) schedule(guided) firstprivate(X,A) for (i=0; i<nvox; i++) { if (i%1000 == 0) fprintf(stderr," %d000 of %lu\r",(int)(++progress),nvox); const float *arr1 = gsl_matrix_float_const_ptr(X,i,0); for (j=0; j<=i; j++) { if (i == j) continue; const float *arr2 = gsl_matrix_float_const_ptr(X,j,0); const double v = ECMcorrelation(arr1,arr2,nt,type); const size_t k=j+i*(i+1)/2; A[k] = v; } } fprintf(stderr,"\n"); /* CheckReducibility(A,nvox); */ /* DMN(map,A,nvox); */ /* power iteration */ MatrixPowerIteration(A,ev,nvox,maxiter); VFree(A); }
theory TemporalConditionalMode imports Main Free_Boolean_Algebra begin notation bot ("\<bottom>") and top ("\<top>") and inf (infixl "\<sqinter>" 70) and sup (infixl "\<squnion>" 65) type_synonym 'a tval = "'a list set" primrec before_op_list :: "'a \<Rightarrow> 'a \<Rightarrow> 'a list \<Rightarrow> bool" where "before_op_list _ _ [] = False" | "before_op_list a b (x # xs) = ((a = x \<and> b \<in> set xs) \<or> (before_op_list a b xs))" inductive_set ta :: "'a tval set" where tvar: "{ ls . distinct ls \<and> a \<in> set ls } \<in> ta" | Compl: "S \<in> ta \<Longrightarrow> - S \<in> ta" | inter: "S \<in> ta \<Longrightarrow> T \<in> ta \<Longrightarrow> S \<inter> T \<in> ta" lemma ta_Diff: "S \<in> ta \<Longrightarrow> T \<in> ta \<Longrightarrow> S - T \<in> ta" unfolding Diff_eq by (intro ta.inter ta.Compl) lemma ta_union: "S \<in> ta \<Longrightarrow> T \<in> ta \<Longrightarrow> S \<union> T \<in> ta" proof - assume "S \<in> ta" and "T \<in> ta" hence "- (- S \<inter> - T) \<in> ta" by (intro ta.intros) thus "S \<union> T \<in> ta" by simp qed lemma ta_empty: "({} :: 'a tval) \<in> ta" proof - obtain S :: "'a tval" where "S \<in> ta" by (fast intro: ta.tvar) hence "S \<inter> -S \<in> ta" by (intro ta.intros) thus ?thesis by simp qed lemma ta_UNIV: "(UNIV :: 'a tval) \<in> ta" proof - have "- {} \<in> ta" using ta_empty by (rule ta.Compl) thus "UNIV \<in> ta" by simp qed (*definition value_prefix :: "'a \<Rightarrow> 'a tval \<Rightarrow> 'a tval" where "value_prefix a R \<equiv> { a # rs | rs . rs \<in> R \<and> a \<notin> set rs }" lemma " lemma "\<lbrakk> R \<in> (ta::'a tval set) \<rbrakk> \<Longrightarrow> value_prefix (a::'a) R \<in> ta" apply (auto simp add: value_prefix_def ) apply (erule ta.induct) apply (auto simp add: CollectI) done *) definition safe_concat :: "'a list \<Rightarrow> 'a list \<Rightarrow> bool" where "safe_concat ls rs \<equiv> (set ls \<inter> set rs = {})" definition tval_prefix :: "'a tval \<Rightarrow> 'a tval \<Rightarrow> 'a tval" where "tval_prefix L R \<equiv> { ls @ rs | ls rs . ls \<in> L \<and> rs \<in> R \<and> (safe_concat ls rs) }" lemmas tval_prefix_defs = tval_prefix_def safe_concat_def lemma "\<lbrakk> L \<in> ta; R \<in> ta \<rbrakk> \<Longrightarrow> tval_prefix L R \<in> ta" apply (auto simp add: tval_prefix_defs ) apply (erule ta.induct) apply (erule ta.induct) apply ( simp add: CollectI) sledgehammer done typedef 'a tformula = "ta :: 'a tval set" by (auto intro: ta_empty) definition tvar :: "'a \<Rightarrow> 'a tformula" where "tvar a = Abs_tformula { ls . distinct ls \<and> a \<in> set ls }" lemma Rep_tformula_tvar : "Rep_tformula (tvar a) = { ls . distinct ls \<and> a \<in> set ls }" unfolding tvar_def using ta.tvar by (rule Abs_tformula_inverse) definition before :: "'a \<Rightarrow> 'a tformula" where "before a = Abs_tformula { ls | ls b . distinct ls \<and> before_op_list a b ls }" text {* @{term tformula } as a @{term boolean_algebra } *} instantiation tformula :: (type) boolean_algebra begin definition "x \<sqinter> y = Abs_tformula (Rep_tformula x \<inter> Rep_tformula y)" definition "x \<squnion> y = Abs_tformula (Rep_tformula x \<union> Rep_tformula y)" definition "\<top> = Abs_tformula UNIV" definition "\<bottom> = Abs_tformula {}" definition "x \<le> y \<longleftrightarrow> Rep_tformula x \<subseteq> Rep_tformula y" definition "x < y \<longleftrightarrow> Rep_tformula x \<subset> Rep_tformula y" definition "- x = Abs_tformula (- Rep_tformula x)" definition "x - y = Abs_tformula (Rep_tformula x - Rep_tformula y)" lemma Rep_tformula_inf: "Rep_tformula (x \<sqinter> y) = Rep_tformula x \<inter> Rep_tformula y" unfolding inf_tformula_def by (intro Abs_tformula_inverse ta.inter Rep_tformula) lemma Rep_tformula_sup: "Rep_tformula (x \<squnion> y) = Rep_tformula x \<union> Rep_tformula y" unfolding sup_tformula_def by (intro Abs_tformula_inverse ta_union Rep_tformula) lemma Rep_tformula_top: "Rep_tformula \<top> = UNIV" unfolding top_tformula_def by (intro Abs_tformula_inverse ta_UNIV) lemma Rep_tformula_bot: "Rep_tformula \<bottom> = {}" unfolding bot_tformula_def by (intro Abs_tformula_inverse ta_empty) lemma Rep_tformula_compl: "Rep_tformula (- x) = - Rep_tformula x" unfolding uminus_tformula_def by (intro Abs_tformula_inverse ta.Compl Rep_tformula) lemma Rep_tformula_diff: "Rep_tformula (x - y) = Rep_tformula x - Rep_tformula y" unfolding minus_tformula_def by (intro Abs_tformula_inverse ta_Diff Rep_tformula) lemmas eq_tformula_iff = Rep_tformula_inject [symmetric] lemmas Rep_tformula_simps = less_eq_tformula_def less_tformula_def eq_tformula_iff Rep_tformula_sup Rep_tformula_inf Rep_tformula_top Rep_tformula_bot Rep_tformula_compl Rep_tformula_diff Rep_tformula_tvar instance proof qed (unfold Rep_tformula_simps, auto) end lemma bot_neq_top_tformula [simp]: "(\<bottom> :: 'a tformula) \<noteq> \<top>" unfolding Rep_tformula_simps by auto lemma top_neq_bot_tformula [simp]: "(\<top> :: 'a tformula) \<noteq> \<bottom>" unfolding Rep_tformula_simps by auto lemma tvar_le_tvar_simps [simp]: "tvar x \<le> tvar y \<longleftrightarrow> x = y" "\<not> tvar x \<le> - tvar y" "\<not> - tvar x \<le> tvar y " unfolding Rep_tformula_simps apply (auto) apply (auto simp add: subset_iff) apply (metis distinct_remdups empty_iff in_set_member list.set(1) member_rec(1) set_remdups) apply (metis distinct_remdups insertCI set_remdups set_simps(2)) apply (metis distinct.simps(2)) done lemma tvar_eq_tvar_simps [simp]: "tvar x = tvar y \<longleftrightarrow> x = y" "tvar x \<noteq> - tvar y" "- tvar x \<noteq> tvar y" unfolding Rep_tformula_simps apply (metis (full_types) tvar_def tvar_le_tvar_simps(1)) apply (metis Rep_tformula_tvar tvar_def uminus_tformula_def tvar_le_tvar_simps(1) tvar_le_tvar_simps(3)) apply (metis Rep_tformula_tvar tvar_def uminus_tformula_def tvar_le_tvar_simps(1) tvar_le_tvar_simps(3)) done (* before: "{ ls | ls b . distinct ls \<and> before a b ls } \<in> ta" | *) lemma tformula_induct [case_names tvar compl inf , induct type: tformula]: fixes P :: "'a tformula \<Rightarrow> bool" assumes 1: "\<And>i. P (tvar i)" assumes 2: "\<And>x. P x \<Longrightarrow> P (- x)" assumes 3: "\<And>x y. P x \<Longrightarrow> P y \<Longrightarrow> P (x \<sqinter> y)" shows "P x" proof (induct x rule: Abs_tformula_induct) fix y :: "'a list set" assume "y \<in> ta" thus "P (Abs_tformula y)" proof (induct rule: ta.induct) case (tvar i) have "P (tvar i)" by (rule 1) thus ?case unfolding tvar_def . next case (Compl S) from `P (Abs_tformula S)` have "P (- Abs_tformula S)" by (rule 2) with `S \<in> ta` show ?case unfolding uminus_tformula_def by (simp add: Abs_tformula_inverse) next case (inter S T) from `P (Abs_tformula S)` and `P (Abs_tformula T)` have "P (Abs_tformula S \<sqinter> Abs_tformula T)" by (rule 3) with `S \<in> ta` and `T \<in> ta` show ?case unfolding inf_tformula_def by (simp add: Abs_tformula_inverse) qed qed definition tformulas :: "'a set \<Rightarrow> 'a tformula set" where "tformulas S = {x. \<forall>as bs. (\<forall>p\<in>S. (distinct as \<and> p \<in> set as) \<longleftrightarrow> (distinct bs \<and> p \<in> set bs)) \<longrightarrow> as \<in> Rep_tformula x \<longleftrightarrow> bs \<in> Rep_tformula x}" lemma tformulasI: assumes "\<And>as bs. \<forall>p\<in>S. (distinct as \<and> p \<in> set as) \<longleftrightarrow> (distinct bs \<and> p \<in> set bs) \<Longrightarrow> as \<in> Rep_tformula x \<longleftrightarrow> bs \<in> Rep_tformula x" shows "x \<in> tformulas S" using assms unfolding tformulas_def by simp lemma tformulasD: assumes "x \<in> tformulas S" assumes "\<forall>p\<in>S. (distinct as \<and> p \<in> set as) \<longleftrightarrow> (distinct bs \<and> p \<in> set bs)" shows "as \<in> Rep_tformula x \<longleftrightarrow> bs \<in> Rep_tformula x" using assms unfolding tformulas_def by simp lemma tformulas_mono: "S \<subseteq> T \<Longrightarrow> tformulas S \<subseteq> tformulas T" by (fast intro!: tformulasI elim!: tformulasD) lemma tformulas_insert: "x \<in> tformulas S \<Longrightarrow> x \<in> tformulas (insert a S)" unfolding tformulas_def by simp lemma tformulas_tvar: "i \<in> S \<Longrightarrow> tvar i \<in> tformulas S" unfolding tformulas_def apply (auto simp add: Rep_tformula_simps) done (* TODO: Problema! *) (*lemma tformulas_before: "a \<in> S \<Longrightarrow> before a \<in> tformulas S" unfolding tformulas_def apply (auto simp add: Rep_tformula_simps) done*) lemma tformulas_tvar_iff: "tvar i \<in> tformulas S \<longleftrightarrow> i \<in> S" unfolding tformulas_def apply (auto simp add: Rep_tformula_simps) apply (metis distinct_singleton empty_iff insert_iff list.set(1) set_simps(2)) done lemma tformulas_bot: "\<bottom> \<in> tformulas S" unfolding tformulas_def by (simp add: Rep_tformula_simps) lemma tformulas_top: "\<top> \<in> tformulas S" unfolding tformulas_def by (simp add: Rep_tformula_simps) lemma tformulas_compl: "x \<in> tformulas S \<Longrightarrow> - x \<in> tformulas S" unfolding tformulas_def by (simp add: Rep_tformula_simps) lemma tformulas_inf: "x \<in> tformulas S \<Longrightarrow> y \<in> tformulas S \<Longrightarrow> x \<sqinter> y \<in> tformulas S" unfolding tformulas_def by (auto simp add: Rep_tformula_simps) lemma tformulas_sup: "x \<in> tformulas S \<Longrightarrow> y \<in> tformulas S \<Longrightarrow> x \<squnion> y \<in> tformulas S" unfolding tformulas_def by (auto simp add: Rep_tformula_simps) lemma tformulas_diff: "x \<in> tformulas S \<Longrightarrow> y \<in> tformulas S \<Longrightarrow> x - y \<in> tformulas S" unfolding tformulas_def by (auto simp add: Rep_tformula_simps) lemma tformulas_ifte: "a \<in> tformulas S \<Longrightarrow> x \<in> tformulas S \<Longrightarrow> y \<in> tformulas S \<Longrightarrow> ifte a x y \<in> tformulas S" unfolding ifte_def by (intro tformulas_sup tformulas_inf tformulas_compl) lemmas tformulas_intros = tformulas_tvar tformulas_bot tformulas_top tformulas_compl tformulas_inf tformulas_sup tformulas_diff tformulas_ifte definition tinsert :: "'a \<Rightarrow> 'a list \<Rightarrow> 'a list set" where "tinsert i ls \<equiv> { xs . distinct xs \<and> i \<in> set xs \<and> (\<forall> j \<in> set ls . j \<in> set xs) }" definition tdiff :: "'a \<Rightarrow> 'a list \<Rightarrow> 'a list set" where "tdiff i ls \<equiv> { xs . distinct xs \<and> (\<forall> j \<in> set ls . j \<in> set xs \<and> j \<noteq> i) }" lemma ifte_inject_t2 : "ifte (f i) x y = ifte (f i) x' y' \<Longrightarrow> i \<notin> S \<Longrightarrow> f i = {A. i \<in> A} \<Longrightarrow> x \<in> g S \<Longrightarrow> x' \<in> g S \<Longrightarrow> y \<in> g S \<Longrightarrow> y' \<in> g S \<Longrightarrow> x = x' \<and> y = y'" apply (auto) done lemma t_ifte_inject: assumes "ifte (tvar i) x y = ifte (tvar i) x' y'" assumes "i \<notin> S" assumes "x \<in> tformulas S" and "x' \<in> tformulas S" assumes "y \<in> tformulas S" and "y' \<in> tformulas S" shows "x = x' \<and> y = y'" proof have 1: "\<And>ls. \<lbrakk> distinct ls \<and> i \<in> set ls \<rbrakk> \<Longrightarrow> ls \<in> Rep_tformula x \<longleftrightarrow> ls \<in> Rep_tformula x'" using assms(1) by (simp add: Rep_tformula_simps ifte_def set_eq_iff, fast) have 2: "\<And>ls. \<lbrakk> distinct ls \<and> i \<notin> set ls \<rbrakk> \<Longrightarrow> ls \<in> Rep_tformula y \<longleftrightarrow> ls \<in> Rep_tformula y'" using assms(1) by (simp add: Rep_tformula_simps ifte_def set_eq_iff, fast) show "x = x'" unfolding Rep_tformula_simps proof (rule set_eqI) fix ls have "ls \<in> Rep_tformula x \<longleftrightarrow> (\<forall> xs . xs \<in> tinsert i ls \<and> xs \<in> Rep_tformula x)" using `x \<in> tformulas S` sorry (* by (rule formulasD, force simp add: `i \<notin> S`)*) also have "\<dots> \<longleftrightarrow> (\<forall> xs . xs \<in> tinsert i ls \<and> xs \<in> Rep_tformula x')" sorry (*by (rule 1, simp)*) also have "\<dots> \<longleftrightarrow> ls \<in> Rep_tformula x'" using `x' \<in> tformulas S` sorry (*by (rule tformulasD, force simp add: `i \<notin> S`) *) finally show "ls \<in> Rep_tformula x \<longleftrightarrow> ls \<in> Rep_tformula x'" . qed show "y = y'" unfolding Rep_tformula_simps proof (rule set_eqI) fix ls have "ls \<in> Rep_tformula y \<longleftrightarrow> (\<forall> xs . xs \<in> tdiff i ls \<and> xs \<in> Rep_tformula y)" using `y \<in> tformulas S` sorry (*by (rule tformulasD, force simp add: `i \<notin> S`)*) also have "\<dots> \<longleftrightarrow> (\<forall> xs . xs \<in> tdiff i ls \<and> xs \<in> Rep_tformula y')" sorry (*by (rule 2, simp)*) also have "\<dots> \<longleftrightarrow> ls \<in> Rep_tformula y'" using `y' \<in> tformulas S` sorry (*by (rule tformulasD, force simp add: `i \<notin> S`)*) finally show "ls \<in> Rep_tformula y \<longleftrightarrow> ls \<in> Rep_tformula y'" . qed qed inductive hom_graph_t :: "('a \<Rightarrow> 'b::boolean_algebra) \<Rightarrow> 'a set \<Rightarrow> 'a tformula \<Rightarrow> 'b \<Rightarrow> bool" for f :: "'a \<Rightarrow> 'b::boolean_algebra" where bot: "hom_graph_t f {} bot bot" | top: "hom_graph_t f {} top top" | ifte: "i \<notin> S \<Longrightarrow> hom_graph_t f S x a \<Longrightarrow> hom_graph_t f S y b \<Longrightarrow> hom_graph_t f (insert i S) (ifte (tvar i) x y) (ifte (f i) a b)" lemma hom_graph_t_dest: "hom_graph_t f S x a \<Longrightarrow> k \<in> S \<Longrightarrow> \<exists>y z b c. x = ifte (tvar k) y z \<and> a = ifte (f k) b c \<and> hom_graph_t f (S - {k}) y b \<and> hom_graph_t f (S - {k}) z c" proof (induct set: hom_graph_t) case (ifte i S x a y b) show ?case proof (cases "i = k") assume "i = k" with ifte(1,2,4) show ?case by auto next assume "i \<noteq> k" with `k \<in> insert i S` have k: "k \<in> S" by simp have *: "insert i S - {k} = insert i (S - {k})" using `i \<noteq> k` by (simp add: insert_Diff_if) have **: "i \<notin> S - {k}" using `i \<notin> S` by simp from ifte(1) ifte(3) [OF k] ifte(5) [OF k] show ?case unfolding * apply clarify apply (simp only: ifte_ifte_distrib [of "tvar i"]) apply (simp only: ifte_ifte_distrib [of "f i"]) apply (fast intro: hom_graph_t.ifte [OF **]) done qed qed simp_all lemma hom_graph_t_insert_elim: assumes "hom_graph_t f (insert i S) x a" and "i \<notin> S" obtains y z b c where "x = ifte (tvar i) y z" and "a = ifte (f i) b c" and "hom_graph_t f S y b" and "hom_graph_t f S z c" using hom_graph_t_dest [OF assms(1) insertI1] by (clarify, simp add: assms(2)) lemma hom_graph_t_imp_tformulas: "hom_graph_t f S x a \<Longrightarrow> x \<in> tformulas S" by (induct set: hom_graph_t, simp_all add: tformulas_intros tformulas_insert) lemma hom_graph_t_unique: "hom_graph_t f S x a \<Longrightarrow> hom_graph_t f S x a' \<Longrightarrow> a = a'" proof (induct arbitrary: a' set: hom_graph_t) case (ifte i S y b z c a') from ifte(6,1) obtain y' z' b' c' where 1: "ifte (tvar i) y z = ifte (tvar i) y' z'" and 2: "a' = ifte (f i) b' c'" and 3: "hom_graph_t f S y' b'" and 4: "hom_graph_t f S z' c'" by (rule hom_graph_t_insert_elim) from 1 3 4 ifte(1,2,4) have "y = y' \<and> z = z'" by (intro t_ifte_inject hom_graph_t_imp_tformulas) with 2 3 4 ifte(3,5) show "ifte (f i) b c = a'" by simp qed (erule hom_graph_t.cases, simp_all)+ lemma hom_graph_t_insert: assumes "hom_graph_t f S x a" shows "hom_graph_t f (insert i S) x a" proof (cases "i \<in> S") assume "i \<in> S" with assms show ?thesis by (simp add: insert_absorb) next assume "i \<notin> S" hence "hom_graph_t f (insert i S) (ifte (tvar i) x x) (ifte (f i) a a)" by (intro hom_graph_t.ifte assms) thus "hom_graph_t f (insert i S) x a" by (simp only: ifte_same) qed lemma hom_graph_t_finite_superset: assumes "hom_graph_t f S x a" and "finite T" and "S \<subseteq> T" shows "hom_graph_t f T x a" proof - from `finite T` have "hom_graph_t f (S \<union> T) x a" by (induct set: finite, simp add: assms, simp add: hom_graph_t_insert) with `S \<subseteq> T` show "hom_graph_t f T x a" by (simp only: subset_Un_eq) qed lemma hom_graph_t_imp_finite: "hom_graph_t f S x a \<Longrightarrow> finite S" by (induct set: hom_graph_t) simp_all lemma hom_graph_t_unique': assumes "hom_graph_t f S x a" and "hom_graph_t f T x a'" shows "a = a'" proof (rule hom_graph_t_unique) have fin: "finite (S \<union> T)" using assms by (intro finite_UnI hom_graph_t_imp_finite) show "hom_graph_t f (S \<union> T) x a" using assms(1) fin Un_upper1 by (rule hom_graph_t_finite_superset) show "hom_graph_t f (S \<union> T) x a'" using assms(2) fin Un_upper2 by (rule hom_graph_t_finite_superset) qed lemma hom_graph_t_tvar: "hom_graph_t f {i} (tvar i) (f i)" proof - have "hom_graph_t f {i} (ifte (tvar i) top bot) (ifte (f i) top bot)" by (simp add: hom_graph_t.intros) thus "hom_graph_t f {i} (tvar i) (f i)" unfolding ifte_def by simp qed lemma hom_graph_t_compl: "hom_graph_t f S x a \<Longrightarrow> hom_graph_t f S (- x) (- a)" by (induct set: hom_graph_t, simp_all add: hom_graph_t.intros compl_ifte) lemma hom_graph_t_inf: "hom_graph_t f S x a \<Longrightarrow> hom_graph_t f S y b \<Longrightarrow> hom_graph_t f S (x \<sqinter> y) (a \<sqinter> b)" apply (induct arbitrary: y b set: hom_graph_t) apply (simp add: hom_graph_t.bot) apply simp apply (erule (1) hom_graph_t_insert_elim) apply (auto simp add: inf_ifte_distrib hom_graph_t.ifte) done lemma hom_graph_t_union_inf: assumes "hom_graph_t f S x a" and "hom_graph_t f T y b" shows "hom_graph_t f (S \<union> T) (x \<sqinter> y) (a \<sqinter> b)" proof (rule hom_graph_t_inf) have fin: "finite (S \<union> T)" using assms by (intro finite_UnI hom_graph_t_imp_finite) show "hom_graph_t f (S \<union> T) x a" using assms(1) fin Un_upper1 by (rule hom_graph_t_finite_superset) show "hom_graph_t f (S \<union> T) y b" using assms(2) fin Un_upper2 by (rule hom_graph_t_finite_superset) qed lemma hom_graph_t_exists: "\<exists>a S. hom_graph_t f S x a" by (induct x) (auto intro: hom_graph_t_tvar hom_graph_t_compl hom_graph_t_union_inf) definition hom_t :: "('a \<Rightarrow> 'b::boolean_algebra) \<Rightarrow> 'a tformula \<Rightarrow> 'b" where "hom_t f x = (THE a. \<exists>S. hom_graph_t f S x a)" lemma hom_graph_t_hom_t: "\<exists>S. hom_graph_t f S x (hom_t f x)" unfolding hom_t_def apply (rule theI') apply (rule ex_ex1I) apply (rule hom_graph_t_exists) apply (fast elim: hom_graph_t_unique') done lemma hom_t_equality: "hom_graph_t f S x a \<Longrightarrow> hom_t f x = a" unfolding hom_t_def apply (rule the_equality) apply (erule exI) apply (erule exE) apply (erule (1) hom_graph_t_unique') done lemma hom_t_var [simp]: "hom_t f (tvar i) = f i" by (rule hom_t_equality, rule hom_graph_t_tvar) lemma hom_t_bot [simp]: "hom_t f \<bottom> = \<bottom>" by (rule hom_t_equality, rule hom_graph_t.bot) lemma hom_t_top [simp]: "hom_t f \<top> = \<top>" by (rule hom_t_equality, rule hom_graph_t.top) lemma hom_t_compl [simp]: "hom_t f (- x) = - hom_t f x" proof - obtain S where "hom_graph_t f S x (hom_t f x)" using hom_graph_t_hom_t .. hence "hom_graph_t f S (- x) (- hom_t f x)" by (rule hom_graph_t_compl) thus "hom_t f (- x) = - hom_t f x" by (rule hom_t_equality) qed lemma hom_t_inf [simp]: "hom_t f (x \<sqinter> y) = hom_t f x \<sqinter> hom_t f y" proof - obtain S where S: "hom_graph_t f S x (hom_t f x)" using hom_graph_t_hom_t .. obtain T where T: "hom_graph_t f T y (hom_t f y)" using hom_graph_t_hom_t .. have "hom_graph_t f (S \<union> T) (x \<sqinter> y) (hom_t f x \<sqinter> hom_t f y)" using S T by (rule hom_graph_t_union_inf) thus ?thesis by (rule hom_t_equality) qed lemma hom_t_sup [simp]: "hom_t f (x \<squnion> y) = hom_t f x \<squnion> hom_t f y" unfolding sup_conv_inf by (simp only: hom_t_compl hom_t_inf) lemma hom_t_diff [simp]: "hom_t f (x - y) = hom_t f x - hom_t f y" unfolding diff_eq by (simp only: hom_t_compl hom_t_inf) lemma hom_t_ifte [simp]: "hom_t f (ifte x y z) = ifte (hom_t f x) (hom_t f y) (hom_t f z)" unfolding ifte_def by (simp only: hom_t_compl hom_t_inf hom_t_sup) lemmas hom_t_simps = hom_t_var hom_t_bot hom_t_top hom_t_compl hom_t_inf hom_t_sup hom_t_diff hom_t_ifte lemma hom_t_tvar_eq_id: "hom_t tvar x = x" by (induct x) simp_all lemma hom_t_hom_t: "hom_t f (hom_t g x) = hom_t (\<lambda>i. hom_t f (g i)) x" by (induct x) simp_all definition fmap_t :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a tformula \<Rightarrow> 'b tformula" where "fmap_t f = hom_t (\<lambda>i. tvar (f i))" lemma fmap_t_tvar [simp]: "fmap_t f (tvar i) = tvar (f i)" unfolding fmap_t_def by simp lemma fmap_t_bot [simp]: "fmap_t f \<bottom> = \<bottom>" unfolding fmap_t_def by simp lemma fmap_t_top [simp]: "fmap_t f \<top> = \<top>" unfolding fmap_t_def by simp lemma fmap_t_compl [simp]: "fmap_t f (- x) = - fmap_t f x" unfolding fmap_t_def by simp lemma fmap_t_inf [simp]: "fmap_t f (x \<sqinter> y) = fmap_t f x \<sqinter> fmap_t f y" unfolding fmap_t_def by simp lemma fmap_t_sup [simp]: "fmap_t f (x \<squnion> y) = fmap_t f x \<squnion> fmap_t f y" unfolding fmap_t_def by simp lemma fmap_t_diff [simp]: "fmap_t f (x - y) = fmap_t f x - fmap_t f y" unfolding fmap_t_def by simp lemma fmap_t_ifte [simp]: "fmap_t f (ifte x y z) = ifte (fmap_t f x) (fmap_t f y) (fmap_t f z)" unfolding fmap_t_def by simp lemmas fmap_t_simps = fmap_t_tvar fmap_t_bot fmap_t_top fmap_t_compl fmap_t_inf fmap_t_sup fmap_t_diff fmap_t_ifte lemma fmap_t_ident: "fmap_t (\<lambda>i. i) x = x" by (induct x) simp_all lemma fmap_t_fmap_t: "fmap_t f (fmap_t g x) = fmap_t (f \<circ> g) x" by (induct x) simp_all lemma "hom_t s (tvar A) \<or> hom_t s (- tvar A)" apply (auto) done lemma "hom_t s (tprefix (tvar A) (tvar B)) \<or> hom_t s (- tprefix (tvar A) (tvar B))" apply (auto) done fun prefix :: "'a list \<Rightarrow> 'a list \<Rightarrow> bool" where "prefix ls [] = False" | "prefix [] rs = True" | "prefix (a # ls) (b # rs) = ((a = b) \<and> prefix ls rs)" definition safe_concat :: "'a list \<Rightarrow> 'a list \<Rightarrow> bool" where "safe_concat ls rs \<equiv> (set ls \<inter> set rs = {})" definition tprefix_base :: "'a tformula \<Rightarrow> 'a tformula \<Rightarrow> 'a tval" where "tprefix_base L R \<equiv> { ls @ rs | ls rs . ls \<in> Rep_tformula L \<and> rs \<in> Rep_tformula R \<and> (safe_concat ls rs) }" definition tprefix :: "'a tformula \<Rightarrow> 'a tformula \<Rightarrow> 'a tformula" where "tprefix L R \<equiv> Abs_tformula (tprefix_base L R)" lemmas tprefix_defs = tprefix_def tprefix_base_def safe_concat_def lemma "tprefix_base L R \<in> ta" apply (auto simp add: tprefix_defs) done lemma list_tvar: "(xs::'a list) \<in> Rep_tformula (tvar (A::'a)) = (distinct xs \<and> A \<in> set xs)" unfolding tvar_def apply (metis Rep_tformula_tvar mem_Collect_eq tvar_def) done lemma tprefix_top_top: "tprefix \<top> \<top> = \<top>" apply (auto simp add: tprefix_defs) apply (auto simp add: Rep_tformula_top) done lemma "tprefix (tvar A) (tvar A) = \<bottom>" apply (auto simp add: tprefix_defs list_tvar ) apply (smt2 Collect_cong Collect_empty_eq Set.set_insert bot_set_def bot_tformula_def disjoint_insert(1)) (*using bot_formula_def [symmetric]*) (*apply (intro Abs_tformula_inverse Rep_tformula)*) done lemma "(tvar A \<sqinter> tvar B) = \<top> \<Longrightarrow> tprefix (tvar A) (tvar B) = \<top>" apply (auto simp add: tprefix_top_top) done lemma before_and: "((tprefix (tvar A) (tvar B)) \<squnion> (tprefix (tvar B) (tvar A))) = (tvar A \<sqinter> tvar B)" apply (auto simp add: tprefix_defs ) apply (auto simp add: tvar_def) apply (auto simp add: Rep_tformula_simps) done lemma and_neg: "hom_t s (tvar A \<sqinter> tvar B) \<squnion> (- tvar A) \<squnion> hom_t s (- tvar B)" apply (auto) done lemma "hom_t s (tprefix (tvar A) (tvar B)) \<or> hom_t s (tprefix (tvar B) (tvar A)) \<or> hom_t s (- tvar A) \<or> hom_t s (- tvar B) " apply (metis and_neg before_and) done datatype 'a TemporalFormula = TTrue ("True") | TFalse ("False") | TVar 'a ("[_]") | TAnd "'a TemporalFormula" "'a TemporalFormula" (infixr "T\<and>" 40) | TOr "'a TemporalFormula" "'a TemporalFormula" (infixr "T\<or>" 50) | TNot "'a TemporalFormula" ("T\<not> _" 40) | Before "'a TemporalFormula" "'a TemporalFormula" (infixr "T<" 40) primrec TF2tformula :: "'a TemporalFormula \<Rightarrow> 'a tformula" where "TF2tformula TTrue = \<top>" | "TF2tformula TFalse = \<bottom>" | "TF2tformula (TVar a) = tvar a" | "TF2tformula (TAnd l r) = TF2tformula l \<sqinter> TF2tformula r" | "TF2tformula (TOr l r) = TF2tformula l \<squnion> TF2tformula r" | "TF2tformula (TNot f) = - TF2tformula f" | "TF2tformula (Before l r) = tprefix (TF2tformula l) (TF2tformula r)" lemma "\<lbrakk> a \<noteq> b \<rbrakk> \<Longrightarrow> TF2tformula (Before (TVar a) (TVar b)) = Abs_tformula { [a,b] }" apply (auto simp add: tprefix_def Rep_tformula_simps) sorry lemma "TF2tformula (T\<not> ((TVar a) T< (TVar a))) = \<top>" sorry end
// Copyright Louis Dionne 2013-2016 // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) #include <boost/hana/assert.hpp> #include <boost/hana/experimental/printable.hpp> #include <boost/hana/integral_constant.hpp> #include <boost/hana/map.hpp> #include <boost/hana/pair.hpp> #include <sstream> #include <string> namespace hana = boost::hana; int main() { { std::ostringstream ss; ss << hana::experimental::print( hana::make_map() ); BOOST_HANA_RUNTIME_CHECK(ss.str() == "{}"); } { std::ostringstream ss; ss << hana::experimental::print( hana::make_map(hana::make_pair(hana::int_c<1>, 'x')) ); BOOST_HANA_RUNTIME_CHECK(ss.str() == "{1 => x}"); } { std::ostringstream ss; ss << hana::experimental::print( hana::make_map(hana::make_pair(hana::int_c<1>, 'x'), hana::make_pair(hana::int_c<2>, 'y')) ); BOOST_HANA_RUNTIME_CHECK(ss.str() == "{1 => x, 2 => y}"); } { std::ostringstream ss; ss << hana::experimental::print( hana::make_map(hana::make_pair(hana::int_c<1>, 'x'), hana::make_pair(hana::int_c<2>, 'y'), hana::make_pair(hana::int_c<3>, 'z')) ); BOOST_HANA_RUNTIME_CHECK(ss.str() == "{1 => x, 2 => y, 3 => z}"); } }
import data.matrix.pequiv data.rat.basic variables {m n : ℕ} /-- The type of ordered partitions of `m + n` elements into a `m` row variables and `n` column variables -/ structure partition (m n : ℕ) : Type := ( rowp : fin m ≃. fin (m + n) ) ( colp : fin n ≃. fin (m + n) ) ( rowp_trans_rowp_symm : rowp.trans rowp.symm = pequiv.refl (fin m) ) ( colp_trans_colp_symm : colp.trans colp.symm = pequiv.refl (fin n) ) ( rowp_trans_colp_symm : rowp.trans colp.symm = ⊥ ) namespace partition open pequiv function matrix finset fintype local infix ` ⬝ `:70 := matrix.mul local postfix `ᵀ` : 1500 := transpose attribute [simp] rowp_trans_rowp_symm colp_trans_colp_symm rowp_trans_colp_symm lemma fin.coe_eq_val (a : fin n) : (a : ℕ) = a.val := rfl def default : partition m n := { rowp := { to_fun := some ∘ fin.cast_le (le_add_right (le_refl _)), inv_fun := λ j, if hm : j.1 < m then some ⟨j, hm⟩ else none, inv := begin rintros ⟨i, _⟩ ⟨j, _⟩, split_ifs; simp [fin.coe_eq_val, fin.cast_le, fin.cast_lt, eq_comm, -not_lt]; intro; simp [*, -not_lt] at *, end }, colp := { to_fun := λ i, some ⟨m + i, add_lt_add_of_le_of_lt (le_refl _) i.2⟩, inv_fun := λ j, if hm : m ≤ j.1 then some ⟨j - m, (nat.sub_lt_left_iff_lt_add hm).2 j.2⟩ else none, inv := begin rintros ⟨i, _⟩ ⟨j, _⟩, simp [pequiv.trans, pequiv.symm, fin.cast_le, fin.cast_lt, fin.coe_eq_val, fin.ext_iff], split_ifs, { simp [fin.ext_iff, nat.sub_eq_iff_eq_add h, @eq_comm _ j] at * }, { simp, intro, subst j, simp [nat.le_add_left, *] at * } end }, rowp_trans_rowp_symm := trans_symm_eq_iff_forall_is_some.2 (λ _, rfl), colp_trans_colp_symm := trans_symm_eq_iff_forall_is_some.2 (λ _, rfl), rowp_trans_colp_symm := pequiv.ext begin rintro ⟨i, hi⟩, dsimp [pequiv.trans, pequiv.symm, fin.cast_le, fin.cast_lt], rw [dif_neg (not_le_of_gt hi)] end } instance : inhabited (partition m n) := ⟨default⟩ lemma is_some_rowp (B : partition m n) : ∀ (i : fin m), (B.rowp i).is_some := by rw [← trans_symm_eq_iff_forall_is_some, rowp_trans_rowp_symm] lemma is_some_colp (B : partition m n) : ∀ (k : fin n), (B.colp k).is_some := by rw [← trans_symm_eq_iff_forall_is_some, colp_trans_colp_symm] lemma injective_rowp (B : partition m n) : injective B.rowp := injective_of_forall_is_some (is_some_rowp B) lemma injective_colp (B : partition m n) : injective B.colp := injective_of_forall_is_some (is_some_colp B) /-- given a row index, `rowg` returns the variable in that position -/ def rowg (B : partition m n) (r : fin m) : fin (m + n) := option.get (B.is_some_rowp r) /-- given a column index, `colg` returns the variable in that position -/ def colg (B : partition m n) (s : fin n) : fin (m + n) := option.get (B.is_some_colp s) lemma injective_rowg (B : partition m n) : injective B.rowg := λ x y h, by rw [rowg, rowg, ← option.some_inj, option.some_get, option.some_get] at h; exact injective_rowp B h lemma injective_colg (B : partition m n) : injective B.colg := λ x y h, by rw [colg, colg, ← option.some_inj, option.some_get, option.some_get] at h; exact injective_colp B h local infix ` ♣ `: 70 := pequiv.trans def swap (B : partition m n) (r : fin m) (s : fin n) : partition m n := { rowp := B.rowp.trans (equiv.swap (B.rowg r) (B.colg s)).to_pequiv, colp := B.colp.trans (equiv.swap (B.rowg r) (B.colg s)).to_pequiv, rowp_trans_rowp_symm := by rw [symm_trans_rev, ← trans_assoc, trans_assoc B.rowp, ← equiv.to_pequiv_symm, ← equiv.to_pequiv_trans]; simp, colp_trans_colp_symm := by rw [symm_trans_rev, ← trans_assoc, trans_assoc B.colp, ← equiv.to_pequiv_symm, ← equiv.to_pequiv_trans]; simp, rowp_trans_colp_symm := by rw [symm_trans_rev, ← trans_assoc, trans_assoc B.rowp, ← equiv.to_pequiv_symm, ← equiv.to_pequiv_trans]; simp } lemma not_is_some_colp_of_is_some_rowp (B : partition m n) (j : fin (m + n)) : (B.rowp.symm j).is_some → (B.colp.symm j).is_some → false := begin rw [option.is_some_iff_exists, option.is_some_iff_exists], rintros ⟨i, hi⟩ ⟨k, hk⟩, have : B.rowp.trans B.colp.symm i = none, { rw [B.rowp_trans_colp_symm, pequiv.bot_apply] }, rw [pequiv.trans_eq_none] at this, rw [pequiv.eq_some_iff] at hi, exact (this j k).resolve_left (not_not.2 hi) hk end @[simp] lemma rowg_mem (B : partition m n) (r : fin m) : (B.rowg r) ∈ B.rowp r := option.get_mem _ lemma rowp_eq_some_rowg (B : partition m n) (r : fin m) : B.rowp r = some (B.rowg r) := rowg_mem _ _ @[simp] lemma colg_mem (B : partition m n) (s : fin n) : (B.colg s) ∈ B.colp s := option.get_mem _ lemma colp_eq_some_colg (B : partition m n) (s : fin n) : B.colp s = some (B.colg s) := colg_mem _ _ @[simp] lemma rowp_rowg (B : partition m n) (r : fin m) : B.rowp.symm (B.rowg r) = some r := B.rowp.mem_iff_mem.2 (rowg_mem _ _) @[simp] lemma colp_colg (B : partition m n) (s : fin n) : B.colp.symm (B.colg s) = some s := B.colp.mem_iff_mem.2 (colg_mem _ _) lemma colp_ne_none_of_rowp_eq_none (B : partition m n) (v : fin (m + n)) (hb : B.rowp.symm v = none) (hnb : B.colp.symm v = none) : false := have hs : card (univ.image B.rowg) = m, by rw [card_image_of_injective _ (B.injective_rowg), card_univ, card_fin], have ht : card (univ.image B.colg) = n, by rw [card_image_of_injective _ (B.injective_colg), card_univ, card_fin], have hst : disjoint (univ.image B.rowg) (univ.image B.colg), from finset.disjoint_left.2 begin simp only [mem_image, exists_imp_distrib, not_exists], assume v i _ hi j _ hj, subst hi, exact not_is_some_colp_of_is_some_rowp B (B.rowg i) (option.is_some_iff_exists.2 ⟨i, by simp⟩) (hj ▸ option.is_some_iff_exists.2 ⟨j, by simp⟩), end, have (univ.image B.rowg) ∪ (univ.image B.colg) = univ, from eq_of_subset_of_card_le (λ _ _, mem_univ _) (by rw [card_disjoint_union hst, hs, ht, card_univ, card_fin]), begin cases mem_union.1 (eq_univ_iff_forall.1 this v); rcases mem_image.1 h with ⟨_, _, h⟩; subst h; simp * at * end lemma is_some_rowp_iff (B : partition m n) (j : fin (m + n)) : (B.rowp.symm j).is_some ↔ ¬(B.colp.symm j).is_some := ⟨not_is_some_colp_of_is_some_rowp B j, by erw [option.not_is_some_iff_eq_none, ← option.ne_none_iff_is_some, forall_swap]; exact colp_ne_none_of_rowp_eq_none B j⟩ @[simp] lemma colp_rowg_eq_none (B : partition m n) (r : fin m) : B.colp.symm (B.rowg r) = none := option.not_is_some_iff_eq_none.1 ((B.is_some_rowp_iff _).1 (is_some_symm_get _ _)) @[simp] lemma rowp_colg_eq_none (B : partition m n) (s : fin n) : B.rowp.symm (B.colg s) = none := option.not_is_some_iff_eq_none.1 (mt (B.is_some_rowp_iff _).1 $ not_not.2 (is_some_symm_get _ _)) lemma eq_rowg_or_colg (B : partition m n) (i : fin (m + n)) : (∃ j, i = B.rowg j) ∨ (∃ j, i = B.colg j) := begin dsimp only [rowg, colg], by_cases h : ↥(B.rowp.symm i).is_some, { cases option.is_some_iff_exists.1 h with j hj, exact or.inl ⟨j, by rw [B.rowp.eq_some_iff] at hj; rw [← option.some_inj, ← hj, option.some_get]⟩ }, { rw [(@not_iff_comm _ _ (classical.dec _) (classical.dec _)).1 (B.is_some_rowp_iff _).symm] at h, cases option.is_some_iff_exists.1 h with j hj, exact or.inr ⟨j, by rw [B.colp.eq_some_iff] at hj; rw [← option.some_inj, ← hj, option.some_get]⟩ } end lemma rowg_ne_colg (B : partition m n) (i : fin m) (j : fin n) : B.rowg i ≠ B.colg j := λ h, by simpa using congr_arg B.rowp.symm h @[simp] lemma option.get_inj {α : Type*} : Π {a b : option α} {ha : a.is_some} {hb : b.is_some}, option.get ha = option.get hb ↔ a = b | (some a) (some b) _ _ := by rw [option.get_some, option.get_some, option.some_inj] @[extensionality] lemma ext {B C : partition m n} (h : ∀ i, B.rowg i = C.rowg i) (h₂ : ∀ j, B.colg j = C.colg j) : B = C := begin cases B, cases C, simp [rowg, colg, function.funext_iff, pequiv.ext_iff] at *, tauto end @[simp] lemma single_rowg_mul_rowp (B : partition m n) (i : fin m) : ((single (0 : fin 1) (B.rowg i)).to_matrix : matrix _ _ ℚ) ⬝ B.rowp.to_matrixᵀ = (single (0 : fin 1) i).to_matrix := by rw [← to_matrix_symm, ← to_matrix_trans, single_trans_of_mem _ (rowp_rowg _ _)] @[simp] lemma single_rowg_mul_colp (B : partition m n) (i : fin m) : ((single (0 : fin 1) (B.rowg i)).to_matrix : matrix _ _ ℚ) ⬝ B.colp.to_matrixᵀ = 0 := by rw [← to_matrix_symm, ← to_matrix_trans, single_trans_of_eq_none _ (colp_rowg_eq_none _ _), to_matrix_bot]; apply_instance @[simp] lemma single_colg_mul_colp (B : partition m n) (k : fin n) : ((single (0 : fin 1) (B.colg k)).to_matrix : matrix _ _ ℚ) ⬝ B.colp.to_matrixᵀ = (single (0 : fin 1) k).to_matrix := by rw [← to_matrix_symm, ← to_matrix_trans, single_trans_of_mem _ (colp_colg _ _)] lemma single_colg_mul_rowp (B : partition m n) (k : fin n) : ((single (0 : fin 1) (B.colg k)).to_matrix : matrix _ _ ℚ) ⬝ B.rowp.to_matrixᵀ = 0 := by rw [← to_matrix_symm, ← to_matrix_trans, single_trans_of_eq_none _ (rowp_colg_eq_none _ _), to_matrix_bot]; apply_instance lemma colp_trans_rowp_symm (B : partition m n) : B.colp.trans B.rowp.symm = ⊥ := symm_injective $ by rw [symm_trans_rev, symm_symm, rowp_trans_colp_symm, symm_bot] @[simp] lemma colp_mul_rowp_transpose (B : partition m n) : (B.colp.to_matrix : matrix _ _ ℚ) ⬝ B.rowp.to_matrixᵀ = 0 := by rw [← to_matrix_bot, ← B.colp_trans_rowp_symm, to_matrix_trans, to_matrix_symm] @[simp] lemma rowp_mul_colp_transpose (B : partition m n) : (B.rowp.to_matrix : matrix _ _ ℚ) ⬝ B.colp.to_matrixᵀ = 0 := by rw [← to_matrix_bot, ← B.rowp_trans_colp_symm, to_matrix_trans, to_matrix_symm] @[simp] lemma colp_mul_colp_transpose (B : partition m n) : (B.colp.to_matrix : matrix _ _ ℚ) ⬝ B.colp.to_matrixᵀ = 1 := by rw [← to_matrix_refl, ← B.colp_trans_colp_symm, to_matrix_trans, to_matrix_symm] @[simp] lemma rowp_mul_rowp_transpose (B : partition m n) : (B.rowp.to_matrix : matrix _ _ ℚ) ⬝ B.rowp.to_matrixᵀ = 1 := by rw [← to_matrix_refl, ← B.rowp_trans_rowp_symm, to_matrix_trans, to_matrix_symm] lemma transpose_mul_add_transpose_mul (B : partition m n) : (B.rowp.to_matrixᵀ ⬝ B.rowp.to_matrix : matrix _ _ ℚ) + B.colp.to_matrixᵀ ⬝ B.colp.to_matrix = 1 := begin ext, repeat {rw [← to_matrix_symm, ← to_matrix_trans] }, simp only [add_val, pequiv.symm_trans, pequiv.to_matrix, one_val, pequiv.mem_of_set_iff, set.mem_set_of_eq], have := is_some_rowp_iff B j, split_ifs; tauto end lemma swap_rowp_eq (B : partition m n) (r : fin m) (s : fin n) : (B.swap r s).rowp.to_matrix = (B.rowp.to_matrix : matrix _ _ ℚ) - (single r (B.rowg r)).to_matrix + (single r (B.colg s)).to_matrix := begin dsimp [swap], rw [to_matrix_trans, to_matrix_swap], simp only [matrix.mul_add, sub_eq_add_neg, matrix.mul_one, matrix.mul_neg, (to_matrix_trans _ _).symm, trans_single_of_mem _ (rowg_mem B r), trans_single_of_eq_none _ (rowp_colg_eq_none B s), to_matrix_bot, neg_zero, add_zero] end lemma swap_colp_eq (B : partition m n) (r : fin m) (s : fin n) : (B.swap r s).colp.to_matrix = (B.colp.to_matrix : matrix _ _ ℚ) - (single s (B.colg s)).to_matrix + (single s (B.rowg r)).to_matrix := begin dsimp [swap], rw [to_matrix_trans, to_matrix_swap], simp only [matrix.mul_add, sub_eq_add_neg, matrix.mul_one, matrix.mul_neg, (to_matrix_trans _ _).symm, trans_single_of_mem _ (colg_mem B s), trans_single_of_eq_none _ (colp_rowg_eq_none B r), to_matrix_bot, neg_zero, add_zero] end @[simp] lemma rowg_swap (B : partition m n) (r : fin m) (s : fin n) : (B.swap r s).rowg r = B.colg s := option.some_inj.1 begin dsimp [swap, rowg, colg, pequiv.trans], rw [option.some_get, option.some_get], conv in (B.rowp r) { rw rowp_eq_some_rowg }, dsimp [equiv.to_pequiv, equiv.swap_apply_def, rowg], simp, end @[simp] lemma colg_swap (B : partition m n) (r : fin m) (s : fin n) : (B.swap r s).colg s = B.rowg r := option.some_inj.1 begin dsimp [swap, rowg, colg, pequiv.trans], rw [option.some_get, option.some_get], conv in (B.colp s) { rw colp_eq_some_colg }, dsimp [equiv.to_pequiv, equiv.swap_apply_def, colg], rw [if_neg, if_pos rfl, option.some_get], exact (rowg_ne_colg _ _ _).symm end lemma rowg_swap_of_ne (B : partition m n) {i r : fin m} {s : fin n} (h : i ≠ r) : (B.swap r s).rowg i = B.rowg i := option.some_inj.1 begin dsimp [swap, rowg, colg, pequiv.trans], rw [option.some_get, option.bind_eq_some'], use [B.rowg i, rowp_eq_some_rowg _ _], dsimp [equiv.to_pequiv, equiv.swap_apply_def, option.get_some], rw [← colg, ← rowg, if_neg (rowg_ne_colg B i s), if_neg (mt B.injective_rowg.eq_iff.1 h), rowg] end lemma colg_swap_of_ne (B : partition m n) {r : fin m} {j s : fin n} (h : j ≠ s) : (B.swap r s).colg j = B.colg j := option.some_inj.1 begin dsimp [swap, rowg, colg, pequiv.trans], rw [option.some_get, option.bind_eq_some'], use [B.colg j, colp_eq_some_colg _ _], dsimp [equiv.to_pequiv, equiv.swap_apply_def, option.get_some], rw [← colg, ← rowg, if_neg (rowg_ne_colg B r j).symm, if_neg (mt B.injective_colg.eq_iff.1 h), colg] end lemma rowg_swap' (B : partition m n) (i r : fin m) (s : fin n) : (B.swap r s).rowg i = if i = r then B.colg s else B.rowg i := if hir : i = r then by simp [hir] else by rw [if_neg hir, rowg_swap_of_ne _ hir] lemma colg_swap' (B : partition m n) (r : fin m) (j s : fin n) : (B.swap r s).colg j = if j = s then B.rowg r else B.colg j := if hjs : j = s then by simp [hjs] else by rw [if_neg hjs, colg_swap_of_ne _ hjs] @[simp] lemma swap_swap (B : partition m n) (r : fin m) (s : fin n) : (B.swap r s).swap r s = B := by ext; intros; simp [rowg_swap', colg_swap']; split_ifs; cc @[simp] lemma colp_trans_swap_rowp_symm (B : partition m n) (r : fin m) (s : fin n) : B.colp.trans (B.swap r s).rowp.symm = single s r := begin rw [swap, symm_trans_rev, ← equiv.to_pequiv_symm, ← equiv.perm.inv_def, equiv.swap_inv], ext i j, rw [mem_single_iff], dsimp [pequiv.trans, equiv.to_pequiv, equiv.swap_apply_def], simp only [coe, coe_mk_apply, option.mem_def, option.bind_eq_some'], rw [option.mem_def.1 (colg_mem B i)], simp [B.injective_colg.eq_iff, (B.rowg_ne_colg _ _).symm], split_ifs; simp [*, eq_comm] end @[simp] lemma colp_mul_swap_rowp_tranpose (B : partition m n) (r : fin m) (s : fin n) : (B.colp.to_matrix : matrix _ _ ℚ) ⬝ (B.swap r s).rowp.to_matrixᵀ = (single s r).to_matrix := by rw [← colp_trans_swap_rowp_symm, to_matrix_trans, to_matrix_symm] lemma rowp_trans_swap_rowp_transpose (B : partition m n) (r : fin m) (s : fin n) : B.rowp.trans (B.swap r s).rowp.symm = of_set {i | i ≠ r} := begin rw [swap, symm_trans_rev, ← equiv.to_pequiv_symm, ← equiv.perm.inv_def, equiv.swap_inv], ext i j, dsimp [pequiv.trans, equiv.to_pequiv, equiv.swap_apply_def], simp only [coe, coe_mk_apply, option.mem_def, option.bind_eq_some'], rw [option.mem_def.1 (rowg_mem B i)], simp [B.injective_rowg.eq_iff, B.rowg_ne_colg], split_ifs, { simp * }, { simp *; split; intros; simp * at * } end lemma swap_rowp_transpose_mul_single_of_ne (B : partition m n) {r : fin m} (s : fin n) {i : fin m} (hir : i ≠ r) : ((B.swap r s).rowp.to_matrixᵀ : matrix _ _ ℚ) ⬝ (single i (0 : fin 1)).to_matrix = B.rowp.to_matrixᵀ ⬝ (single i 0).to_matrix := begin simp only [swap_rowp_eq, sub_eq_add_neg, matrix.mul_add, matrix.mul_neg, matrix.mul_one, matrix.add_mul, (to_matrix_trans _ _).symm, (to_matrix_symm _).symm, transpose_add, transpose_neg, matrix.neg_mul, symm_trans_rev, trans_assoc], rw [trans_single_of_mem _ (rowp_rowg _ _), trans_single_of_eq_none, trans_single_of_eq_none, to_matrix_bot, neg_zero, add_zero, add_zero]; {dsimp [single]; simp [*, B.injective_rowg.eq_iff]} <|> apply_instance end @[simp] lemma swap_rowp_transpose_mul_single (B : partition m n) (r : fin m) (s : fin n) : ((B.swap r s).rowp.to_matrixᵀ : matrix _ _ ℚ) ⬝ (single r (0 : fin 1)).to_matrix = B.colp.to_matrixᵀ ⬝ (single s (0 : fin 1)).to_matrix := begin simp only [swap_rowp_eq, sub_eq_add_neg, matrix.mul_add, matrix.mul_neg, matrix.mul_one, matrix.add_mul, (to_matrix_trans _ _).symm, (to_matrix_symm _).symm, transpose_add, transpose_neg, matrix.neg_mul, symm_trans_rev, trans_assoc, symm_single], rw [trans_single_of_mem _ (rowp_rowg _ _), trans_single_of_mem _ (mem_single _ _), trans_single_of_mem _ (mem_single _ _), trans_single_of_mem _ (colp_colg _ _)], simp, all_goals {apply_instance} end def equiv_aux : partition m n ≃ Σ' (rowp : fin m ≃. fin (m + n)) (colp : fin n ≃. fin (m + n)) ( rowp_trans_rowp_symm : rowp.trans rowp.symm = pequiv.refl (fin m) ) ( colp_trans_colp_symm : colp.trans colp.symm = pequiv.refl (fin n) ), rowp.trans colp.symm = ⊥ := { to_fun := λ ⟨a, b, c, d, e⟩, ⟨a, b, c, d, e⟩, inv_fun := λ ⟨a, b, c, d, e⟩, ⟨a, b, c, d, e⟩, left_inv := λ ⟨_, _, _, _, _⟩, rfl, right_inv := λ ⟨_, _, _, _, _⟩, rfl } end partition
In case you buy a brand new state-of-the-art gaming computer, you’ll be able to simply spend $2,000 or extra. Having a gaming laptop computer with an excellent quality audio output system is essential for rising the gaming expertise. The opposite choice is to purchase a particular gaming laptop that has been built for that objective. Excessive gaming computers aren’t simply constructed internally to play massive video games, their exterior can also be properly thought. The second product I checked out in my search for the very best cheap gaming computer systems was this iBuyPower Extreme 542D3 Desktop Gaming Computer. We provide a great vary of base gaming computers that may be customised to your specs. Especially when you think about some gaming laptop computer specialists are actually supplying you with desktop parts in a laptop computer. Another conspicuous dissimilarity between regular desktop computers and gaming computer systems is the efficiency when taking part in applications like Crisis or Skyrim. I even started constructing excessive end gaming computers and pre-putting in a couple of games for buyer testing (I ran web to all my laptop stations). This is a design flaw in most laptops as with a laptop being in your lap the fiber of your garments choke off its ventilation. It’s nearly inconceivable to blow a sale when you have higher prices and service. Stocking a wide range of products from a breadth of makers and types, JW Computers proudly delivers the best quality merchandise for probably the most reasonably priced and attractive costs. Another feature of the gaming mouse is extra buttons which may act as hotkeys and be personalized. In an effort to sustain with developers’ and players’ calls for for performance, advances in hardware have grown at an alarming charge, lengthening the hole between gamer PCs and common computer systems by years. Ever for the reason that four-Hour Workweek was launched, everyone seems to have the same objective. Thanks, I’ve not been making an excessive amount of from Amazon so this has are available quite helpful. In all probability one of the most important things when you find yourself simply beginning as an affiliate. A:By taking affiliate marketing online courses, you’ll be able to purchase abilities to work on a variety of duties. Anyway it might be wiser to go for acom area if you want to really succeed as an Affiliate. Others among the many 20 or so internet affiliate marketing companies in the UK provide less preliminary hand-holding for novices, however have bigger, extra lucrative brands in their steady and a wider vary of specialisms. I hope you get some good tips to begin your corporation with Amazon associates program and increase up your sales from this text. Different product evaluation websites take a wider approach to affiliate gross sales, and should include merchandise anyplace from headphones and laptops or different electronics, automotive accessories to garage instruments and gardening gear. Experience with Account Management is often linked with data of On-line Marketing. Basically, it is an opportunity to turn into an extension of a company’s marketing crew. The secret to mastering internet online affiliate marketing is to repeatedly generate meaningful content material Blogs are a very good start line, but so are things like curated movies, product critiques, and more. The basic principle behind affiliate marketing on-line is pretty easy to know. However, these affiliate packages will earn you nice money and there are such a lot of to select from. There are lots of actually fun science experiments that you can do with little youngsters. This description of the observe of doing science is quite completely different from some of the science work in evidence in lots of school rooms the place there could also be a science desk on which sit attention-grabbing objects and materials, along with remark and measurement tools similar to magnifiers and balances. If there are some kids who’re extra aware of the subject matter only by the trainer’s clarification to the category, then there’s also the motion goes a scientifically. At the core of inquiry-based science is direct exploration of phenomena and materials. As described right here, children’s inquiry into acceptable phenomena isn’t only the place to build foundational experiences for later science studying, it’s fertile floor for the development of many cognitive abilities. Should you ever thought science was boring learn on… We will hopefully offer just a few nice concepts for all budgets, ages and expertise. Give freedom to the children to make a statement without any stress from the instructor. After the teacher to clarify and observe it, then it’s time to involve the children within the examine. The content material of science for younger kids is a sophisticated interplay among ideas, scientific reasoning, the nature of science, and doing science. At the other end is a structured program with little youngster enter besides during free time.” The reality of a great science curriculum is that it sits in between these extremes. By being allowed to do new things and expertise the results of their actions, youngsters type rich psychological representations of non-verbal ideas. When the varied checks have been carried out, then the kid is directed to make an assessment or a conclusion to the examine of the science. The purpose of science initiatives can also be to extra enhance the skills of the kid. From combing by means of job boards to impressing the hiring supervisor in an interview, here is find out how to navigate the job software course of. Taking a look at your definition – I am just mentioning that you may affect a person’s path by a website with only XHTML. Nevertheless, you are in luck, as an online developer could be a web designer as much as a designer can select to be a developer. Very detailed, nicely written hubl I’m contemplating taking some web design classes and this was very useful. For example 50% of the people who carry out the job of Web Designer are anticipated to make lower than the median. Nevertheless, that is subject to many variables including location, experience, skillsets, and possibly even what you wear for that job interview. Utilizing this technology alone will enable you to jot down simple, text based mostly internet sites. Although in case you have a good net host, with support you may get a whole lot of these issues executed for you. This will likely take 4 or 5 years, at which point you may be promoted to senior designer. You, as a job seeker, know what wage range you’ll be able to count on to get for this job. When judging a web site, the credentials of the web designer should not the issue, it is the finish consequence that’s important. Call me human.” Do not assume you are predisposed to do better in one area than one other – an artist can be as proficient at internet growth as a mathematician may be as creatively expert at net design. Created in black and white and now progressing to full colours in high definition. Cloud-primarily based website-internet hosting services like AWS (Amazon) and can be used at occasions to display static web sites and web functions that developers have created. Being an effective internet designer requires growing numerous completely different expertise.
module Reflexivity where import PolyDepPrelude open PolyDepPrelude using(Bool; True) -- Local reflexivity lref : {X : Set} -> (X -> X -> Bool) -> X -> Set lref _R_ = \x -> True (x R x) -- Reflexive = locally reflexive everywhere data Refl {X : Set} (r : X -> X -> Bool) : Set where refl : ((x : X) -> lref r x) -> Refl r
$\lim_{n \to \infty} r \left(1 - \frac{1}{n+1}\right) = r$.
\startcomponent ma-cb-en-margintexts \product ma-cb-en \chapter{Margin texts} \index{margin text} \Command{\tex{inmargin}} \Command{\tex{inleft}} \Command{\tex{inright}} \Command{\tex{margintitle}} It is very easy to put text in the margin. You just use \type{\inmargin}. \shortsetup{inmargin} You may remember one of the earlier examples: \typebuffer[marginpicture] This would result in a figure in the \pagereference [marginpicture]\getbuffer [marginpicture]margin. You can imagine that it looks quite nice in some documents. But be careful. The margin is rather small so the figure could become very marginal. A few other examples are shown in the text below. \startbuffer The Ridderstraat (Street of knights) \inmargin{Street of\\Knights} is an obvious name. In the 14th and 15th centuries, nobles and prominent citizens lived in this street. Some of their big houses were later turned into poorhouses \inright{poorhouse}and old peoples homes. Up until \inleft[low]{\tfc 1940}1940 there was a synagog in the Ridderstraat. Some 40 Jews gathered there to celebrate their sabbath. During the war all Jews were deported to Westerbork and then to the extermination camps in Germany and Poland. None of the Jewish families returned. The synagog was knocked down in 1958. \stopbuffer \typebuffer The commands \type{\inmargin}, \type{\inleft} and \type{\inright} all have the same function. In a two sided document \type{\inmargin} puts the margin text in the correct margin. The \type{\\} is used for line breaking. The example above would look like this: \getbuffer You can set up the margin text with: \starttyping \setupinmargin \stoptyping \stopcomponent
Background: For the study of gestational diabetes mellitus one of the types of diabetes mellitus a refined model is developed by considering different parameters which plays an important role in the field of gestational diabetes mellitus. Motherhood and a journey of having a child is a blessing of God and a significant occasion for every woman. This disease is associated with the pregnant women and now a day either its global or Indian scenario it is increasing and becoming a risk for women as well for fetus. It sometimes does not go with pregnancy but its effects can be seen afterwards. Many patents have been granted and filed in past two decades related to gestational diabetes mellitus. Method: A differential equations based model of different parameters are taken into account for gestational diabetes i.e. glucose concentration, insulin concentration, placental volume, beta-cell mass and haemoglobin alc. Further in this work the stability of model is discussed by routh-hurwitz stability criterion. Results: Different parameters are taken into account for gestational diabetes i.e. glucose concentration, insulin concentration, placental volume, beta-cell mass and haemoglobin alc. Further in this chapter the stability of model is discussed by routh-hurwitz stability criterion. MATlab simulation is used for graphical representation. Conclusion: In this work, different parameters associated with diabetes mellitus has been taken into consideration for the mathematical model which shows the effects on glucose level and thus helpful in understanding the role of these parameters in the diabetes. In future by understanding the role of these parameters necessary action can be taken as precautions to avoid/treat gestational diabetes mellitus. Haemoglobin A1c, β-cell mass, placental volume, Gestational Diabetes Mellitus (GDM), Routh-Hurwitz (RH) stability criterion, equations based model.
module Data.So import Data.Bool %default total ||| Ensure that some run-time Boolean test has been performed. ||| ||| This lifts a Boolean predicate to the type level. See the function `choose` ||| if you need to perform a Boolean test and convince the type checker of this ||| fact. ||| ||| If you find yourself using `So` for something other than primitive types, ||| it may be appropriate to define a type of evidence for the property that you ||| care about instead. public export data So : Bool -> Type where Oh : So True export Uninhabited (So False) where uninhabited Oh impossible ||| Perform a case analysis on a Boolean, providing clients with a `So` proof export choose : (b : Bool) -> Either (So b) (So (not b)) choose True = Left Oh choose False = Right Oh export eqToSo : b = True -> So b eqToSo Refl = Oh export soToEq : So b -> b = True soToEq Oh = Refl ||| If `b` is True, `not b` can't be True export soToNotSoNot : So b -> Not (So (not b)) soToNotSoNot Oh = uninhabited ||| If `not b` is True, `b` can't be True export soNotToNotSo : So (not b) -> Not (So b) soNotToNotSo = flip soToNotSoNot export soAnd : {a : Bool} -> So (a && b) -> (So a, So b) soAnd soab with (choose a) soAnd {a=True} soab | Left Oh = (Oh, soab) soAnd {a=True} soab | Right prf = absurd prf soAnd {a=False} soab | Right prf = absurd soab export andSo : (So a, So b) -> So (a && b) andSo (Oh, Oh) = Oh export soOr : {a : Bool} -> So (a || b) -> Either (So a) (So b) soOr soab with (choose a) soOr {a=True} _ | Left Oh = Left Oh soOr {a=False} _ | Left Oh impossible soOr {a=False} soab | Right Oh = Right soab soOr {a=True} _ | Right Oh impossible export orSo : Either (So a) (So b) -> So (a || b) orSo (Left Oh) = Oh orSo (Right Oh) = rewrite orTrueTrue a in Oh
//===- PeBinaryPrinter.cpp --------------------------------------*- C++ -*-===// // // Copyright (C) 2020 GrammaTech, Inc. // // This code is licensed under the MIT license. See the LICENSE file in the // project root for license terms. // // This project is sponsored by the Office of Naval Research, One Liberty // Center, 875 N. Randolph Street, Arlington, VA 22203 under contract # // N68335-17-C-0700. The content of the information does not necessarily // reflect the position or policy of the Government and no official // endorsement should be inferred. // //===----------------------------------------------------------------------===// #include "PeBinaryPrinter.hpp" #include "AuxDataSchema.hpp" #include "AuxDataUtils.hpp" #include "FileUtils.hpp" #include "driver/Logger.h" #include <iostream> #include <boost/filesystem.hpp> #include <boost/process/io.hpp> #include <boost/process/search_path.hpp> #include <boost/process/system.hpp> namespace fs = boost::filesystem; namespace bp = boost::process; namespace gtirb_bprint { // Command-line argument wrapper for `lib.exe' or alternate library utility. struct PeLibOptions { const std::string& DefFile; const std::string& LibFile; const std::optional<std::string> Machine; }; // Command-line argument wrapper for `ml64.exe' or alternate assembler. struct PeAssembleOptions { const std::string& Compiland; const std::string& OutputFile; const std::optional<std::string> Machine; const std::vector<std::string>& ExtraCompileArgs; const std::vector<std::string>& LibraryPaths; }; // Command-line argument wrapper for `ml64.exe' and `link.exe' or alternatives. struct PeLinkOptions { const std::string& OutputFile; const std::vector<TempFile>& Compilands; const std::vector<std::string>& Resources; const std::optional<std::string>& ExportDef; const std::optional<std::string>& EntryPoint; const std::optional<std::string>& Subsystem; const std::optional<std::string> Machine; const bool Dll; const std::vector<std::string>& ExtraCompileArgs; const std::vector<std::string>& LibraryPaths; }; // Type helpers for command lookup and command-line argument builders. using CommandList = std::vector<std::pair<std::string, std::vector<std::string>>>; using PeLib = std::function<CommandList(const PeLibOptions&)>; using PeAssemble = std::function<CommandList(const PeAssembleOptions&)>; using PeLink = std::function<CommandList(const PeLinkOptions&)>; using PeAssembleLink = std::function<CommandList(const PeLinkOptions&)>; // Tool lookup helpers. PeLib peLib(); PeAssemble peAssemble(); PeLink peLink(); PeAssembleLink peAssembleLink(); // Locate a PE library utility and build a command list. CommandList libCommands(const PeLibOptions& Options) { PeLib Lib = peLib(); return Lib(Options); } // Locate an assembler and construct the "assemble only" command list. CommandList assembleCommands(const PeAssembleOptions& Options) { PeAssemble Assemble = peAssemble(); return Assemble(Options); } // Locate an assembler and construct the "assemble and link" command list. CommandList linkCommands(const PeLinkOptions& Options) { PeAssembleLink AssembleLink = peAssembleLink(); return AssembleLink(Options); } // Read LLVM bin directory path from `llvm-config --bindir'. std::optional<std::string> llvmBinDir() { bp::ipstream InputStream; // Look for a default `llvm-config' binary. fs::path LlvmConfig = bp::search_path("llvm-config"); if (LlvmConfig.empty()) { // Look for known versions. const static std::vector<std::string> Versions = { "12", "11", "10", "9", "8", "7", "6.0", }; for (const auto& Version : Versions) { LlvmConfig = bp::search_path("llvm-config-" + Version); if (!LlvmConfig.empty()) { break; } } } if (LlvmConfig.empty()) { return std::nullopt; } bp::child Child(LlvmConfig, "--bindir", bp::std_out > InputStream); std::string Line; if (Child.running() && std::getline(InputStream, Line) && !Line.empty()) { return Line; } return std::nullopt; } inline void appendCommands(CommandList& T, CommandList& U) { T.insert(T.end(), std::make_move_iterator(U.begin()), std::make_move_iterator(U.end())); } int executeCommands(const CommandList& Commands) { for (const auto& [Command, Args] : Commands) { { std::stringstream Stream; Stream << "Execute: " << Command; for (const auto& Arg : Args) { Stream << " " << Arg; } LOG_INFO << Stream.str() << "\n"; } if (std::optional<int> Rc = execute(Command, Args)) { if (*Rc) { LOG_ERROR << Command << ": non-zero exit code: " << *Rc << "\n"; return -1; } continue; } LOG_ERROR << Command << ": command not found\n"; return -1; } return 0; } // lib.exe /DEF:X.def /OUT:X.lib // Input: DEF Output: LIB CommandList msvcLib(const PeLibOptions& Options) { std::vector<std::string> Args = { "/NOLOGO", "/DEF:" + Options.DefFile, "/OUT:" + Options.LibFile, }; if (Options.Machine) { Args.push_back("/MACHINE:" + *Options.Machine); } return {{"lib.exe", Args}}; } // ml64.exe/ml.exe /c ... // Input: ASM Output: OBJ CommandList msvcAssemble(const PeAssembleOptions& Options) { std::vector<std::string> Args = { // Disable the banner for the assembler. "/nologo", // Set one-time options like the output file name. "/Fe", Options.OutputFile, // Set per-compiland options, if any. "/c", "/Fo", Options.OutputFile, // Set the file to be assembled. Options.Compiland}; // Copy in any user-supplied, command-line arguments. std::copy(Options.ExtraCompileArgs.begin(), Options.ExtraCompileArgs.end(), std::back_inserter(Args)); const std::string& Assembler = Options.Machine == "X64" ? "ml64.exe" : "ml.exe"; return {{Assembler, Args}}; } // link.exe // Input: OBJ Output: PE32(+) CommandList msvcLink(const PeLinkOptions& Options) { std::vector<std::string> Args = { // Disable the banner for the assembler. "/NOLOGO", // Set one-time options like the output file name. "/OUT:" + Options.OutputFile, }; // Add exports DEF file. if (Options.ExportDef) { Args.push_back("/DEF:" + *Options.ExportDef); } // Add PE entry point. if (Options.EntryPoint) { Args.push_back("/ENTRY:" + *Options.EntryPoint); } else { Args.push_back("/NOENTRY"); } // Add PE subsystem. if (Options.Subsystem) { Args.push_back("/SUBSYSTEM:" + *Options.Subsystem); } // Add shared library flag. if (Options.Dll) { Args.push_back("/DLL"); } // Add user-specified library paths. for (const std::string& Path : Options.LibraryPaths) { Args.push_back("/LIBPATH:" + Path); } // Add all OBJ files. for (const TempFile& Compiland : Options.Compilands) { std::string File = fs::path(Compiland.fileName()).filename().string(); File = replaceExtension(File, ".obj"); Args.push_back(File); } return {{"link.exe", Args}}; } // Single-command assemble and link: // ml64.exe/ml.exe ... /link ... // Input: .ASM Output: PE32(+) CommandList msvcAssembleLink(const PeLinkOptions& Options) { // Build the assembler command-line arguments. std::vector<std::string> Args; // Disable the banner for the assembler. Args.push_back("/nologo"); // Set one-time options like the output file name. Args.push_back("/Fe"); Args.push_back(Options.OutputFile); // Add all Module assembly sources (temp files). for (const TempFile& Compiland : Options.Compilands) { Args.push_back(Compiland.fileName()); } // Add user-supplied command-line arguments. std::copy(Options.ExtraCompileArgs.begin(), Options.ExtraCompileArgs.end(), std::back_inserter(Args)); // Build the linker command-line arguments. Args.push_back("/link"); // Disable the banner for the linker. Args.push_back("/nologo"); // Add exports DEF file. if (Options.ExportDef) { Args.push_back("/DEF:" + *Options.ExportDef); } // Add RES resource files. for (const std::string& Resource : Options.Resources) { Args.push_back(Resource); } // Add PE entry point. if (Options.EntryPoint) { Args.push_back("/ENTRY:" + *Options.EntryPoint); } else { Args.push_back("/NOENTRY"); } // Add PE subsystem. if (Options.Subsystem) { Args.push_back("/SUBSYSTEM:" + *Options.Subsystem); } // Add shared library flag. if (Options.Dll) { Args.push_back("/DLL"); } // Add user-specified library paths. for (const std::string& Path : Options.LibraryPaths) { Args.push_back("/LIBPATH:" + Path); } const std::string& Assembler = Options.Machine == "X64" ? "ml64.exe" : "ml.exe"; return {{Assembler, Args}}; } // llvm-dlltool -dX.def -lX.lib ... // Input: DEF Output: LIB CommandList llvmDllTool(const PeLibOptions& Options) { std::vector<std::string> Args = { "-d", Options.DefFile, "-l", Options.LibFile, "-m", Options.Machine == "X86" ? "i386" : "i386:x86-64"}; return {{"llvm-dlltool", Args}}; } // lld-link /DEF:X.def /OUT:X.lib ... // Input: DEF Output: LIB CommandList llvmLib(const PeLibOptions& Options) { std::vector<std::string> Args = { "/DEF:" + Options.DefFile, "/OUT:" + Options.LibFile, }; if (Options.Machine) { Args.push_back("/MACHINE:" + *Options.Machine); } return {{"lld-link", Args}}; } // lld-link // Input: OBJ Output: PE32(+) CommandList llvmLink(const PeLinkOptions& Options) { std::vector<std::string> Args = { // Disable the banner for the assembler. "/nologo", // Set one-time options like the output file name. "/out:" + Options.OutputFile, }; // Add exports DEF file. if (Options.ExportDef) { Args.push_back("/def:" + *Options.ExportDef); } // Add PE entry point. if (Options.EntryPoint) { Args.push_back("/entry:" + *Options.EntryPoint); } // Add PE subsystem. if (Options.Subsystem) { Args.push_back("/subsystem:" + *Options.Subsystem); } // Add shared library flag. if (Options.Dll) { Args.push_back("/dll"); } if (Options.Machine) { Args.push_back("/machine:" + *Options.Machine); } // Add user-specified library paths. for (const std::string& Path : Options.LibraryPaths) { Args.push_back("/libpath:" + Path); } // Add all OBJ files. for (const TempFile& Compiland : Options.Compilands) { std::string File = fs::path(Compiland.fileName()).filename().string(); File = replaceExtension(File, ".obj"); Args.push_back(File); } // Add RES resource files. for (const std::string& Resource : Options.Resources) { Args.push_back(Resource); } return {{"lld-link", Args}}; } // uasm -win64/-coff -Fo ... // Input: ASM Output: OBJ CommandList uasmAssemble(const PeAssembleOptions& Options) { // Map PE machine target to UASM output format. const std::string& Format = Options.Machine == "X64" ? "-win64" : "-coff"; std::vector<std::string> Args = {// Disable the banner for the assembler. "-nologo", "-less", // Set output format. Format, // Add common options. "-safeseh", // Set object file name. "-Fo", Options.OutputFile, // Lastly, specify assembly file. Options.Compiland}; // Add user-supplied, command-line arguments. std::copy(Options.ExtraCompileArgs.begin(), Options.ExtraCompileArgs.end(), std::back_inserter(Args)); return {{"uasm", Args}}; } // uasm -win64/-coff ... // <LINK> // Input: ASM Output: PE32(+) CommandList uasmAssembleLink(const PeLinkOptions& Options) { // Map PE machine target to UASM output format. const std::string& Format = Options.Machine == "X64" ? "-win64" : "-coff"; std::vector<std::string> Args = {// Disable the banner for the assembler. "-nologo", "-less", // Add common options. "-safeseh", // Set output format. Format}; // Add user-supplied, command-line arguments. std::copy(Options.ExtraCompileArgs.begin(), Options.ExtraCompileArgs.end(), std::back_inserter(Args)); for (const TempFile& Compiland : Options.Compilands) { std::string File = fs::path(Compiland.fileName()).filename().string(); File = replaceExtension(File, ".obj"); Args.push_back("-Fo"); Args.push_back(std::move(File)); Args.push_back(Compiland.fileName()); } CommandList Commands = {{"uasm", Args}}; // Find linker and add link commands. auto Link = peLink(); CommandList LinkCommands = Link(Options); appendCommands(Commands, LinkCommands); return Commands; } // Locate `lib.exe' or alternative PE library tool. PeLib peLib() { // Prefer MSVC `lib.exe'. fs::path Path = bp::search_path("lib.exe"); if (!Path.empty()) { return msvcLib; } else { LOG_INFO << "lib.exe: command not found\n"; } // Add LLVM bin directory to PATH. if (std::optional<std::string> Dir = llvmBinDir()) { auto Env = boost::this_process::environment(); Env["PATH"] += ":" + *Dir; } else { LOG_INFO << "llvm-config: command not found\n"; } // Fallback to `llvm-dlltool'. Path = bp::search_path("llvm-dlltool"); if (!Path.empty()) { return llvmDllTool; } // Fallback to `lld-link': // When `link.exe' is invoked with `/DEF:' and no input files, it behaves as // `lib.exe' would. LLVM's `lld-link' emulates this behavior. Path = bp::search_path("lld-link"); if (!Path.empty()) { return llvmLib; } return msvcLib; } // Locate `link.exe' or alternative PE linker. PeLink peLink() { // Prefer MSVC `link.exe'. fs::path Path = bp::search_path("link.exe"); if (!Path.empty()) { return msvcLink; } // Fallback to `lld-link'. Path = bp::search_path("lld-link"); if (!Path.empty()) { return llvmLink; } return msvcLink; } // Locate MSVC `ml' or `uasm' MASM assembler. PeAssemble peAssemble() { // Prefer MSVC assembler. fs::path Path = bp::search_path("cl"); if (!Path.empty()) { return msvcAssemble; } // Fallback to UASM. Path = bp::search_path("uasm"); if (!Path.empty()) { return uasmAssemble; } return msvcAssemble; } // Locate "assemble and link" tools. PeAssembleLink peAssembleLink() { // Prefer single, compound MSVC command. fs::path Path = bp::search_path("cl"); if (!Path.empty()) { return msvcAssembleLink; } // Fallback to UASM and a subsequent link command. Path = bp::search_path("uasm"); if (!Path.empty()) { return uasmAssembleLink; } return msvcAssembleLink; } // Map GTIRB ISA to MSVC /MACHINE: strings. std::optional<std::string> getPeMachine(const gtirb::Module& Module) { switch (Module.getISA()) { case gtirb::ISA::IA32: return "X86"; case gtirb::ISA::X64: return "X64"; default: break; } return std::nullopt; } std::optional<std::string> getPeMachine(const gtirb::IR& IR) { if (const auto& It = IR.modules(); !It.empty()) { return getPeMachine(*It.begin()); } return std::nullopt; } // Find an entrypoint symbol defined in any Module. // NOTE: `ml64.exe' cannot automatically determine what the entrypoint is. std::optional<std::string> getEntrySymbol(const gtirb::IR& IR) { // Find out whether there are modules with entry points. auto Found = std::find_if( IR.modules_begin(), IR.modules_end(), [](const gtirb::Module& M) { return M.getEntryPoint() != nullptr; }); if (Found != IR.modules_end()) { // The MASM pprint always adds an __EntryPoint symbol // pointing to the entry point CodeBlock. std::string Name("__EntryPoint"); // ML (PE32) will implicitly prefix the symbol with an additional '_', so // we remove one for the command-line option. if (Found->getISA() == gtirb::ISA::IA32 && Name.size() && Name[0] == '_') { Name = Name.substr(1); } return Name; } return std::nullopt; } std::optional<std::string> getPeSubsystem(const gtirb::IR& IR) { // Find the first Module with an entry point. auto Found = std::find_if( IR.modules_begin(), IR.modules_end(), [](const gtirb::Module& M) { return M.getEntryPoint() != nullptr; }); // Reference the Module's `binaryType' AuxData table for the subsystem label. if (Found != IR.modules_end()) { auto T = aux_data::getBinaryType(*Found); if (!T.empty()) { if (std::find(T.begin(), T.end(), "WINDOWS_GUI") != T.end()) { return "windows"; } else if (std::find(T.begin(), T.end(), "WINDOWS_CUI") != T.end()) { return "console"; } } } return std::nullopt; } bool isPeDll(const gtirb::IR& IR) { for (const gtirb::Module& Module : IR.modules()) { auto Table = aux_data::getBinaryType(Module); if (std::find(Table.begin(), Table.end(), "DLL") != Table.end()) { return true; } } return false; } PeBinaryPrinter::PeBinaryPrinter( const gtirb_pprint::PrettyPrinter& Printer_, const std::vector<std::string>& ExtraCompileArgs_, const std::vector<std::string>& LibraryPaths_) : BinaryPrinter(Printer_, ExtraCompileArgs_, LibraryPaths_) {} int PeBinaryPrinter::assemble(const std::string& Path, gtirb::Context& Context, gtirb::Module& Module) const { // Print the Module to a temporary assembly file. TempFile Asm; if (!prepareSource(Context, Module, Asm)) { LOG_ERROR << "Failed to write assembly to temporary file.\n"; return -1; } // Find the target platform. std::optional<std::string> Machine = getPeMachine(Module); return executeCommands(assembleCommands( {Asm.fileName(), Path, Machine, ExtraCompileArgs, LibraryPaths})); } int PeBinaryPrinter::link(const std::string& OutputFile, gtirb::Context& Context, gtirb::IR& IR) const { // Prepare all ASM sources (temp files). std::vector<TempFile> Compilands; if (!prepareSources(Context, IR, Compilands)) { LOG_ERROR << "Failed to write assembly to temporary file.\n"; return -1; } // Prepare DEF import definition files (temp files). std::map<std::string, std::unique_ptr<TempFile>> ImportDefs; if (!prepareImportDefs(IR, ImportDefs)) { LOG_ERROR << "Failed to write import .DEF files."; return -1; } // Generate a DEF file for all exports. TempFile DefFile(".def"); std::optional<std::string> ExportDef; if (prepareExportDef(IR, DefFile)) { ExportDef = DefFile.fileName(); } // Prepare RES resource files for the linker. std::vector<std::string> Resources; if (!prepareResources(IR, Context, Resources)) { LOG_ERROR << "Failed to write resource .RES files."; return -1; } // Find a named symbol for the entry point. std::optional<std::string> EntryPoint = getEntrySymbol(IR); // Find the PE subsystem. std::optional<std::string> Subsystem = getPeSubsystem(IR); // Find the target platform. std::optional<std::string> Machine = getPeMachine(IR); // Find the PE binary type. bool Dll = isPeDll(IR); // Build the list of commands. CommandList Commands; // Add commands to generate .LIB files from import .DEF files. for (auto& [Import, Temp] : ImportDefs) { std::string Def = Temp->fileName(); std::string Lib = replaceExtension(Import, ".lib"); CommandList LibCommands = libCommands({Def, Lib, Machine}); appendCommands(Commands, LibCommands); } // Add assemble-link commands. CommandList LinkCommands = linkCommands({OutputFile, Compilands, Resources, ExportDef, EntryPoint, Subsystem, Machine, Dll, ExtraCompileArgs, LibraryPaths}); appendCommands(Commands, LinkCommands); // Execute the assemble-link command list. return executeCommands(Commands); } int PeBinaryPrinter::libs(const gtirb::IR& IR) const { // Prepare DEF import definition files (temp files). std::map<std::string, std::unique_ptr<TempFile>> ImportDefs; if (!prepareImportDefs(IR, ImportDefs)) { LOG_ERROR << "Failed to write import .DEF files."; return -1; } // Find the target platform. std::optional<std::string> Machine = getPeMachine(IR); // Build the list of commands. CommandList Commands; // Add commands to generate .LIB files from import .DEF files. for (auto& [Import, Temp] : ImportDefs) { std::string Def = Temp->fileName(); std::string Lib = replaceExtension(Import, ".lib"); CommandList LibCommands = libCommands({Def, Lib, Machine}); appendCommands(Commands, LibCommands); } return executeCommands(Commands); } int PeBinaryPrinter::resources(const gtirb::IR& IR, const gtirb::Context& Context) const { // Prepare RES resource files for the linker. std::vector<std::string> Resources; if (!prepareResources(IR, Context, Resources)) { LOG_ERROR << "Failed to write resource .RES files."; return -1; } return 0; } bool PeBinaryPrinter::prepareImportDefs( const gtirb::IR& IR, std::map<std::string, std::unique_ptr<TempFile>>& ImportDefs) const { LOG_INFO << "Preparing import LIB files...\n"; for (const gtirb::Module& Module : IR.modules()) { auto PeImports = aux_data::getImportEntries(Module); if (PeImports.empty()) { LOG_INFO << "Module: " << Module.getBinaryPath() << ": No import entries.\n"; continue; } // For each import in the AuxData table. for (const auto& [Addr, Ordinal, Name, Import] : PeImports) { (void)Addr; // unused binding auto It = ImportDefs.find(Import); if (It == ImportDefs.end()) { // Create a new (temporary) DEF file. ImportDefs[Import] = std::make_unique<TempFile>(".def"); It = ImportDefs.find(Import); std::ostream& Stream = static_cast<std::ostream&>(*(It->second)); Stream << "LIBRARY \"" << It->first << "\"\n\nEXPORTS\n"; } // Write the entry to the DEF file. std::ostream& Stream = static_cast<std::ostream&>(*(It->second)); if (Ordinal != -1) { Stream << Name << " @ " << Ordinal << " NONAME\n"; } else { Stream << Name << "\n"; } } } // Close the temporary files. for (auto& It : ImportDefs) { It.second->close(); } return true; } bool PeBinaryPrinter::prepareExportDef(gtirb::IR& IR, TempFile& Def) const { std::vector<std::string> Exports; for (const gtirb::Module& Module : IR.modules()) { LOG_INFO << "Preparing exports DEF file...\n"; auto PeExports = aux_data::getExportEntries(Module); if (PeExports.empty()) { LOG_INFO << "Module: " << Module.getBinaryPath() << ": No export entries.\n"; continue; } for (const auto& [Addr, Ordinal, Name] : PeExports) { (void)Addr; // unused binding std::string Extra; auto It = Module.findSymbols(Name); if (It.begin()->getReferent<gtirb::DataBlock>()) { Extra = " DATA"; } std::stringstream Stream; if (Ordinal != -1) { Stream << Name << " @ " << Ordinal << Extra << "\n"; } else { Stream << Name << Extra << "\n"; } Exports.push_back(Stream.str()); } } if (!Exports.empty()) { std::ostream& Stream = static_cast<std::ostream&>(Def); Stream << "\nEXPORTS\n"; for (std::string& Export : Exports) { Stream << Export; } } Def.close(); return !Exports.empty(); } bool PeBinaryPrinter::prepareResources( const gtirb::IR& IR, const gtirb::Context& Context, std::vector<std::string>& Resources) const { LOG_INFO << "Preparing resource RES files...\n"; for (const gtirb::Module& Module : IR.modules()) { auto Table = aux_data::getPEResources(Module); if (Table.empty()) { LOG_INFO << "Module: " << Module.getBinaryPath() << ": No resources.\n"; continue; } std::ofstream Stream; std::string Filename = replaceExtension(Module.getName(), ".res"); Stream.open(Filename, std::ios::binary | std::ios::trunc); if (!Stream.is_open()) { LOG_ERROR << "Unable to open resource file: " << Filename << "\n"; return false; } // RES file header ... const uint8_t FileHeader[] = { 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; Stream.write(reinterpret_cast<const char*>(&FileHeader), 32); // ... followed by a list of header/data blocks. for (const auto& [Header, Offset, Size] : Table) { // Write resource header. Stream.write(reinterpret_cast<const char*>(Header.data()), Header.size()); const gtirb::ByteInterval* ByteInterval = dyn_cast_or_null<gtirb::ByteInterval>( gtirb::Node::getByUUID(Context, Offset.ElementId)); if (ByteInterval) { // Write resource data. auto Data = ByteInterval->rawBytes<const uint8_t>() + Offset.Displacement; if (Offset.Displacement + Size > ByteInterval->getSize()) { LOG_DEBUG << "Insufficient data in byte interval for PE resource.\n"; } // Data is longer than the ByteInterval provides. if (Data) { Stream.write(reinterpret_cast<const char*>(Data), Size); } else { LOG_DEBUG << "Unable to get PE resource data\n"; } // Write padding to align subsequent headers. if (Size % 4 != 0) { uint32_t tmp = 0x0000; Stream.write(reinterpret_cast<const char*>(&tmp), 4 - Size % 4); } } else { LOG_DEBUG << "Could not find byte interval for PE resource data.\n"; } } Stream.close(); Resources.push_back(Filename); } return true; } } // namespace gtirb_bprint
-- Copyright © 2019 François G. Dorais. All rights reserved. -- Released under Apache 2.0 license as described in the file LICENSE. import .basic namespace universal variables {τ : Type} {σ : Type*} (sig : signature τ σ) abbreviation substitution (dom₁ dom₂ : list τ) := Π (i : index dom₁), term sig dom₂ i.val namespace substitution variables {sig} {dom₁ dom₂ dom₃ : list τ} (sub : substitution sig dom₁ dom₂) abbreviation to_valuation : algebra.valuation (term_algebra sig dom₂) dom₁ := sub abbreviation apply {cod} (t : term sig dom₁ cod) : term sig dom₂ cod := algebra.eval (term_algebra sig dom₂) t sub theorem apply_def {cod} (t : term sig dom₁ cod) : sub.apply t = (term_algebra sig dom₂).eval t sub := rfl theorem apply_proj {i : index dom₁} : sub.apply (term.proj i) = sub i := rfl theorem apply_func {f} (ts : Π (i : sig.index f), term sig dom₁ i.val) : sub.apply (term.func f ts) = term.func f (λ i, sub.apply (ts i)) := rfl theorem eval (alg : algebra sig) : ∀ {cod} (t : term sig dom₁ cod) (val : Π (i : index dom₂), alg.sort i.val), alg.eval (sub.apply t) val = alg.eval t (λ i, alg.eval (sub i) val) | _ (term.proj i) val := rfl | _ (term.func f ts) val := have IH : (λ i, alg.eval (sub.apply (ts i)) val) = (λ i, alg.eval (ts i) (λ i, alg.eval (sub i) val)), from funext $ λ i, eval (ts i) val, calc alg.eval (sub.apply (term.func f ts)) val = alg.func f (λ i, alg.eval (sub.apply (ts i)) val) : rfl ... = alg.func f (λ i, alg.eval (ts i) (λ i, alg.eval (sub i) val)) : by rw IH ... = alg.eval (term.func f ts) (λ (i : index dom₁), alg.eval (sub i) val) : by reflexivity abbreviation id {dom : list τ} : substitution sig dom dom := term.proj @[simp] theorem id_apply {dom : list τ} : ∀ {cod} (t : term sig dom cod), substitution.id.apply t = t | _ (term.proj _) := rfl | _ (term.func f ts) := have (λ i, apply id (ts i)) = ts, from funext $ λ i, id_apply (ts i), calc apply id (term.func f ts) = term.func f (λ i, apply id (ts i)) : rfl ... = term.func f ts : by rw this abbreviation comp : substitution sig dom₂ dom₃ → substitution sig dom₁ dom₂ → substitution sig dom₁ dom₃ := λ sub₂₃ sub₁₂ i, sub₂₃.apply (sub₁₂ i) @[simp] theorem comp_apply (sub₂₃ : substitution sig dom₂ dom₃) (sub₁₂ : substitution sig dom₁ dom₂) : ∀ {cod} (t : term sig dom₁ cod), (comp sub₂₃ sub₁₂).apply t = sub₂₃.apply (sub₁₂.apply t) | _ (term.proj _) := rfl | _ (term.func f ts) := have (λ i, (comp sub₂₃ sub₁₂).apply (ts i)) = (λ i, sub₂₃.apply (sub₁₂.apply (ts i))), from funext $ λ i, comp_apply (ts i), calc (comp sub₂₃ sub₁₂).apply (term.func f ts) = term.func f (λ i, (comp sub₂₃ sub₁₂).apply (ts i)) : rfl ... = term.func f (λ i, sub₂₃.apply (sub₁₂.apply (ts i))) : by rw this ... = sub₂₃.apply (term.func f (λ i, sub₁₂.apply (ts i))) : by rw apply_func sub₂₃ ... = sub₂₃.apply (apply sub₁₂ (term.func f ts)) : by rw apply_func sub₁₂ end substitution section subst variables {sig} {dom₁ dom₂ : list τ} (sub : substitution sig dom₁ dom₂) abbreviation term.subst {{cod}} : term sig dom₁ cod → term sig dom₂ cod := sub.apply abbreviation equation.subst {{cod}} : equation sig dom₁ cod → equation sig dom₂ cod := λ e, ⟨sub.apply e.lhs, sub.apply e.rhs⟩ theorem equation.subst_lhs {cod} (e : equation sig dom₁ cod) : (e.subst sub).lhs = e.lhs.subst sub := rfl theorem equation.subst_rhs {cod} (e : equation sig dom₁ cod) : (e.subst sub).rhs = e.rhs.subst sub := rfl theorem subst_subst {dom₁ dom₂ dom₃ : list τ} (sub₂₃ : substitution sig dom₂ dom₃) (sub₁₂ : substitution sig dom₁ dom₂) {cod} (t : term sig dom₁ cod) : t.subst (λ i, (sub₁₂ i).subst sub₂₃) = (t.subst sub₁₂).subst sub₂₃ := substitution.comp_apply sub₂₃ sub₁₂ t @[simp] theorem subst_proj {dom} {cod} (t : term sig dom cod) : t.subst term.proj = t := substitution.id_apply t end subst end universal
(* Title: HOL/Auth/n_german_lemma_on_inv__3.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_on_inv__3 imports n_german_base begin section{*All lemmas on causal relation between inv__3 and some rule r*} lemma n_SendInvAckVsinv__3: assumes a1: "(\<exists> i. i\<le>N\<and>r=n_SendInvAck i)" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__3 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__3 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__3: assumes a1: "(\<exists> i. i\<le>N\<and>r=n_RecvInvAck i)" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__3 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__3 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 "((formEval (eqn (IVar (Ident ''ExGntd'')) (Const true)) s))\<or>((formEval (neg (eqn (IVar (Ident ''ExGntd'')) (Const true))) s))" by auto moreover { assume c1: "((formEval (eqn (IVar (Ident ''ExGntd'')) (Const true)) s))" have "?P3 s" apply (cut_tac a1 a2 b1 c1, simp, rule_tac x="(neg (andForm (eqn (IVar (Field (Para (Ident ''Cache'') p__Inv2) ''State'')) (Const E)) (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 c1: "((formEval (neg (eqn (IVar (Ident ''ExGntd'')) (Const true))) s))" have "?P2 s" proof(cut_tac a1 a2 b1 c1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } ultimately have "invHoldForRule s f r (invariants N)" by satx } moreover { assume b1: "(i~=p__Inv2)" have "((formEval (eqn (IVar (Ident ''ExGntd'')) (Const true)) s))\<or>((formEval (neg (eqn (IVar (Ident ''ExGntd'')) (Const true))) s))" by auto moreover { assume c1: "((formEval (eqn (IVar (Ident ''ExGntd'')) (Const true)) s))" have "?P3 s" apply (cut_tac a1 a2 b1 c1, simp, rule_tac x="(neg (andForm (eqn (IVar (Field (Para (Ident ''Cache'') p__Inv2) ''State'')) (Const E)) (eqn (IVar (Field (Para (Ident ''Chan3'') i) ''Cmd'')) (Const InvAck))))" in exI, auto) done then have "invHoldForRule s f r (invariants N)" by auto } moreover { assume c1: "((formEval (neg (eqn (IVar (Ident ''ExGntd'')) (Const true))) s))" have "?P2 s" proof(cut_tac a1 a2 b1 c1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } ultimately have "invHoldForRule s f r (invariants N)" by satx } ultimately show "invHoldForRule s f r (invariants N)" by satx qed lemma n_SendGntEVsinv__3: 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__3 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__3 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 "?P1 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__3: assumes a1: "(\<exists> i. i\<le>N\<and>r=n_RecvGntS i)" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__3 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__3 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__3: assumes a1: "(\<exists> i. i\<le>N\<and>r=n_RecvGntE i)" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__3 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__3 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 (Ident ''ExGntd'')) (Const false)) (eqn (IVar (Field (Para (Ident ''Chan2'') p__Inv2) ''Cmd'')) (Const GntE))))" 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_SendReqE__part__1Vsinv__3: 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__3 p__Inv2)" shows "invHoldForRule s f r (invariants N)" apply (rule noEffectOnRule, cut_tac a1 a2, auto) done lemma n_StoreVsinv__3: 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__3 p__Inv2)" shows "invHoldForRule s f r (invariants N)" apply (rule noEffectOnRule, cut_tac a1 a2, auto) done lemma n_SendGntSVsinv__3: assumes a1: "\<exists> i. i\<le>N\<and>r=n_SendGntS i" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__3 p__Inv2)" shows "invHoldForRule s f r (invariants N)" apply (rule noEffectOnRule, cut_tac a1 a2, auto) done lemma n_RecvReqEVsinv__3: 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__3 p__Inv2)" shows "invHoldForRule s f r (invariants N)" apply (rule noEffectOnRule, cut_tac a1 a2, auto) done lemma n_SendInv__part__0Vsinv__3: 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__3 p__Inv2)" shows "invHoldForRule s f r (invariants N)" apply (rule noEffectOnRule, cut_tac a1 a2, auto) done lemma n_SendReqE__part__0Vsinv__3: 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__3 p__Inv2)" shows "invHoldForRule s f r (invariants N)" apply (rule noEffectOnRule, cut_tac a1 a2, auto) done lemma n_SendInv__part__1Vsinv__3: 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__3 p__Inv2)" shows "invHoldForRule s f r (invariants N)" apply (rule noEffectOnRule, cut_tac a1 a2, auto) done lemma n_SendReqSVsinv__3: assumes a1: "\<exists> i. i\<le>N\<and>r=n_SendReqS i" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__3 p__Inv2)" shows "invHoldForRule s f r (invariants N)" apply (rule noEffectOnRule, cut_tac a1 a2, auto) done lemma n_RecvReqSVsinv__3: 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__3 p__Inv2)" shows "invHoldForRule s f r (invariants N)" apply (rule noEffectOnRule, cut_tac a1 a2, auto) done end
#include <algorithm> #include <iostream> #include <string> #include <vector> #define BOOST_TEST_MAIN #include <boost/test/included/unit_test.hpp> #include "cxxplgr/secondary.hpp" BOOST_AUTO_TEST_CASE(test1) { using cxxplgr::secondary::split_into_words; std::string text = "Πάντες ἄνθρωποι τοῦ εἰδέναι ὀρέγονται φύσει σημεῖον δ'"; std::vector<std::string> result = split_into_words(text); BOOST_CHECK(result[0] == "Πάντες"); BOOST_CHECK(result[1] == "ἄνθρωποι"); BOOST_CHECK(result[2] == "τοῦ"); BOOST_CHECK(result[3] == "εἰδέναι"); BOOST_CHECK(result[4] == "ὀρέγονται"); BOOST_CHECK(result[5] == "φύσει"); BOOST_CHECK(result[6] == "σημεῖον"); BOOST_CHECK(result[7] == "δ'"); } BOOST_AUTO_TEST_CASE(test2) { using cxxplgr::secondary::split_into_words; std::string text = "συνήνεγκεν, [οἷον τοῖς φλεγματώδεσιν ἢ χολώδεσι [ἢ] πυρέττουσι καύσῳ], τέχνης. —πρὸς μὲν οὖν τὸ πράττειν ἐμπειρία τέχνης οὐδὲς δοκεῖ διαφέρειν"; std::vector<std::string> result = split_into_words(text); BOOST_CHECK(result[ 0] == "συνήνεγκεν"); BOOST_CHECK(result[ 1] == "οἷον"); BOOST_CHECK(result[ 2] == "τοῖς"); BOOST_CHECK(result[ 3] == "φλεγματώδεσιν"); BOOST_CHECK(result[ 4] == "ἢ"); BOOST_CHECK(result[ 5] == "χολώδεσι"); BOOST_CHECK(result[ 6] == "ἢ"); BOOST_CHECK(result[ 7] == "πυρέττουσι"); BOOST_CHECK(result[ 8] == "καύσῳ"); BOOST_CHECK(result[ 9] == "τέχνης"); BOOST_CHECK(result[10] == "πρὸς"); BOOST_CHECK(result[11] == "μὲν"); BOOST_CHECK(result[12] == "οὖν"); BOOST_CHECK(result[13] == "τὸ"); BOOST_CHECK(result[14] == "πράττειν"); BOOST_CHECK(result[15] == "ἐμπειρία"); BOOST_CHECK(result[16] == "τέχνης"); BOOST_CHECK(result[17] == "οὐδὲς"); BOOST_CHECK(result[18] == "δοκεῖ"); BOOST_CHECK(result[19] == "διαφέρειν"); }
[STATEMENT] lemma vdisjnt_vsubset_left: assumes "vdisjnt X Y" and "Z \<subseteq>\<^sub>\<circ> X" shows "vdisjnt Z Y" [PROOF STATE] proof (prove) goal (1 subgoal): 1. vdisjnt Z Y [PROOF STEP] using assms [PROOF STATE] proof (prove) using this: vdisjnt X Y Z \<subseteq>\<^sub>\<circ> X goal (1 subgoal): 1. vdisjnt Z Y [PROOF STEP] by (auto intro!: vsubset_antisym)
# Lane-Emden polytrope equation We want to solve the Lane-Emden equation: \begin{equation} \frac{1}{\xi^2} \frac{d}{d\xi} \left (\xi^2 \frac{d\theta}{d\xi} \right ) = -\theta^n \end{equation} using a Runge-Kutta integration. We will rewrite this as 2 first order equations: \begin{eqnarray*} \frac{dy}{d\xi} &=& z \\ \frac{dz}{d\xi} &=& -\frac{2}{\xi}z - y^n \end{eqnarray*} ```python import matplotlib.pyplot as plt import numpy as np %matplotlib inline ``` This is our main class that does the integration. We initialize it with the polytopic index, and then it will integrate the system for us. We can then plot it or get the parameters $\xi_1$ and $-\xi_1^2 d\theta/d\xi |_{\xi_1}$ We estimate the radius, $\xi_1$ each step and make sure that the next step does not take us past that estimate. This prevents us from having negative $\theta$ values. Given a point $(\xi_0, y_0)$, and the derivative at that point, $z_0 = dy/d\xi |_{\xi_0}$, we can write the equation of a line as: \begin{equation} y(\xi) - y_0 = z_0 (\xi - \xi_0) \end{equation} Then we can ask when does $y$ become zero, finding: \begin{equation} \xi = -\frac{y_0}{z_0} + \xi_0 \end{equation} This is our estimate of $\xi_1$. We then make sure our stepsize $h$ is small enough that we do not go beyond this estimate. This class uses 4th-order Runge-Kutta (or first-order Euler if we call with `first_order=True`) with a fixed stepsize, `h0`, until we reach the edge of the star. We need to be careful to choose a value of `h0` small enough to get an accurate solution. Ideally, we should implement a method that automatically does error estimation as it integrates, and varies the stepsize as needed. ```python class Polytrope: """a polytrope of index n""" def __init__(self, n, first_order=False, h0=0.1, tol=1.e-12): self.n = n # storage for the solution history self.xi = [] self.theta = [] self.dtheta_dxi = [] # solution for the current solution point (y, z) -- initialized to # the boundary conditions self.q = np.array([1.0, 0.0], dtype=np.float64) # already integrate the solution if first_order: self._integrate_euler(h0, tol) else: self._integrate_rk4(h0, tol) # convert the data to a numpy array so we can more easily # manipulate it self.xi = np.asarray(self.xi) self.theta = np.asarray(self.theta) self.dtheta_dxi = np.asarray(self.dtheta_dxi) def store_solution(self, xi, y, z): """store the current solution point in the history""" self.xi.append(xi) self.theta.append(y) self.dtheta_dxi.append(z) def _estimate_h(self, hin, xi): """estimate the new step size to ensure that theta does not go negative""" # Our systems is always convex (theta'' < 0), so the # intersection of theta' with the x-axis will always be # a conservative estimate of the radius of the star. # Make sure that the stepsize does not take us past that. R_est = xi - self.q[0]/self.q[1] if xi + hin > R_est: return -self.q[0]/self.q[1] return hin def _integrate_euler(self, h0, tol): """integrate the Lane-Emden system using first-order Euler""" xi = 0.0 h = h0 while h > tol: self.q += h * self._rhs(xi, self.q) xi += h h = self._estimate_h(h, xi) # store the solution self.store_solution(xi, self.q[0], self.q[1]) def _integrate_rk4(self, h0, tol): """integrate the Lane-Emden system""" xi = 0.0 h = h0 while h > tol: # 4th order RK integration -- first find the slopes k1 = self._rhs(xi, self.q) k2 = self._rhs(xi+0.5*h, self.q+0.5*h*k1) k3 = self._rhs(xi+0.5*h, self.q+0.5*h*k2) k4 = self._rhs(xi+h, self.q+h*k3) # now update the solution to the new xi self.q += (h/6.0)*(k1 + 2*k2 + 2*k3 + k4) xi += h h = self._estimate_h(h, xi) # store the solution: self.store_solution(xi, self.q[0], self.q[1]) def _rhs(self, xi, q): """ the righthand side of the LE system, q' = f""" f = np.zeros_like(q) # y' = z f[0] = q[1] # for z', we need to use the expansion if we are at xi = 0, # to avoid dividing by 0 if xi == 0.0: f[1] = (2.0/3.0) - q[0]**self.n else: f[1] = -2.0*q[1]/xi - q[0]**self.n return f def get_params(self): """ return the standard polytrope parameters xi_1, and [-xi**2 theta']_{xi_1} """ xi1 = self.xi[-1] p2 = -xi1**2 * self.dtheta_dxi[-1] return xi1, p2 def plot(self): """ plot the solution """ plt.plot(self.xi, self.theta, label=r"$\theta$") plt.plot(self.xi, self.theta**self.n, label=r"$\rho/\rho_c$") plt.xlabel(r"$\xi$") plt.legend(frameon=False) plt.show() ``` We can plot any of the polytrope solutions ```python p = Polytrope(1.5) p.plot() ``` ```python p = Polytrope(4) p.plot() ``` ### properties with varying polytropic index Here's a table of the important parameters ```python for i, nindex in enumerate([0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5]): p = Polytrope(nindex) params = p.get_params() if i == 0: print(f"{'n':4} : {'ξ_1':^20} {'-ξ_1**2 dθ/ξ |_{ξ_1}':^20}") print(f"{nindex:4} : {params[0]:20.10g} {params[1]:20.10g}") ``` n : ξ_1 -ξ_1**2 dθ/ξ |_{ξ_1} 0 : 2.45 4.902041667 0.5 : 2.752694496 3.787683423 1 : 3.141591734 3.141593131 1.5 : 3.653752765 2.714056597 2 : 4.352873728 2.411044249 2.5 : 5.355275716 2.187197386 3 : 6.896852479 2.018233566 3.5 : 9.535820161 1.89055466 4 : 14.9716009 1.797227648 4.5 : 31.8367713 1.737797137 ### accuracy We can look at the accuracy by varying the step size, $h$, we use in the Runge-Kutta integration. ```python for i, h in enumerate([1, 0.5, 0.25, 0.125]): p = Polytrope(1.5, h0=h, first_order=False) params = p.get_params() if i == 0: print(f"{'h0':6} : {'ξ_1':^20} {'-ξ_1**2 dθ/ξ |_{ξ_1}':^20}") print(f"{h:6} : {params[0]:20.10g} {params[1]:20.10g}") ``` h0 : ξ_1 -ξ_1**2 dθ/ξ |_{ξ_1} 1 : 3.633871294 2.743950221 0.5 : 3.65249039 2.714155735 0.25 : 3.653696012 2.714041475 0.125 : 3.653751185 2.714057167 we see that, for this value of n, once we have a stepsize $h = 0.25$, our solution changes only in the 3rd decimal place. So we are pretty accurate then. ## Alternate approach: SciPy Instead of writing our own integrator, we can use those built into SciPy. We do need to be careful to ensure that we stop when $\theta$ reaches 0. The SciPy `solve_ivp()` integrator uses Runge-Kutta by default. Additionally, it has "events" that can be used to stop the integration when we reach the surface of the star. ```python from scipy import integrate ``` We define the righthand side function now. It is almost the same as I did above, except that since the built in solver we go past the surface of the star as it seaches for the actual surface, we need to protect against taking a negative number to a fractional power. I do this here by adding an `abs()` in the `zdot` term. ```python def le_rhs(xi, yvec, n): y, z = yvec ydot = z if xi == 0.0: zdot = (2.0/3.0) - y**n else: zdot = -2.0*z/xi - abs(y)**n return [ydot, zdot] ``` Next we define an event that the integrator will use to determine when to stop. Our function surface just returns our variable $y = \theta$. We add 2 attributes to it (this is a little bit of a clumsy way of doing things). The first says that when the event is met, the integration should stop. The second says that the condition we are looking for is a change in the sign of the return value. ```python def surface(xi, y, n): return y[0] surface.terminal = True surface.direction = -1 ``` Now we setup the integration. By default it will do Runge-Kutta, but it will vary the step size as needed to get a reasonable solution. We specify `dense_output=True` so we can look at the entire solution. We also need to pass an extra argument to our `le_rhs()` routine -- the polytropic index `n`, which we do using the `args` keyword argument. ```python n = 1.5 # initial conditions y0 = [1, 0] # maximum possible xi value -- we'll likely stop before this ximax = 100 sol = integrate.solve_ivp(le_rhs, [0, ximax], y0, dense_output=True, events=surface, args=(n,)) ``` Now that it is integrated, we can see the points where it actually needed the solution as `sol.t`. $\xi_1$ would be the last of these points. ```python xi1 = sol.t[-1] print(xi1) ``` 3.65782463879207 Now we fill in the solution to get the dense output. ```python xi = np.linspace(0, xi1, 100) y = sol.sol(xi) ``` We can then plot this polytrope ```python plt.plot(xi, y[0,:]) ``` ```python ```
function mv = mv_tuningChangeMap(mv); % % mv = mv_tuningChangeMap(mv); % % For multi-voxel UI, create a map in which the value for each voxel % measures the change in stimulus "tuning" (i.e., the N-dimensional % vector of response amplitudes to each of the N selected stimulus % conditions) between that voxel and its neighbors. % % Note that the determination of what a voxel's neighbors are depends on % the view: % Inplane views: the neighbors are neighboring 6-connected voxels in the % inplane data, independent of whether these neighbors % are in the gray, white matter, csf, or other; % Gray views: determined using the gray graph. % % Flat and Volume views are not yet supported. % % ras, 11/05. if ieNotDefined('mv'), mv = get(gcf, 'UserData'); end switch mv.roi.viewType case 'Inplane', nVoxels = size(mv.coords, 2); % get amplitudes for each voxel amps = mv_amps(mv); % initialize map vals vals = zeros(1, nVoxels); % create an 'offset' matrix describing where neighbors in % 6-connected data would be -- this will be useful for finding % neighbor coords in the main loop: offsets = [-1 0 0; 1 0 0; 0 -1 0; 0 1 0; 0 0 -1; 0 0 1]'; %%%%%main loop hwait = mrvWaitbar(0, 'Computing Tuning Change Map...'); for v = 1:nVoxels % find indices I of neighboring voxels pt = mv.coords(:, v); neighbors = repmat(pt, [1 6]) - offsets; [found I] = intersectCols(mv.coords, neighbors); if isempty(I) % no neighbors contained in the multi-voxel data: % set value for this point to -1: vals(v) = -1; else % get amplitudes for this voxel, neighbors A = amps(v, :); % amplitudes for this voxel B = amps(I, :); % amplitudes for neighbors % compute mean Euclidean distance between A and columns % in B: diff = [B - repmat(A, [1 size(B,2)])]; dist = sqrt(sum(diff.^2)); vals(v) = mean(dist); end mrvWaitbar(v/nVoxels, hwait); end close(hwait); % Create a map volume with the tuning values mrGlobals; loadSession; hI = initHiddenInplane(mv.params.dataType, mv.params.scans(1)); mapvol = zeros(dataSize(hI)); mapvol(roiIndices(hI, mv.coords)) = vals; % export as map hI.map = cell(1, numScans(hI)); hI.map{mv.params.scans(1)} = mapvol; hI.mapName = 'Tuning_Change_Map'; saveParameterMap(hI, [], 1); case 'Gray', nVoxels = size(mv.coords, 2); % get amplitudes for each voxel amps = mv_amps(mv); % initialize map vals vals = zeros(1, nVoxels); % create an 'offset' matrix describing where neighbors in % 6-connected data would be -- this will be useful for finding % neighbor coords in the main loop: offsets = [-1 0 0; 1 0 0; 0 -1 0; 0 1 0; 0 0 -1; 0 0 1]'; %%%%%main loop hwait = mrvWaitbar(0, 'Computing Tuning Change Map...'); for v = 1:nVoxels % find indices I of neighboring voxels pt = mv.coords(:, v); neighbors = repmat(pt, [1 6]) - offsets; [found I] = intersectCols(mv.coords, neighbors); if isempty(I) % no neighbors contained in the multi-voxel data: % set value for this point to -1: vals(v) = -1; else % get amplitudes for this voxel, neighbors A = amps(v, :); % amplitudes for this voxel B = amps(I, :); % amplitudes for neighbors % compute mean Euclidean distance between A and columns % in B: diff = [B - repmat(A, [size(B,1) 1])]; dist = sqrt(sum(diff.^2, 2)); vals(v) = mean(dist(:)); end mrvWaitbar(v/nVoxels, hwait); end close(hwait); % Create a map volume with the tuning values mrGlobals; loadSession; hG = initHiddenGray(mv.params.dataType, mv.params.scans(1)); mapvol = zeros(dataSize(hG)); mapvol(roiIndices(hG, mv.coords)) = vals; % export as map hG.map = cell(1, numScans(hG)); hG.map{mv.params.scans(1)} = mapvol; hG.mapName = 'Tuning_Change_Map'; saveParameterMap(hG, [], 1, 0); otherwise, % not yet supported error('Sorry, this view type is not yet supported.'); end return
using ReversePropagation using Symbolics using Test @testset "ReversePropagation.jl" begin include("gradient.jl") include("icp.jl") end
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the PyMVPA package for the # copyright and license terms. # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## """Searchlight implementation for arbitrary measures and spaces""" __docformat__ = "restructuredtext" if __debug__: from mvpa2.base import debug import numpy as np import tempfile, os import time from collections import defaultdict import mvpa2 from mvpa2.base import externals, warning from mvpa2.base.types import is_datasetlike from mvpa2.base.dochelpers import borrowkwargs, _repr_attrs from mvpa2.base.progress import ProgressBar if externals.exists("h5py"): # Is optionally required for passing searchlight # results via storing/reloading hdf5 files from mvpa2.base.hdf5 import h5save, h5load from mvpa2.datasets import hstack, Dataset from mvpa2.support import copy from mvpa2.featsel.base import StaticFeatureSelection from mvpa2.measures.base import Measure from mvpa2.base.state import ConditionalAttribute from mvpa2.misc.neighborhood import IndexQueryEngine, Sphere from mvpa2.mappers.base import ChainMapper from mvpa2.support.due import due, Doi from mvpa2.testing import on_osx class BaseSearchlight(Measure): """Base class for searchlights. The idea for a searchlight algorithm stems from a paper by :ref:`Kriegeskorte et al. (2006) <KGB06>`. """ roi_sizes = ConditionalAttribute( enabled=False, doc="Number of features in each ROI." ) roi_feature_ids = ConditionalAttribute( enabled=False, doc="Feature IDs for all generated ROIs." ) roi_center_ids = ConditionalAttribute( enabled=True, doc="Center ID for all generated ROIs." ) is_trained = True """Indicate that this measure is always trained.""" def __init__(self, queryengine, roi_ids=None, nproc=None, **kwargs): """ Parameters ---------- queryengine : QueryEngine Engine to use to discover the "neighborhood" of each feature. See :class:`~mvpa2.misc.neighborhood.QueryEngine`. roi_ids : None or list(int) or str List of query engine ids (e.g., feature ids, not coordinates, in case of `IndexQueryEngine`; and `node_indices` in case of `SurfaceQueryEngine`) that shall serve as ROI seeds (e.g., sphere centers). Alternatively, this can be the name of a feature attribute of the input dataset, whose non-zero values determine the feature ids (be careful to use it only with `IndexQueryEngine`). By default all query engine ids will be used. nproc : None or int How many processes to use for computation. Requires `pprocess` external module. If None -- all available cores will be used. **kwargs In addition this class supports all keyword arguments of its base-class :class:`~mvpa2.measures.base.Measure`. """ Measure.__init__(self, **kwargs) if nproc is not None and nproc > 1 and not externals.exists("pprocess"): raise RuntimeError( "The 'pprocess' module is required for " "multiprocess searchlights. Please either " "install python-pprocess, or reduce `nproc` " "to 1 (got nproc=%i) or set to default None" % nproc ) self._queryengine = queryengine if roi_ids is not None and not isinstance(roi_ids, str) and not len(roi_ids): raise ValueError("Cannot run searchlight on an empty list of roi_ids") self.__roi_ids = roi_ids self.nproc = nproc def __repr__(self, prefixes=None): """String representation of a `Measure` Includes only arguments which differ from default ones """ if prefixes is None: prefixes = [] return super(BaseSearchlight, self).__repr__( prefixes=prefixes + _repr_attrs(self, ["queryengine", "roi_ids", "nproc"]) ) @due.dcite( Doi("10.1073/pnas.0600244103"), description="Searchlight analysis approach", tags=["implementation"], ) @due.dcite( Doi("10.1038/nrn1931"), description="Application of the searchlight approach to decoding using classifiers", tags=["use"], ) def _call(self, dataset): """Perform the ROI search.""" # local binding nproc = self.nproc if nproc is None and externals.exists("pprocess"): import pprocess if on_osx: warning( "Unable to determine automatically maximal number of " "cores on Mac OS X. Using 1" ) nproc = 1 else: try: nproc = pprocess.get_number_of_cores() or 1 except AttributeError: warning( "pprocess version %s has no API to figure out maximal " "number of cores. Using 1" % externals.versions["pprocess"] ) nproc = 1 # train the queryengine self._queryengine.train(dataset) # decide whether to run on all possible center coords or just a provided # subset if isinstance(self.__roi_ids, str): roi_ids = dataset.fa[self.__roi_ids].value.nonzero()[0] elif self.__roi_ids is not None: roi_ids = self.__roi_ids # safeguard against stupidity if __debug__: qe_ids = self._queryengine.ids # known to qe if not set(qe_ids).issuperset(roi_ids): raise IndexError( "Some roi_ids are not known to the query engine %s: %s" % (self._queryengine, set(roi_ids).difference(qe_ids)) ) else: roi_ids = self._queryengine.ids # pass to subclass results = self._sl_call(dataset, roi_ids, nproc) if "mapper" in dataset.a: # since we know the space we can stick the original mapper into the # results as well if self.__roi_ids is None: results.a["mapper"] = copy.copy(dataset.a.mapper) else: # there is an additional selection step that needs to be # expressed by another mapper mapper = copy.copy(dataset.a.mapper) # NNO if the orignal mapper has no append (because it's not a # chainmapper, for example), we make our own chainmapper. # # THe original code was: # mapper.append(StaticFeatureSelection(roi_ids, # dshape=dataset.shape[1:])) feat_sel_mapper = StaticFeatureSelection( roi_ids, dshape=dataset.shape[1:] ) if "append" in dir(mapper): mapper.append(feat_sel_mapper) else: mapper = ChainMapper([dataset.a.mapper, feat_sel_mapper]) results.a["mapper"] = mapper # charge state self.ca.raw_results = results # return raw results, base-class will take care of transformations return results def _sl_call(self, dataset, roi_ids, nproc): """Classical generic searchlight implementation""" raise NotImplementedError("Must be implemented in the derived classes") queryengine = property(fget=lambda self: self._queryengine) roi_ids = property(fget=lambda self: self.__roi_ids) class Searchlight(BaseSearchlight): """The implementation of a generic searchlight measure. The idea for a searchlight algorithm stems from a paper by :ref:`Kriegeskorte et al. (2006) <KGB06>`. As a result it produces a map of measures given a `datameasure` instance of interest, which is ran at each spatial location. """ @staticmethod def _concat_results(sl=None, dataset=None, roi_ids=None, results=None): """The simplest implementation for collecting the results -- just put them into a list This this implementation simply collects them into a list and uses only sl. for assigning conditional attributes. But custom implementation might make use of more/less of them. Implemented as @staticmethod just to emphasize that in principle it is independent of the actual searchlight instance """ # collect results results = sum(results, []) if __debug__ and "SLC" in debug.active: debug("SLC", "") # just newline resshape = len(results) and np.asanyarray(results[0]).shape or "N/A" debug("SLC", " hstacking %d results of shape %s" % (len(results), resshape)) # but be careful: this call also serves as conversion from parallel maps # to regular lists! # this uses the Dataset-hstack result_ds = hstack(results) if __debug__: debug("SLC", " hstacked shape %s" % (result_ds.shape,)) # flatten in case we are preallocating, since we're returning a list # of lists instead of a list of elements f = lambda x: sum(x, []) if sl.preallocate_output else x if sl.ca.is_enabled("roi_feature_ids"): sl.ca.roi_feature_ids = f([r.a.roi_feature_ids for r in results]) if sl.ca.is_enabled("roi_sizes"): sl.ca.roi_sizes = f([r.a.roi_sizes for r in results]) if sl.ca.is_enabled("roi_center_ids"): sl.ca.roi_center_ids = f([r.a.roi_center_ids for r in results]) if "mapper" in dataset.a: # since we know the space we can stick the original mapper into the # results as well if roi_ids is None: result_ds.a["mapper"] = copy.copy(dataset.a.mapper) else: # there is an additional selection step that needs to be # expressed by another mapper mapper = copy.copy(dataset.a.mapper) # NNO if the orignal mapper has no append (because it's not a # chainmapper, for example), we make our own chainmapper. feat_sel_mapper = StaticFeatureSelection( roi_ids, dshape=dataset.shape[1:] ) if hasattr(mapper, "append"): mapper.append(feat_sel_mapper) else: mapper = ChainMapper([dataset.a.mapper, feat_sel_mapper]) result_ds.a["mapper"] = mapper # store the center ids as a feature attribute result_ds.fa["center_ids"] = roi_ids return result_ds def __init__( self, datameasure, queryengine, add_center_fa=False, results_postproc_fx=None, results_backend="native", results_fx=None, tmp_prefix="tmpsl", nblocks=None, preallocate_output=False, **kwargs ): """ Parameters ---------- datameasure : callable Any object that takes a :class:`~mvpa2.datasets.base.Dataset` and returns some measure when called. add_center_fa : bool or str If True or a string, each searchlight ROI dataset will have a boolean vector as a feature attribute that indicates the feature that is the seed (e.g. sphere center) for the respective ROI. If True, the attribute is named 'roi_seed', the provided string is used as the name otherwise. results_postproc_fx : callable Called with all the results computed in a block for possible post-processing which needs to be done in parallel instead of serial aggregation in results_fx. results_backend : ('native', 'hdf5'), optional Specifies the way results are provided back from a processing block in case of nproc > 1. 'native' is pickling/unpickling of results by pprocess, while 'hdf5' would use h5save/h5load functionality. 'hdf5' might be more time and memory efficient in some cases. results_fx : callable, optional Function to process/combine results of each searchlight block run. By default it would simply append them all into the list. It receives as keyword arguments sl, dataset, roi_ids, and results (iterable of lists). It is the one to take care of assigning roi_* ca's tmp_prefix : str, optional If specified -- serves as a prefix for temporary files storage if results_backend == 'hdf5'. Thus can specify the directory to use (trailing file path separator is not added automagically). nblocks : None or int Into how many blocks to split the computation (could be larger than nproc). If None -- nproc is used. preallocate_output : bool, optional If set, the output of each computation block will be pre-allocated. This can speed up computations if the datameasure returns a large number of samples and there are many features for which the datameasure is computed. The user should verify the correct assignment of sample attributes and feature attributes, since no hstacking is performed within each computing block. **kwargs In addition this class supports all keyword arguments of its base-class :class:`~mvpa2.measures.searchlight.BaseSearchlight`. """ BaseSearchlight.__init__(self, queryengine, **kwargs) self.datameasure = datameasure self.results_postproc_fx = results_postproc_fx self.results_backend = results_backend.lower() if self.results_backend == "hdf5": # Assure having hdf5 externals.exists("h5py", raise_=True) self.preallocate_output = preallocate_output self.results_fx = ( Searchlight._concat_results if results_fx is None else results_fx ) self.tmp_prefix = tmp_prefix self.nblocks = nblocks if isinstance(add_center_fa, str): self.__add_center_fa = add_center_fa elif add_center_fa: self.__add_center_fa = "roi_seed" else: self.__add_center_fa = False def __repr__(self, prefixes=None): if prefixes is None: prefixes = [] return super(Searchlight, self).__repr__( prefixes=prefixes + _repr_attrs(self, ["datameasure"]) + _repr_attrs(self, ["add_center_fa"], default=False) + _repr_attrs(self, ["results_postproc_fx"]) + _repr_attrs(self, ["results_backend"], default="native") + _repr_attrs(self, ["results_fx", "nblocks"]) ) def _sl_call(self, dataset, roi_ids, nproc): """Classical generic searchlight implementation""" assert self.results_backend in ("native", "hdf5") proc_block = ( self._proc_block_inplace if self.preallocate_output else self._proc_block ) # compute if nproc is not None and nproc > 1: # split all target ROIs centers into `nproc` equally sized blocks nproc_needed = min(len(roi_ids), nproc) nblocks = nproc_needed if self.nblocks is None else self.nblocks roi_blocks = np.array_split(roi_ids, nblocks) # the next block sets up the infrastructure for parallel computing # this can easily be changed into a ParallelPython loop, if we # decide to have a PP job server in PyMVPA import pprocess p_results = pprocess.Map(limit=nproc_needed) if __debug__: debug( "SLC", "Starting off %s child processes for nblocks=%i" % (nproc_needed, nblocks), ) compute = p_results.manage(pprocess.MakeParallel(proc_block)) for iblock, block in enumerate(roi_blocks): # should we maybe deepcopy the measure to have a unique and # independent one per process? seed = mvpa2.get_random_seed() compute( block, dataset, copy.copy(self.__datameasure), seed=seed, iblock=iblock, ) else: # otherwise collect the results in an 1-item list p_results = [proc_block(roi_ids, dataset, self.__datameasure)] # Finally collect and possibly process results # p_results here is either a generator from pprocess.Map or a list. # In case of a generator it allows to process results as they become # available result_ds = self.results_fx( sl=self, dataset=dataset, roi_ids=roi_ids, results=self.__handle_all_results(p_results), ) # Assure having a dataset (for paranoid ones) if not is_datasetlike(result_ds): try: result_a = np.atleast_1d(result_ds) except ValueError as e: if "setting an array element with a sequence" in str(e): # try forcing object array. Happens with # test_custom_results_fx_logic on numpy 1.4.1 on Debian # squeeze result_a = np.array(result_ds, dtype=object) else: raise result_ds = Dataset(result_a) return result_ds def _proc_block(self, block, ds, measure, seed=None, iblock="main"): """Little helper to capture the parts of the computation that can be parallelized Parameters ---------- seed RNG seed. Should be provided e.g. in child process invocations to guarantee that they all seed differently to not keep generating the same sequencies due to reusing the same copy of numpy's RNG block Critical for generating non-colliding temp filenames in case of hdf5 backend. Otherwise RNGs of different processes might collide in their temporary file names leading to problems. """ if seed is not None: mvpa2.seed(seed) if __debug__: debug("SLC", "Starting computing block for %i elements" % len(block)) start_time = time.time() results = [] store_roi_feature_ids = self.ca.is_enabled("roi_feature_ids") store_roi_sizes = self.ca.is_enabled("roi_sizes") store_roi_center_ids = self.ca.is_enabled("roi_center_ids") assure_dataset = any( [store_roi_feature_ids, store_roi_sizes, store_roi_center_ids] ) # put rois around all features in the dataset and compute the # measure within them bar = ProgressBar() for i, f in enumerate(block): res, roi = self.__process_roi(ds, f, measure, assure_dataset) results.append(res) if __debug__: msg = "ROI %i (%i/%i), %i features" % ( f + 1, i + 1, len(block), roi.nfeatures, ) debug("SLC", bar(float(i + 1) / len(block), msg), cr=True) if __debug__: # just to get to new line debug("SLC", "") if self.results_postproc_fx: if __debug__: debug( "SLC", "Post-processing %d results in proc_block using %s" % (len(results), self.results_postproc_fx), ) results = self.results_postproc_fx(results) if self.results_backend == "native": pass # nothing special elif self.results_backend == "hdf5": # store results in a temporary file and return a filename results_file = tempfile.mktemp( prefix=self.tmp_prefix, suffix="-%s.hdf5" % iblock ) if __debug__: debug("SLC", "Storing results into %s" % results_file) h5save(results_file, results) if __debug__: debug("SLC_", "Results stored") results = results_file else: raise RuntimeError("Must not reach this point") return results def __process_roi(self, ds, roi_feature_id, measure, assure_dataset): # retrieve the feature ids of all features in the ROI from the query # engine roi_specs = self._queryengine[roi_feature_id] if __debug__: debug( "SLC_", "For %r query returned roi_specs %r" % (roi_feature_id, roi_specs), ) if is_datasetlike(roi_specs): # TODO: unittest assert len(roi_specs) == 1 roi_fids = roi_specs.samples[0] else: roi_fids = roi_specs # slice the dataset roi = ds[:, roi_fids] if is_datasetlike(roi_specs): for n, v in roi_specs.fa.items(): roi.fa[n] = v if self.__add_center_fa: # add fa to indicate ROI seed if requested roi_seed = np.zeros(roi.nfeatures, dtype="bool") if roi_feature_id in roi_fids: roi_seed[roi_fids.index(roi_feature_id)] = True else: warning("Center feature attribute id %s not found" % roi_feature_id) roi.fa[self.__add_center_fa] = roi_seed # compute the datameasure and store in results res = measure(roi) if assure_dataset and not is_datasetlike(res): res = Dataset(np.atleast_1d(res)) if self.ca.is_enabled("roi_feature_ids"): # add roi feature ids to intermediate result dataset for later # aggregation res.a["roi_feature_ids"] = roi_fids if self.ca.is_enabled("roi_sizes"): res.a["roi_sizes"] = roi.nfeatures if self.ca.is_enabled("roi_center_ids"): res.a["roi_center_ids"] = roi_feature_id return res, roi def _proc_block_inplace(self, block, ds, measure, seed=None, iblock="main"): """Little helper to capture the parts of the computation that can be parallelized. This method preallocates the output of the block, reducing the number of elementes to be hstacked down the processing line. Parameters ---------- seed RNG seed. Should be provided e.g. in child process invocations to guarantee that they all seed differently to not keep generating the same sequencies due to reusing the same copy of numpy's RNG block Critical for generating non-colliding temp filenames in case of hdf5 backend. Otherwise RNGs of different processes might collide in their temporary file names leading to problems. """ if seed is not None: mvpa2.seed(seed) if __debug__: debug("SLC", "Starting computing block for %i elements" % len(block)) store_roi_feature_ids = self.ca.is_enabled("roi_feature_ids") store_roi_sizes = self.ca.is_enabled("roi_sizes") store_roi_center_ids = self.ca.is_enabled("roi_center_ids") assure_dataset = any( [store_roi_feature_ids, store_roi_sizes, store_roi_center_ids] ) # compute first result in block to get estimate of output if __debug__: debug("SLC", "Computing measure for first ROI to preallocate " "output") first_res, roi = self.__process_roi(ds, block[0], measure, assure_dataset) nsamples, nfeatures = first_res.shape results = np.empty( (nsamples, nfeatures * len(block)), dtype=first_res.samples.dtype ) if __debug__: debug("SLC", "Preallocated ouput of shape %s" % str(results.shape)) results[:, :nfeatures] = first_res.samples start = nfeatures step = nfeatures # put rois around all features in the dataset and compute the # measure within them bar = ProgressBar() # initialize dictionaries to store fa and a fa = defaultdict(list) for first_res_fa in first_res.fa: val = first_res.fa[first_res_fa].value if isinstance(val, list): adder = fa[first_res_fa].extend else: adder = fa[first_res_fa].append adder(val) a = defaultdict(list) for first_res_a in first_res.a: val = first_res.a[first_res_a].value if first_res_a != "roi_feature_ids" and isinstance(val, list): adder = a[first_res_a].extend else: adder = a[first_res_a].append adder(val) for i, f in enumerate(block[1:]): res, roi = self.__process_roi(ds, f, measure, assure_dataset) if store_roi_feature_ids: # add roi feature ids to intermediate result dataset for later # aggregation a["roi_feature_ids"].append(res.a.roi_feature_ids) if store_roi_sizes: a["roi_sizes"].append(roi.nfeatures) if store_roi_center_ids: a["roi_center_ids"].append(f) # store results inplace end = start + step results[:, start:end] = res.samples start = end if __debug__: msg = "ROI %i (%i/%i), %i features" % ( f + 1, i + 1, len(block), roi.nfeatures, ) debug("SLC", bar(float(i + 1) / len(block), msg), cr=True) if __debug__: # just to get to new line debug("SLC", "") # now make it a dataset and a list to make it compatible with the rest results = [Dataset(results, sa=first_res.sa, a=dict(a), fa=dict(fa))] if self.results_postproc_fx: if __debug__: debug( "SLC", "Post-processing %d results in proc_block using %s" % (len(results), self.results_postproc_fx), ) results = self.results_postproc_fx(results) if self.results_backend == "native": pass # nothing special elif self.results_backend == "hdf5": # store results in a temporary file and return a filename results_file = tempfile.mktemp( prefix=self.tmp_prefix, suffix="-%s.hdf5" % iblock ) if __debug__: debug("SLC", "Storing results into %s" % results_file) h5save(results_file, results) if __debug__: debug("SLC_", "Results stored") results = results_file else: raise RuntimeError("Must not reach this point") return results def __set_datameasure(self, datameasure): """Set the datameasure""" self.untrain() self.__datameasure = datameasure def __handle_results(self, results): if self.results_backend == "hdf5": # 'results' must be just a filename assert isinstance(results, str) if __debug__: debug("SLC", "Loading results from %s" % results) results_data = h5load(results) os.unlink(results) if __debug__: debug("SLC_", "Loaded results of len=%d from" % len(results_data)) return results_data else: return results def __handle_all_results(self, results): """Helper generator to decorate passing the results out to results_fx """ for r in results: yield self.__handle_results(r) datameasure = property(fget=lambda self: self.__datameasure, fset=__set_datameasure) add_center_fa = property(fget=lambda self: self.__add_center_fa) @borrowkwargs(Searchlight, "__init__", exclude=["roi_ids", "queryengine"]) def sphere_searchlight( datameasure, radius=1, center_ids=None, space="voxel_indices", **kwargs ): """Creates a `Searchlight` to run a scalar `Measure` on all possible spheres of a certain size within a dataset. The idea for a searchlight algorithm stems from a paper by :ref:`Kriegeskorte et al. (2006) <KGB06>`. Parameters ---------- datameasure : callable Any object that takes a :class:`~mvpa2.datasets.base.Dataset` and returns some measure when called. radius : int All features within this radius around the center will be part of a sphere. Radius is in grid-indices, i.e. ``1`` corresponds to all immediate neighbors, regardless of the physical distance. center_ids : list of int List of feature ids (not coordinates) the shall serve as sphere centers. Alternatively, this can be the name of a feature attribute of the input dataset, whose non-zero values determine the feature ids. By default all features will be used (it is passed as ``roi_ids`` argument of Searchlight). space : str Name of a feature attribute of the input dataset that defines the spatial coordinates of all features. **kwargs In addition this class supports all keyword arguments of its base-class :class:`~mvpa2.measures.base.Measure`. Notes ----- If `Searchlight` is used as `SensitivityAnalyzer` one has to make sure that the specified scalar `Measure` returns large (absolute) values for high sensitivities and small (absolute) values for low sensitivities. Especially when using error functions usually low values imply high performance and therefore high sensitivity. This would in turn result in sensitivity maps that have low (absolute) values indicating high sensitivities and this conflicts with the intended behavior of a `SensitivityAnalyzer`. """ # build a matching query engine from the arguments kwa = {space: Sphere(radius)} qe = IndexQueryEngine(**kwa) # init the searchlight with the queryengine return Searchlight(datameasure, queryengine=qe, roi_ids=center_ids, **kwargs) # class OptimalSearchlight( object ): # def __init__( self, # searchlight, # test_radii, # verbose=False, # **kwargs ): # """ # """ # # results will end up here # self.__perfmeans = [] # self.__perfvars = [] # self.__chisquares = [] # self.__chanceprobs = [] # self.__spheresizes = [] # # # run searchligh for all radii in the list # for radius in test_radii: # if verbose: # print 'Using searchlight with radius:', radius # # compute the results # searchlight( radius, **(kwargs) ) # # self.__perfmeans.append( searchlight.perfmean ) # self.__perfvars.append( searchlight.perfvar ) # self.__chisquares.append( searchlight.chisquare ) # self.__chanceprobs.append( searchlight.chanceprob ) # self.__spheresizes.append( searchlight.spheresize ) # # # # now determine the best classification accuracy # best = np.array(self.__perfmeans).argmax( axis=0 ) # # # select the corresponding values of the best classification # # in all data tables # self.perfmean = best.choose(*(self.__perfmeans)) # self.perfvar = best.choose(*(self.__perfvars)) # self.chisquare = best.choose(*(self.__chisquares)) # self.chanceprob = best.choose(*(self.__chanceprobs)) # self.spheresize = best.choose(*(self.__spheresizes)) # # # store the best performing radius # self.bestradius = np.zeros( self.perfmean.shape, dtype='uint' ) # self.bestradius[searchlight.mask==True] = \ # best.choose( test_radii )[searchlight.mask==True] # # # # def makeSphericalROIMask( mask, radius, elementsize=None ): # """ # """ # # use default elementsize if none is supplied # if not elementsize: # elementsize = [ 1 for i in range( len(mask.shape) ) ] # else: # if len( elementsize ) != len( mask.shape ): # raise ValueError, 'elementsize does not match mask dimensions.' # # # rois will be drawn into this mask # roi_mask = np.zeros( mask.shape, dtype='int32' ) # # # while increase with every ROI # roi_id_counter = 1 # # # build spheres around every non-zero value in the mask # for center, spheremask in \ # algorithms.SpheresInMask( mask, # radius, # elementsize, # forcesphere = True ): # # # set all elements that match the current spheremask to the # # current ROI index value # roi_mask[spheremask] = roi_id_counter # # # increase ROI counter # roi_id_counter += 1 # # return roi_mask
# Physics 420/580 Midterm Exam ## October 19, 2017 1pm-2pm Do the following problems. Use the Jupyter notebook, inserting your code and any textual answers/explanations in cells between the questions. (Feel free to add additional cells!) Marks will be given based on how clearly you demonstrate your understanding. There are no restrictions on downloading from the internet, eclass, or the use of books, notes, or any other widely available computing resources. However, **you are not allowed** to communicate with each other or collaborate in any way and uploading to the internet or sending or receiving direct communications is not appropriate. When you are finished, upload the jupyter notebook to eclass. Eclass times out after 2:05 so make sure that you upload things before then. Also be careful to save the notebook periodically and that you upload your final exam file. ```python import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl mpl.rc('figure',dpi=250) mpl.rc('text',usetex=True) import scipy from scipy.integrate import odeint from scipy.integrate import quad from scipy.optimize import minimize ``` ```python def add_labels(xlabel, ylabel, title): plt.xlabel(xlabel) plt.ylabel(ylabel) plt.title(title) plt.legend() ``` ## Graphics Plot the two curves: $$\begin{align} y&=4x^3-3x-2\\ x&=\sin(\frac{y^4}{4}-2y^2+2) \end{align} $$ How many intersections are there? Read the x,y value corresponding to the intersections from the plots. ```python xdata = np.linspace(-2, 2) y1 = lambda x: 4*x**3 - 3*x - 2 xdata = np.linspace(-2, 2, 1000) plt.plot(xdata, y1(xdata)) x1 = lambda y: np.sin(y**4/4 - 2*y**2 + 2) ydata = np.linspace(-10, 10,1000) plt.plot(x1(ydata), ydata) curve1_x = xdata curve1_y = y1(xdata) curve2_x = x1(ydata) curve2_y = ydata tol = 1e-2 for x1, y1, in zip(curve1_x, curve1_y): for x2, y2, in zip(curve2_x, curve2_y): if np.abs(x1 - x2) < tol and np.abs(y1 - y2) < tol: print(x1, x2, y1, y2) ``` ```python ``` # Reconstruction A instantaneous flash of light occurs in a large tank of water at time $t_0$ and at position $\vec{x_0}$ The group velocity of light in water is about $2.2 \times 10^8$ m/s. Four sensors detect the light flash, and report a measurement of the time at which light strikes the sensor. The locations of the sensors and the time which each sensor was hit is recorded in the table below: |Sensor #| x| y| z| Time| |--------|------------|------------|------------|------------| | |[m]| [m]| [m]| [s]| |1 |0 |0| 10 | 6.3859E-08| |2 |8.66025404| 0| -5| 1.1032E-07| |3 |-4.33012702| 7.5| -5| 7.9394E-08| |4 |-4.33012702| -7.5| -5| 1.0759E-07| Calculate the initial time $t_0$ and the location of the flash. Here is a sketch of the general geometry. Note that the gray region is not different from the rest of the water- it is just to show the tetrahedral arrangement of the light sensors. The flash, shown as the yellow star is in an arbitrary location which you want to find. ```python sen1 = np.array([0, 0, 10, 6.3859E-08]) sen2 = np.array([8.66025404, 0, -5, 1.1032E-07]) sen3 = np.array([4.33012702, 7.5, -5, 7.9394E-08]) sen4 = np.array([-4.33012702, -7.5, -5, 1.0759E-07]) def cost(pos): error = 0 for sen in [sen1, sen2, sen3, sen4]: error += (np.linalg.norm(pos - sen[0:3]) - sen[3])**2 return error sol = minimize(cost, np.random.randn(3)) print('solution is ', sol.x) ``` solution is [ 2.16506317e+00 -8.15860127e-08 -1.24999934e+00] ```python ``` ```python ''' Alternative solution ''' class Sensor(): def __init__(self, position, time): self.position = position self.time = time self.velocity = 2.2*10**8 def draw_radius(self): r = self.velocity*self.time possible_vals = [] for phi in np.linspace(0, 2*np.pi): for theta in np.linspace(0, np.pi): x = np.array([np.sin(theta)*np.cos(phi), np.sin(theta)*np.sin(phi), np.cos(theta)]) possible_vals.append(self.position + r*x) return np.array(possible_vals) ``` ```python sen1 = Sensor(np.array([0, 0, 10]), 6.3859E-08) sen2 = Sensor(np.array([8.66025404, 0, -5]), 1.1032E-07) sen3 = Sensor(np.array([4.33012702, 7.5, -5]), 7.9394E-08) sen4 = Sensor(np.array([-4.33012702, -7.5, -5]), 1.0759E-07) circ = [] for i in [sen1, sen2, sen3, sen4]: circ.append(i.draw_radius()) ``` ```python tol = 18 mask = np.abs(circ[0]-circ[1]-circ[2]-circ[3]) < tol for i, j in enumerate(mask): if j.all() == True: print(i, j) print(circ[0][i]) ``` 1010 [ True True True] [-7.04232267 4.58404406 21.25904395] 1460 [ True True True] [-7.04232267 -4.58404406 21.25904395] ## Trajectories An alpha-particle is a helium nucleus, with mass 6.644×10−27 kg or 4.002 u, and charge equal to twice the charge of an electron (but positive). Calculate the trajectory of a 5MeV=(5*1.609 e-13 J) alpha particle as it moves by a gold nucleus (mass 196.966 u), with charge 79e, as a function of the impact parameter b, below. Assume both the alpha and the gold are point particles, and ignore special relativity. Plot the scattering angle $\theta$ and energy loss of the alpha as a function of $b$, for values of b between 1e-16 and 1e-9m. The force between two charge particles is given by the Coulomb potential: $$\vec{F}=\frac{1}{4\pi\epsilon_0}\frac{q_1q_2 (\vec{r_2}-\vec{r_1})}{|\vec{r_2}-\vec{r_1}|^3}$$ with $\epsilon_0=8.85\times10^{-12}\frac{\rm{C}^2}{\rm{N\cdot m^2}}$ ```python eps = 8.85*10**-12 elementary_charge = 1.60*10**-19 q1 = 2*elementary_charge q2 = 79*elementary_charge u = 1.66*10**-27 m1 = 4*u m2 = 196.966*u def CouloubsLaw(r1, r2, q1, q2): distance = np.linalg.norm(r2-r1) direction = (r2-r1)/distance F = (1/(4*np.pi*eps))*(q2/distance**2)*direction return F ``` ```python kinetic = 5*1.609e-13 velocity = np.sqrt(2*kinetic/m1) velocity ``` 15566607.758546297 ```python import numpy as np from scipy.integrate import odeint def main(y, t, m1 = m1, m2 = m2): ''' Main function to be integrated with odeint. Input: y (array of elements 12), t (scalar) Output: dydt (array of elements 12) ''' particle1_x = y[0:2] particle1_dx = y[2:4] particle2_x = np.array([0, velocity]) F = CouloubsLaw(particle1_x, particle2_x, q1, q2) dxdt = np.zeros(4) dxdt[0:2] = particle1_dx dxdt[2:4] = F/m1 #print(y[0:2]) return dxdt b = 1e-16 y0 = np.array([0, b, velocity, 0]) t = np.linspace(0, 3, num=500) y = odeint(main, y0, t) ``` ```python y plt.plot(y[:,0], y[:,1]) ``` ```python energy = 1/2*m1*y[:, 2]**2 + 1/2*m1*y[:, 3]**2 plt.plot(t, energy) ``` ```python for b in np.linspace(1e-16, 1e-9, num=10): y0 = np.array([0, b, velocity, 0]) t = np.linspace(0, 3, num=500) y = odeint(main, y0, t) plt.plot(y[:,0], y[:,1], label=b) add_labels('x', 'y', 'Scattering for various b') ``` ```python ``` ```python ``` ```python ``` # Don't forget to upload your work to eclass!
theory Independent_DYNAMIC_Post_Network imports "Independent_DYNAMIC_Post_ISSUER" "Independent_Post_RECEIVER" "../../API_Network" "BD_Security_Compositional.Composing_Security_Network" begin subsubsection \<open>Confidentiality for the N-ary composition\<close> type_synonym ttrans = "(state, act, out) trans" type_synonym obs = Post_Observation_Setup_ISSUER.obs type_synonym "value" = "Post.value + Post_RECEIVER.value" lemma value_cases: fixes v :: "value" obtains (PVal) pst where "v = Inl (Post.PVal pst)" | (PValS) aid pst where "v = Inl (Post.PValS aid pst)" | (OVal) ov where "v = Inl (Post.OVal ov)" | (PValR) pst where "v = Inr (Post_RECEIVER.PValR pst)" proof (cases v) case (Inl vl) then show thesis using PVal PValS OVal by (cases vl rule: Post.value.exhaust) auto next case (Inr vr) then show thesis using PValR by (cases vr rule: Post_RECEIVER.value.exhaust) auto qed locale Post_Network = Network + fixes UIDs :: "apiID \<Rightarrow> userID set" and AID :: "apiID" and PID :: "postID" assumes AID_in_AIDs: "AID \<in> AIDs" begin sublocale Iss: Post "UIDs AID" PID . abbreviation \<phi> :: "apiID \<Rightarrow> (state, act, out) trans \<Rightarrow> bool" where "\<phi> aid trn \<equiv> (if aid = AID then Iss.\<phi> trn else Post_RECEIVER.\<phi> PID AID trn)" abbreviation f :: "apiID \<Rightarrow> (state, act, out) trans \<Rightarrow> value" where "f aid trn \<equiv> (if aid = AID then Inl (Iss.f trn) else Inr (Post_RECEIVER.f PID AID trn))" abbreviation \<gamma> :: "apiID \<Rightarrow> (state, act, out) trans \<Rightarrow> bool" where "\<gamma> aid trn \<equiv> (if aid = AID then Iss.\<gamma> trn else Strong_ObservationSetup_RECEIVER.\<gamma> (UIDs aid) trn)" abbreviation g :: "apiID \<Rightarrow> (state, act, out) trans \<Rightarrow> obs" where "g aid trn \<equiv> (if aid = AID then Iss.g trn else Strong_ObservationSetup_RECEIVER.g PID AID trn)" abbreviation T :: "apiID \<Rightarrow> (state, act, out) trans \<Rightarrow> bool" where "T aid trn \<equiv> (if aid = AID then Iss.T trn else Post_RECEIVER.T (UIDs aid) PID AID trn)" abbreviation B :: "apiID \<Rightarrow> value list \<Rightarrow> value list \<Rightarrow> bool" where "B aid vl vl1 \<equiv> (if aid = AID then list_all isl vl \<and> list_all isl vl1 \<and> Iss.B (map projl vl) (map projl vl1) else list_all (Not o isl) vl \<and> list_all (Not o isl) vl1 \<and> Post_RECEIVER.B (map projr vl) (map projr vl1))" fun comOfV :: "apiID \<Rightarrow> value \<Rightarrow> com" where "comOfV aid (Inl (Post.PValS aid' pst)) = (if aid' \<noteq> aid then Send else Internal)" | "comOfV aid (Inl (Post.PVal pst)) = Internal" | "comOfV aid (Inl (Post.OVal ov)) = Internal" | "comOfV aid (Inr v) = Recv" fun tgtNodeOfV :: "apiID \<Rightarrow> value \<Rightarrow> apiID" where "tgtNodeOfV aid (Inl (Post.PValS aid' pst)) = aid'" | "tgtNodeOfV aid (Inl (Post.PVal pst)) = undefined" | "tgtNodeOfV aid (Inl (Post.OVal ov)) = undefined" | "tgtNodeOfV aid (Inr v) = AID" definition syncV :: "apiID \<Rightarrow> value \<Rightarrow> apiID \<Rightarrow> value \<Rightarrow> bool" where "syncV aid1 v1 aid2 v2 = (\<exists>pst. aid1 = AID \<and> v1 = Inl (Post.PValS aid2 pst) \<and> v2 = Inr (Post_RECEIVER.PValR pst))" lemma syncVI: "syncV AID (Inl (Post.PValS aid' pst)) aid' (Inr (Post_RECEIVER.PValR pst))" unfolding syncV_def by auto lemma syncVE: assumes "syncV aid1 v1 aid2 v2" obtains pst where "aid1 = AID" "v1 = Inl (Post.PValS aid2 pst)" "v2 = Inr (Post_RECEIVER.PValR pst)" using assms unfolding syncV_def by auto fun getTgtV where "getTgtV (Inl (Post.PValS aid pst)) = Inr (Post_RECEIVER.PValR pst)" | "getTgtV v = v" lemma comOfV_AID: "comOfV AID v = Send \<longleftrightarrow> isl v \<and> Iss.isPValS (projl v) \<and> Iss.tgtAPI (projl v) \<noteq> AID" "comOfV AID v = Recv \<longleftrightarrow> Not (isl v)" by (cases v rule: value_cases; auto)+ lemmas \<phi>_defs = Post_RECEIVER.\<phi>_def2 Iss.\<phi>_def3 sublocale Net: BD_Security_TS_Network_getTgtV where istate = "\<lambda>_. istate" and validTrans = validTrans and srcOf = "\<lambda>_. srcOf" and tgtOf = "\<lambda>_. tgtOf" and nodes = AIDs and comOf = comOf and tgtNodeOf = tgtNodeOf and sync = sync and \<phi> = \<phi> and f = f and \<gamma> = \<gamma> and g = g and T = T and B = B and comOfV = comOfV and tgtNodeOfV = tgtNodeOfV and syncV = syncV and comOfO = comOfO and tgtNodeOfO = tgtNodeOfO and syncO = syncO (*and cmpO = cmpO*) and source = AID and getTgtV = getTgtV using AID_in_AIDs proof (unfold_locales, goal_cases) case (1 nid trn) then show ?case using Iss.validTrans_isCOMact_open[of trn] by (cases trn rule: Iss.\<phi>.cases) (auto simp: \<phi>_defs split: prod.splits) next case (2 nid trn) then show ?case using Iss.validTrans_isCOMact_open[of trn] by (cases trn rule: Iss.\<phi>.cases) (auto simp: \<phi>_defs split: prod.splits) next case (3 nid trn) interpret Sink: Post_RECEIVER "UIDs nid" PID AID . show ?case using 3 by (cases "(nid,trn)" rule: tgtNodeOf.cases) (auto split: prod.splits) next case (4 nid trn) interpret Sink: Post_RECEIVER "UIDs nid" PID AID . show ?case using 4 by (cases "(nid,trn)" rule: tgtNodeOf.cases) (auto split: prod.splits) next case (5 nid1 trn1 nid2 trn2) interpret Sink1: Post_RECEIVER "UIDs nid1" PID AID . interpret Sink2: Post_RECEIVER "UIDs nid2" PID AID . show ?case using 5 by (elim sync_cases) (auto intro: syncVI) next case (6 nid1 trn1 nid2 trn2) interpret Sink1: Post_RECEIVER "UIDs nid1" PID AID . interpret Sink2: Post_RECEIVER "UIDs nid2" PID AID . show ?case using 6 by (elim sync_cases) auto next case (7 nid1 trn1 nid2 trn2) interpret Sink1: Post_RECEIVER "UIDs nid1" PID AID . interpret Sink2: Post_RECEIVER "UIDs nid2" PID AID . show ?case using 7(2,4,6-10) using Iss.validTrans_isCOMact_open[OF 7(2)] Iss.validTrans_isCOMact_open[OF 7(4)] by (elim sync_cases) (auto split: prod.splits, auto simp: sendPost_def) next case (8 nid1 trn1 nid2 trn2) interpret Sink1: Post_RECEIVER "UIDs nid1" PID AID . interpret Sink2: Post_RECEIVER "UIDs nid2" PID AID . show ?case using 8(2,4,6-10,11,12,13) apply (elim syncO_cases; cases trn1; cases trn2) apply (auto simp: Iss.g_simps Strong_ObservationSetup_RECEIVER.g_simps split: prod.splits) apply (auto simp: sendPost_def split: prod.splits elim: syncVE)[] done next case (9 nid trn) then show ?case by (cases "(nid,trn)" rule: tgtNodeOf.cases) (auto simp: Strong_ObservationSetup_RECEIVER.\<gamma>.simps) next case (10 nid trn) then show ?case by (cases trn) (auto simp: \<phi>_defs) next case (11 vSrc nid vn) then show ?case by (cases vSrc rule: value_cases) (auto simp: syncV_def) next case (12 vSrc nid vn) then show ?case by (cases vSrc rule: value_cases) (auto simp: syncV_def) qed lemma list_all_Not_isl_projectSrcV: "list_all (Not o isl) (Net.projectSrcV aid vlSrc)" proof (induction vlSrc) case (Cons vSrc vlSrc') then show ?case by (cases vSrc rule: value_cases) auto qed auto context fixes AID' :: apiID assumes AID': "AID' \<in> AIDs - {AID}" begin interpretation Recv: Post_RECEIVER "UIDs AID'" PID AID by unfold_locales lemma Iss_BC_BO_tgtAPI: shows "(Iss.BC vl vl1 \<longrightarrow> map Iss.tgtAPI (filter Iss.isPValS vl) = map Iss.tgtAPI (filter Iss.isPValS vl1)) \<and> (Iss.BO vl vl1 \<longrightarrow> map Iss.tgtAPI (filter Iss.isPValS vl) = map Iss.tgtAPI (filter Iss.isPValS vl1))" by (induction rule: Iss.BC_BO.induct) auto lemma Iss_B_Recv_B_aux: assumes "list_all isl vl" and "list_all isl vl1" and "map Iss.tgtAPI (filter Iss.isPValS (map projl vl)) = map Iss.tgtAPI (filter Iss.isPValS (map projl vl1))" shows "length (map projr (Net.projectSrcV AID' vl)) = length (map projr (Net.projectSrcV AID' vl1))" using assms proof (induction vl vl1 rule: list22_induct) case (ConsCons v vl v1 vl1) consider (SendSend) aid pst pst1 where "v = Inl (Iss.PValS aid pst)" "v1 = Inl (Iss.PValS aid pst1)" | (Internal) "comOfV AID v = Internal" "\<not>Iss.isPValS (projl v)" | (Internal1) "comOfV AID v1 = Internal" "\<not>Iss.isPValS (projl v1)" using ConsCons(4-6) by (cases v rule: value_cases; cases v1 rule: value_cases) auto then show ?case proof cases case (SendSend) then show ?thesis using ConsCons.IH(1) ConsCons.prems by auto next case (Internal) then show ?thesis using ConsCons.IH(2)[of "v1 # vl1"] ConsCons.prems by auto next case (Internal1) then show ?thesis using ConsCons.IH(3)[of "v # vl"] ConsCons.prems by auto qed qed (auto simp: comOfV_AID) lemma Iss_B_Recv_B: assumes "B AID vl vl1" shows "Recv.B (map projr (Net.projectSrcV AID' vl)) (map projr (Net.projectSrcV AID' vl1))" using assms Iss_B_Recv_B_aux Iss_BC_BO_tgtAPI by (auto simp: Iss.B_def Recv.B_def) end lemma map_projl_Inl: "map (projl o Inl) vl = vl" by (induction vl) auto lemma these_map_Inl_projl: "list_all isl vl \<Longrightarrow> these (map (Some o Inl o projl) vl) = vl" by (induction vl) auto lemma map_projr_Inr: "map (projr o Inr) vl = vl" by (induction vl) auto lemma these_map_Inr_projr: "list_all (Not o isl) vl \<Longrightarrow> these (map (Some o Inr o projr) vl) = vl" by (induction vl) auto sublocale BD_Security_TS_Network_Preserve_Source_Security_getTgtV where istate = "\<lambda>_. istate" and validTrans = validTrans and srcOf = "\<lambda>_. srcOf" and tgtOf = "\<lambda>_. tgtOf" and nodes = AIDs and comOf = comOf and tgtNodeOf = tgtNodeOf and sync = sync and \<phi> = \<phi> and f = f and \<gamma> = \<gamma> and g = g and T = T and B = B and comOfV = comOfV and tgtNodeOfV = tgtNodeOfV and syncV = syncV and comOfO = comOfO and tgtNodeOfO = tgtNodeOfO and syncO = syncO (*and cmpO = cmpO*) and source = AID and getTgtV = getTgtV proof (unfold_locales, goal_cases) case 1 show ?case using AID_in_AIDs . next case 2 interpret Iss': BD_Security_TS_Trans istate System_Specification.validTrans srcOf tgtOf Iss.\<phi> Iss.f Iss.\<gamma> Iss.g Iss.T Iss.B istate System_Specification.validTrans srcOf tgtOf Iss.\<phi> "\<lambda>trn. Inl (Iss.f trn)" Iss.\<gamma> Iss.g Iss.T "B AID" id id Some "Some o Inl" proof (unfold_locales, goal_cases) case (11 vl' vl1' tr) then show ?case by (intro exI[of _ "map projl vl1'"]) (auto simp: map_projl_Inl these_map_Inl_projl) qed auto show ?case using Iss.secure Iss'.translate_secure by auto next case (3 aid tr vl' vl1) then show ?case using Iss_B_Recv_B[of aid "(Net.lV AID tr)" vl1] list_all_Not_isl_projectSrcV by auto qed theorem secure: "secure" proof (intro preserve_source_secure ballI) fix aid assume aid: "aid \<in> AIDs - {AID}" interpret Node: Post_RECEIVER "UIDs aid" PID AID . interpret Node': BD_Security_TS_Trans istate System_Specification.validTrans srcOf tgtOf Node.\<phi> Node.f Node.\<gamma> Node.g Node.T Node.B istate System_Specification.validTrans srcOf tgtOf Node.\<phi> "\<lambda>trn. Inr (Node.f trn)" Node.\<gamma> Node.g Node.T "B aid" id id Some "Some o Inr" proof (unfold_locales, goal_cases) case (11 vl' vl1' tr) then show ?case using aid by (intro exI[of _ "map projr vl1'"]) (auto simp: map_projr_Inr these_map_Inr_projr) qed auto show "Net.lsecure aid" using aid Node.Post_secure Node'.translate_secure by auto qed end (* context Post_Network *) end
clear all; clc; close all; OpenBMI('C:\Users\CVPR\Desktop\Open_Github') % Edit the variable BMI if necessary global BMI; BMI.EEG_DIR=['G:\data2']; %% DATA LOAD MODULE file=fullfile(BMI.EEG_DIR, '\2016_08_05_hkkim_training'); marker= {'1','right';'2','left';'3','foot';'4','rest'}; [EEG.data, EEG.marker, EEG.info]=Load_EEG(file,{'device','brainVision';'marker', marker;'fs', 500}); field={'x','t','fs','y_dec','y_logic','y_class','class', 'chan'}; CNT=opt_eegStruct({EEG.data, EEG.marker, EEG.info}, field); CNT=prep_selectClass(CNT,{'class',{'right', 'rest'}}); CNT2 = prep_laplacian(CNT, {'Channel', {'C3', 'Cz', 'C4'}}) %% CROSS-VALIDATION MODULE CV.var.band=[7 20]; CV.var.interval=[750 3500]; CV.prep={ % commoly applied to training and test data before data split 'CNT=prep_filter(CNT, {"frequency", band})' 'SMT=prep_segmentation(CNT, {"interval", interval})' }; CV.train={ '[SMT, CSP_W, CSP_D]=func_csp(SMT,{"nPatterns", [3]})' 'FT=func_featureExtraction(SMT, {"feature","logvar"})' '[CF_PARAM]=func_train(FT,{"classifier","LDA"})' }; CV.test={ 'SMT=func_projection(SMT, CSP_W)' 'FT=func_featureExtraction(SMT, {"feature","logvar"})' '[cf_out]=func_predict(FT, CF_PARAM)' }; CV.option={ 'KFold','7' % 'leaveout' }; [loss]=eval_crossValidation(CNT, CV); % input : eeg, or eeg_epo
function ground_truth = load_groundtruth(base_path, video) %see if there's a suffix, specifying one of multiple targets, for %example the dot and number in 'Jogging.1' or 'Jogging.2'. if numel(video) >= 2 && video(end-1) == '.' && ~isnan(str2double(video(end))), suffix = video(end-1:end); %remember the suffix video = video(1:end-2); %remove it from the video name else suffix = ''; end %full path to the video's files if base_path(end) ~= '/' && base_path(end) ~= '\', base_path(end+1) = '/'; end video_path = [base_path video '/']; %try to load ground truth from text file (Benchmark's format) filename = [video_path 'groundtruth_rect' suffix '.txt']; f = fopen(filename); assert(f ~= -1, ['No initial position or ground truth to load ("' filename '").']) %the format is [x, y, width, height] try ground_truth = textscan(f, '%f,%f,%f,%f', 'ReturnOnError',false); catch %#ok, try different format (no commas) frewind(f); ground_truth = textscan(f, '%f %f %f %f'); end ground_truth = cat(2, ground_truth{:}); fclose(f); end
Akiko Wakabayashi as Aki : An agent with the Japanese SIS who assists Bond .
lemma deformation_retraction_imp_homotopy_equivalent_space: "\<lbrakk>homotopic_with (\<lambda>x. True) X X (s \<circ> r) id; retraction_maps X Y r s\<rbrakk> \<Longrightarrow> X homotopy_equivalent_space Y"
SUBROUTINE RU_HGHT ( field, above, drop, p, z, iret ) C************************************************************************ C* RU_HGHT * C* * C* This subroutine decodes a pressure/height field in the form PPhhh. * C* For data below 100 mb, PP is the pressure in tens of millibars and * C* hhh is the last three digits of the height in meters below 500 mb * C* and the last three digits of height in decameters at/above 500 mb. * C* For data above 100 mb, PP is the pressure in millibars and hhh is * C* the last three digits of the height in decameters. * C* * C* RU_HGHT ( FIELD, ABOVE, DROP, P, Z, IRET ) * C* * C* Input parameters: * C* FIELD CHAR* Encoded field * C* ABOVE LOGICAL Above 100 mb flag * C* DROP LOGICAL Dropsonde flag * C* * C* Output parameters: * C* P REAL Pressure * C* Z REAL Height * C* IRET INTEGER Return code * C* 0 = return code * C** * C* Log: * C* M. desJardins/GSFC 6/86 * C* K. Brill/NMC 01/92 Added the new 925 mb mandatory level * C* D. Blanchard/NSSL 3/93 Fixed heights above 100mb and below * C* sea level * C* D. Kidwell 2/05 CSC for drop, added 925mb check * C************************************************************************ INCLUDE 'GEMPRM.PRM' C LOGICAL above, drop CHARACTER*(*) field C------------------------------------------------------------------------ iret = 0 p = RMISSD z = RMISSD C C* Decode the pressure which is in the first two characters. C CALL ST_INTG ( field (1:2), ipres, ier ) IF ( ier .eq. 0 ) THEN C C* Encoded pressure was pressure / 10. 00 is 1000. C* Above 100mb, encoded pressure is whole number. C IF ( .not. above ) THEN ipres = ipres * 10 IF ( ipres .eq. 0 ) ipres = 1000 END IF C C* Take care of the 925 mb level, which comes in as 920. C IF ( ipres .eq. 920 ) ipres = 925 p = ipres C C* Get the height which is in the last three characters. C CALL ST_INTG ( field (3:5), iz, ier ) C C* For data below 100 mb, use the pressure to decode the C* height. This algorithm is from the U. of Wisconsin and C* differs slightly from the PROFS algorithm. C IF ( ( ier .eq. 0 ) .and. ( .not. above ) ) THEN z = iz IF ( (ipres .eq. 1000) .and. (iz .gt. 500) ) THEN z = 500. - z ELSE IF ( (ipres .eq. 925) .and. (iz .lt. 200) .and. + .not. drop ) THEN z = z + 1000. ELSE IF ( (ipres .eq. 850) .and. (iz .lt. 900) ) THEN z = z + 1000. ELSE IF ( (ipres .eq. 700) .and. (iz .lt. 500) ) THEN z = z + 3000. ELSE IF (ipres .eq. 700) THEN z = z + 2000. ELSE IF (ipres .le. 500) THEN iz = iz * 10 z = z * 10. IF ( (ipres .eq. 300) .and. (iz .lt. 3000) ) THEN z = z + 10000. ELSE IF ((ipres .eq. 250) .and. (iz .lt. 5000)) + THEN z = z + 10000. ELSE IF ((ipres .eq. 200) .and. (iz .lt. 7000)) + THEN z = z + 10000. ELSE IF (ipres .le. 150) THEN z = z + 10000. END IF END IF END IF C C* Compute the height above 100 mb. The ten thousands digit C* is added here. The value may need to be changed in the C* future if it proves incorrect. C IF ( ( ier .eq. 0 ) .and. ( above ) ) THEN iz = iz * 10 z = iz IF ( ipres .eq. 70 ) THEN z = z + 10000. ELSE IF ((ipres .eq. 50) .and. (iz .ge. 8000)) THEN z = z + 10000. ELSE IF ((ipres .eq. 50) .and. (iz .lt. 8000)) THEN z = z + 20000. ELSE IF ( ipres .ge. 20 ) THEN z = z + 20000. ELSE IF ((ipres .eq. 10) .and. (iz .gt. 8000)) THEN z = z + 20000. ELSE IF ((ipres .eq. 10) .and. (iz .lt. 8000)) THEN z = z + 30000. ELSE IF ( ipres .ge. 3 ) THEN z = z + 30000. ELSE IF ((ipres .eq. 2) .and. (iz .gt. 8000)) THEN z = z + 30000. ELSE IF ((ipres .eq. 2) .and. (iz .lt. 8000)) THEN z = z + 40000. ELSE z = z + 40000. END IF END IF END IF C* RETURN END
import Data.Vect maryInVector : Elem "Mary" ["Peter", "Paul", "Mary"] maryInVector = There (There Here) elemOfEmptyAbsurd : Elem a [] -> Void elemOfEmptyAbsurd Here impossible elemOfEmptyAbsurd (There _) impossible removeElem : (elem : a) -> (v : Vect (S n) a) -> Elem elem v -> Vect n a removeElem elem (elem :: xs) Here = xs removeElem {n = Z} elem (x :: []) (There later) = absurd later removeElem {n = (S k)} elem (x :: xs) (There later) = x :: removeElem elem xs later removeElem_auto : (value : a) -> (xs : Vect (S n) a) -> {auto prf : Elem value xs} -> Vect n a removeElem_auto value xs {prf} = removeElem value xs prf isElem' : DecEq a => (elem : a) -> (v : Vect n a) -> Dec (Elem elem v) isElem' elem [] = No absurd isElem' elem (x :: xs) = case decEq elem x of (Yes Refl) => Yes Here (No contraHead) => case isElem' elem xs of (Yes prf) => Yes (There prf) (No contraTail) => No (\prf => (case prf of Here => contraHead Refl (There later) => contraTail later)) data ListElem : a -> List a -> Type where Here : ListElem x (x :: ys) There : ListElem x xs -> ListElem x (y :: xs) data Last : List a -> a -> Type where LastOne : Last [a] a LastCons : Last as a -> Last (x :: as) a noLastElemForEmptyList : Last [] a -> Void noLastElemForEmptyList LastOne impossible noLastElemForEmptyList (LastCons _) impossible isLast : DecEq a => (xs : List a) -> (elem : a) -> Dec (Last xs elem) isLast [] elem = No noLastElemForEmptyList isLast [e] elem = case decEq elem e of (Yes Refl) => Yes LastOne (No contra) => No (\prf => (case prf of LastOne => contra Refl (LastCons x) => noLastElemForEmptyList x)) isLast (_ :: y :: ys) elem = case isLast (y::ys) elem of (Yes prf) => Yes $ LastCons prf (No contra) => No (\prf => (case prf of (LastCons x) => contra x))
\section{Introduction} \label{sec:introduction} Example of a citation~\cite{latexcompanion}. \lipsum[1] \begin{figure} \centering \includegraphics[width=0.8\textwidth]{assets/graphics/example.jpg} \caption{A picture I took a while ago!} \label{fig:test-figure} \end{figure} \section{Methods and tools} \label{sec:methods-and-tools} \subsection{Subsection 1} \label{subsec:subsec1} \lipsum[1] \subsection{Subsection 2} \label{subsec:subsec2} \lipsum[2] \subsubsection{Subsubsection 1} \label{subsubsec:subsubsec-1} Hello World! Some math? \(\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}\) \subsubsection{Subsubsection 2} \label{subsubsec:subsubsec-2} \lipsum[6] \subsection{Subsection 3} \label{subsec:subsec3} \lipsum[3] \section{Results} \label{sec:results} \lipsum[2] \subsection{Subsection 1} \label{subsec:subsec12} \lipsum[3-6] \subsection{Subsection 2} \label{subsec:subsec13} \lipsum[7-10] \section{Discussion} \label{sec:discussion} \lipsum[1-2] \subsection{Subsection 1} \label{subsec:subsec123} \lipsum[2-3] \subsection{Subsection 2} \label{subsec:subsec134} \lipsum[11-12] \section{Summary} \label{sec:summary} \lipsum[1-3]
lemma exists_double_arc: fixes g :: "real \<Rightarrow> 'a::real_normed_vector" assumes "simple_path g" "pathfinish g = pathstart g" "a \<in> path_image g" "b \<in> path_image g" "a \<noteq> b" obtains u d where "arc u" "arc d" "pathstart u = a" "pathfinish u = b" "pathstart d = b" "pathfinish d = a" "(path_image u) \<inter> (path_image d) = {a,b}" "(path_image u) \<union> (path_image d) = path_image g"
module Tests include("utilities.jl") include("term_test.jl") include("bivariate_quadratic_test.jl") include("concave_then_convex_cubic_test.jl") include("horn_test.jl") const linear_tests = Dict( "dsos_term" => dsos_term_test, "dsos_bivariate_quadratic" => dsos_bivariate_quadratic_test, "dsos_concave_then_convex_cubic" => dsos_concave_then_convex_cubic_test, "dsos_horn_test" => dsos_horn_test ) const soc_tests = Dict( "sdsos_term" => sdsos_term_test, "sdsos_bivariate_quadratic" => sdsos_bivariate_quadratic_test, "sdsos_concave_then_convex_cubic" => sdsos_concave_then_convex_cubic_test, "sdsos_horn_test" => sdsos_horn_test ) const sd_tests = Dict( "sos_term" => sos_term_test, "sos_bivariate_quadratic" => sos_bivariate_quadratic_test, "sos_concave_then_convex_cubic" => sos_concave_then_convex_cubic_test, "sos_horn_test" => sos_horn_test ) @test_suite linear @test_suite soc @test_suite sd end
[GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁰ : NormedAddCommGroup E inst✝⁹ : NormedAddCommGroup E' inst✝⁸ : NormedAddCommGroup E'' inst✝⁷ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝⁶ : NontriviallyNormedField 𝕜 inst✝⁵ : NormedSpace 𝕜 E inst✝⁴ : NormedSpace 𝕜 E' inst✝³ : NormedSpace 𝕜 E'' inst✝² : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹ : AddGroup G inst✝ : TopologicalSpace G C : ℝ hC : ∀ (i : G), ‖g i‖ ≤ C x t : G s u : Set G hx : x ∈ s hu : -tsupport g + s ⊆ u ⊢ ‖↑(↑L (f t)) (g (x - t))‖ ≤ indicator u (fun t => ‖L‖ * ‖f t‖ * C) t [PROOFSTEP] refine' le_indicator (f := fun t ↦ ‖L (f t) (g (x - t))‖) (fun t _ => _) (fun t ht => _) t [GOAL] case refine'_1 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁰ : NormedAddCommGroup E inst✝⁹ : NormedAddCommGroup E' inst✝⁸ : NormedAddCommGroup E'' inst✝⁷ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝¹ x' : G y y' : E inst✝⁶ : NontriviallyNormedField 𝕜 inst✝⁵ : NormedSpace 𝕜 E inst✝⁴ : NormedSpace 𝕜 E' inst✝³ : NormedSpace 𝕜 E'' inst✝² : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹ : AddGroup G inst✝ : TopologicalSpace G C : ℝ hC : ∀ (i : G), ‖g i‖ ≤ C x t✝ : G s u : Set G hx : x ∈ s hu : -tsupport g + s ⊆ u t : G x✝ : t ∈ u ⊢ (fun t => ‖↑(↑L (f t)) (g (x - t))‖) t ≤ ‖L‖ * ‖f t‖ * C [PROOFSTEP] apply_rules [L.le_of_op_norm₂_le_of_le, le_rfl] [GOAL] case refine'_2 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁰ : NormedAddCommGroup E inst✝⁹ : NormedAddCommGroup E' inst✝⁸ : NormedAddCommGroup E'' inst✝⁷ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝⁶ : NontriviallyNormedField 𝕜 inst✝⁵ : NormedSpace 𝕜 E inst✝⁴ : NormedSpace 𝕜 E' inst✝³ : NormedSpace 𝕜 E'' inst✝² : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹ : AddGroup G inst✝ : TopologicalSpace G C : ℝ hC : ∀ (i : G), ‖g i‖ ≤ C x t✝ : G s u : Set G hx : x ∈ s hu : -tsupport g + s ⊆ u t : G ht : ¬t ∈ u ⊢ (fun t => ‖↑(↑L (f t)) (g (x - t))‖) t ≤ 0 [PROOFSTEP] have : x - t ∉ support g := by refine mt (fun hxt => hu ?_) ht refine' ⟨_, _, Set.neg_mem_neg.mpr (subset_closure hxt), hx, _⟩ simp only [neg_sub, sub_add_cancel] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁰ : NormedAddCommGroup E inst✝⁹ : NormedAddCommGroup E' inst✝⁸ : NormedAddCommGroup E'' inst✝⁷ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝⁶ : NontriviallyNormedField 𝕜 inst✝⁵ : NormedSpace 𝕜 E inst✝⁴ : NormedSpace 𝕜 E' inst✝³ : NormedSpace 𝕜 E'' inst✝² : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹ : AddGroup G inst✝ : TopologicalSpace G C : ℝ hC : ∀ (i : G), ‖g i‖ ≤ C x t✝ : G s u : Set G hx : x ∈ s hu : -tsupport g + s ⊆ u t : G ht : ¬t ∈ u ⊢ ¬x - t ∈ support g [PROOFSTEP] refine mt (fun hxt => hu ?_) ht [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁰ : NormedAddCommGroup E inst✝⁹ : NormedAddCommGroup E' inst✝⁸ : NormedAddCommGroup E'' inst✝⁷ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝⁶ : NontriviallyNormedField 𝕜 inst✝⁵ : NormedSpace 𝕜 E inst✝⁴ : NormedSpace 𝕜 E' inst✝³ : NormedSpace 𝕜 E'' inst✝² : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹ : AddGroup G inst✝ : TopologicalSpace G C : ℝ hC : ∀ (i : G), ‖g i‖ ≤ C x t✝ : G s u : Set G hx : x ∈ s hu : -tsupport g + s ⊆ u t : G ht : ¬t ∈ u hxt : x - t ∈ support g ⊢ t ∈ -tsupport g + s [PROOFSTEP] refine' ⟨_, _, Set.neg_mem_neg.mpr (subset_closure hxt), hx, _⟩ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁰ : NormedAddCommGroup E inst✝⁹ : NormedAddCommGroup E' inst✝⁸ : NormedAddCommGroup E'' inst✝⁷ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝⁶ : NontriviallyNormedField 𝕜 inst✝⁵ : NormedSpace 𝕜 E inst✝⁴ : NormedSpace 𝕜 E' inst✝³ : NormedSpace 𝕜 E'' inst✝² : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹ : AddGroup G inst✝ : TopologicalSpace G C : ℝ hC : ∀ (i : G), ‖g i‖ ≤ C x t✝ : G s u : Set G hx : x ∈ s hu : -tsupport g + s ⊆ u t : G ht : ¬t ∈ u hxt : x - t ∈ support g ⊢ (fun x x_1 => x + x_1) (-(x - t)) x = t [PROOFSTEP] simp only [neg_sub, sub_add_cancel] [GOAL] case refine'_2 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁰ : NormedAddCommGroup E inst✝⁹ : NormedAddCommGroup E' inst✝⁸ : NormedAddCommGroup E'' inst✝⁷ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝⁶ : NontriviallyNormedField 𝕜 inst✝⁵ : NormedSpace 𝕜 E inst✝⁴ : NormedSpace 𝕜 E' inst✝³ : NormedSpace 𝕜 E'' inst✝² : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹ : AddGroup G inst✝ : TopologicalSpace G C : ℝ hC : ∀ (i : G), ‖g i‖ ≤ C x t✝ : G s u : Set G hx : x ∈ s hu : -tsupport g + s ⊆ u t : G ht : ¬t ∈ u this : ¬x - t ∈ support g ⊢ (fun t => ‖↑(↑L (f t)) (g (x - t))‖) t ≤ 0 [PROOFSTEP] simp only [nmem_support.mp this, (L _).map_zero, norm_zero, le_rfl] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁰ : NormedAddCommGroup E inst✝⁹ : NormedAddCommGroup E' inst✝⁸ : NormedAddCommGroup E'' inst✝⁷ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝⁶ : NontriviallyNormedField 𝕜 inst✝⁵ : NormedSpace 𝕜 E inst✝⁴ : NormedSpace 𝕜 E' inst✝³ : NormedSpace 𝕜 E'' inst✝² : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹ : AddGroup G inst✝ : TopologicalSpace G hcg : HasCompactSupport g hg : Continuous g x t : G s u : Set G hx : x ∈ s hu : -tsupport g + s ⊆ u ⊢ ‖↑(↑L (f t)) (g (x - t))‖ ≤ indicator u (fun t => ‖L‖ * ‖f t‖ * ⨆ (i : G), ‖g i‖) t [PROOFSTEP] refine convolution_integrand_bound_right_of_le_of_subset _ (fun i => ?_) hx hu [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁰ : NormedAddCommGroup E inst✝⁹ : NormedAddCommGroup E' inst✝⁸ : NormedAddCommGroup E'' inst✝⁷ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝⁶ : NontriviallyNormedField 𝕜 inst✝⁵ : NormedSpace 𝕜 E inst✝⁴ : NormedSpace 𝕜 E' inst✝³ : NormedSpace 𝕜 E'' inst✝² : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹ : AddGroup G inst✝ : TopologicalSpace G hcg : HasCompactSupport g hg : Continuous g x t : G s u : Set G hx : x ∈ s hu : -tsupport g + s ⊆ u i : G ⊢ ‖g i‖ ≤ ⨆ (i : G), ‖g i‖ [PROOFSTEP] exact le_ciSup (hg.norm.bddAbove_range_of_hasCompactSupport hcg.norm) _ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁰ : NormedAddCommGroup E inst✝⁹ : NormedAddCommGroup E' inst✝⁸ : NormedAddCommGroup E'' inst✝⁷ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝⁶ : NontriviallyNormedField 𝕜 inst✝⁵ : NormedSpace 𝕜 E inst✝⁴ : NormedSpace 𝕜 E' inst✝³ : NormedSpace 𝕜 E'' inst✝² : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹ : AddGroup G inst✝ : TopologicalSpace G hcf : HasCompactSupport f hf : Continuous f x t : G s : Set G hx : x ∈ s ⊢ ‖↑(↑L (f (x - t))) (g t)‖ ≤ indicator (-tsupport f + s) (fun t => (‖L‖ * ⨆ (i : G), ‖f i‖) * ‖g t‖) t [PROOFSTEP] convert hcf.convolution_integrand_bound_right L.flip hf hx using 1 [GOAL] case h.e'_4 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁰ : NormedAddCommGroup E inst✝⁹ : NormedAddCommGroup E' inst✝⁸ : NormedAddCommGroup E'' inst✝⁷ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝⁶ : NontriviallyNormedField 𝕜 inst✝⁵ : NormedSpace 𝕜 E inst✝⁴ : NormedSpace 𝕜 E' inst✝³ : NormedSpace 𝕜 E'' inst✝² : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹ : AddGroup G inst✝ : TopologicalSpace G hcf : HasCompactSupport f hf : Continuous f x t : G s : Set G hx : x ∈ s ⊢ indicator (-tsupport f + s) (fun t => (‖L‖ * ⨆ (i : G), ‖f i‖) * ‖g t‖) t = indicator (-tsupport f + s) (fun t => ‖ContinuousLinearMap.flip L‖ * ‖g t‖ * ⨆ (i : G), ‖f i‖) t [PROOFSTEP] simp_rw [L.op_norm_flip, mul_right_comm] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : AddGroup G inst✝¹ : MeasurableAdd G inst✝ : MeasurableNeg G x₀ : G s : Set G hbg : BddAbove ((fun i => ‖g i‖) '' ((fun t => -t + x₀) ⁻¹' s)) hs : MeasurableSet s h2s : (support fun t => ↑(↑L (f t)) (g (x₀ - t))) ⊆ s hf : IntegrableOn f s hmg : AEStronglyMeasurable g (Measure.map (fun t => x₀ - t) (Measure.restrict μ s)) ⊢ ConvolutionExistsAt f g x₀ L [PROOFSTEP] unfold ConvolutionExistsAt [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : AddGroup G inst✝¹ : MeasurableAdd G inst✝ : MeasurableNeg G x₀ : G s : Set G hbg : BddAbove ((fun i => ‖g i‖) '' ((fun t => -t + x₀) ⁻¹' s)) hs : MeasurableSet s h2s : (support fun t => ↑(↑L (f t)) (g (x₀ - t))) ⊆ s hf : IntegrableOn f s hmg : AEStronglyMeasurable g (Measure.map (fun t => x₀ - t) (Measure.restrict μ s)) ⊢ Integrable fun t => ↑(↑L (f t)) (g (x₀ - t)) [PROOFSTEP] rw [← integrableOn_iff_integrable_of_support_subset h2s] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : AddGroup G inst✝¹ : MeasurableAdd G inst✝ : MeasurableNeg G x₀ : G s : Set G hbg : BddAbove ((fun i => ‖g i‖) '' ((fun t => -t + x₀) ⁻¹' s)) hs : MeasurableSet s h2s : (support fun t => ↑(↑L (f t)) (g (x₀ - t))) ⊆ s hf : IntegrableOn f s hmg : AEStronglyMeasurable g (Measure.map (fun t => x₀ - t) (Measure.restrict μ s)) ⊢ IntegrableOn (fun t => ↑(↑L (f t)) (g (x₀ - t))) s [PROOFSTEP] set s' := (fun t => -t + x₀) ⁻¹' s [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : AddGroup G inst✝¹ : MeasurableAdd G inst✝ : MeasurableNeg G x₀ : G s : Set G hs : MeasurableSet s h2s : (support fun t => ↑(↑L (f t)) (g (x₀ - t))) ⊆ s hf : IntegrableOn f s hmg : AEStronglyMeasurable g (Measure.map (fun t => x₀ - t) (Measure.restrict μ s)) s' : Set G := (fun t => -t + x₀) ⁻¹' s hbg : BddAbove ((fun i => ‖g i‖) '' s') ⊢ IntegrableOn (fun t => ↑(↑L (f t)) (g (x₀ - t))) s [PROOFSTEP] have : ∀ᵐ t : G ∂μ.restrict s, ‖L (f t) (g (x₀ - t))‖ ≤ s.indicator (fun t => ‖L‖ * ‖f t‖ * ⨆ i : s', ‖g i‖) t [GOAL] case this 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : AddGroup G inst✝¹ : MeasurableAdd G inst✝ : MeasurableNeg G x₀ : G s : Set G hs : MeasurableSet s h2s : (support fun t => ↑(↑L (f t)) (g (x₀ - t))) ⊆ s hf : IntegrableOn f s hmg : AEStronglyMeasurable g (Measure.map (fun t => x₀ - t) (Measure.restrict μ s)) s' : Set G := (fun t => -t + x₀) ⁻¹' s hbg : BddAbove ((fun i => ‖g i‖) '' s') ⊢ ∀ᵐ (t : G) ∂Measure.restrict μ s, ‖↑(↑L (f t)) (g (x₀ - t))‖ ≤ indicator s (fun t => ‖L‖ * ‖f t‖ * ⨆ (i : ↑s'), ‖g ↑i‖) t [PROOFSTEP] refine' eventually_of_forall _ [GOAL] case this 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : AddGroup G inst✝¹ : MeasurableAdd G inst✝ : MeasurableNeg G x₀ : G s : Set G hs : MeasurableSet s h2s : (support fun t => ↑(↑L (f t)) (g (x₀ - t))) ⊆ s hf : IntegrableOn f s hmg : AEStronglyMeasurable g (Measure.map (fun t => x₀ - t) (Measure.restrict μ s)) s' : Set G := (fun t => -t + x₀) ⁻¹' s hbg : BddAbove ((fun i => ‖g i‖) '' s') ⊢ ∀ (x : G), ‖↑(↑L (f x)) (g (x₀ - x))‖ ≤ indicator s (fun t => ‖L‖ * ‖f t‖ * ⨆ (i : ↑s'), ‖g ↑i‖) x [PROOFSTEP] refine' le_indicator (fun t ht => _) fun t ht => _ [GOAL] case this.refine'_1 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : AddGroup G inst✝¹ : MeasurableAdd G inst✝ : MeasurableNeg G x₀ : G s : Set G hs : MeasurableSet s h2s : (support fun t => ↑(↑L (f t)) (g (x₀ - t))) ⊆ s hf : IntegrableOn f s hmg : AEStronglyMeasurable g (Measure.map (fun t => x₀ - t) (Measure.restrict μ s)) s' : Set G := (fun t => -t + x₀) ⁻¹' s hbg : BddAbove ((fun i => ‖g i‖) '' s') t : G ht : t ∈ s ⊢ ‖↑(↑L (f t)) (g (x₀ - t))‖ ≤ ‖L‖ * ‖f t‖ * ⨆ (i : ↑s'), ‖g ↑i‖ [PROOFSTEP] apply_rules [L.le_of_op_norm₂_le_of_le, le_rfl] [GOAL] case this.refine'_1.hy 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : AddGroup G inst✝¹ : MeasurableAdd G inst✝ : MeasurableNeg G x₀ : G s : Set G hs : MeasurableSet s h2s : (support fun t => ↑(↑L (f t)) (g (x₀ - t))) ⊆ s hf : IntegrableOn f s hmg : AEStronglyMeasurable g (Measure.map (fun t => x₀ - t) (Measure.restrict μ s)) s' : Set G := (fun t => -t + x₀) ⁻¹' s hbg : BddAbove ((fun i => ‖g i‖) '' s') t : G ht : t ∈ s ⊢ ‖g (x₀ - t)‖ ≤ ⨆ (i : ↑s'), ‖g ↑i‖ [PROOFSTEP] refine' (le_ciSup_set hbg <| mem_preimage.mpr _) [GOAL] case this.refine'_1.hy 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : AddGroup G inst✝¹ : MeasurableAdd G inst✝ : MeasurableNeg G x₀ : G s : Set G hs : MeasurableSet s h2s : (support fun t => ↑(↑L (f t)) (g (x₀ - t))) ⊆ s hf : IntegrableOn f s hmg : AEStronglyMeasurable g (Measure.map (fun t => x₀ - t) (Measure.restrict μ s)) s' : Set G := (fun t => -t + x₀) ⁻¹' s hbg : BddAbove ((fun i => ‖g i‖) '' s') t : G ht : t ∈ s ⊢ -(x₀ - t) + x₀ ∈ s [PROOFSTEP] rwa [neg_sub, sub_add_cancel] [GOAL] case this.refine'_2 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : AddGroup G inst✝¹ : MeasurableAdd G inst✝ : MeasurableNeg G x₀ : G s : Set G hs : MeasurableSet s h2s : (support fun t => ↑(↑L (f t)) (g (x₀ - t))) ⊆ s hf : IntegrableOn f s hmg : AEStronglyMeasurable g (Measure.map (fun t => x₀ - t) (Measure.restrict μ s)) s' : Set G := (fun t => -t + x₀) ⁻¹' s hbg : BddAbove ((fun i => ‖g i‖) '' s') t : G ht : ¬t ∈ s ⊢ ‖↑(↑L (f t)) (g (x₀ - t))‖ ≤ 0 [PROOFSTEP] have : t ∉ support fun t => L (f t) (g (x₀ - t)) := mt (fun h => h2s h) ht [GOAL] case this.refine'_2 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : AddGroup G inst✝¹ : MeasurableAdd G inst✝ : MeasurableNeg G x₀ : G s : Set G hs : MeasurableSet s h2s : (support fun t => ↑(↑L (f t)) (g (x₀ - t))) ⊆ s hf : IntegrableOn f s hmg : AEStronglyMeasurable g (Measure.map (fun t => x₀ - t) (Measure.restrict μ s)) s' : Set G := (fun t => -t + x₀) ⁻¹' s hbg : BddAbove ((fun i => ‖g i‖) '' s') t : G ht : ¬t ∈ s this : ¬t ∈ support fun t => ↑(↑L (f t)) (g (x₀ - t)) ⊢ ‖↑(↑L (f t)) (g (x₀ - t))‖ ≤ 0 [PROOFSTEP] rw [nmem_support.mp this, norm_zero] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : AddGroup G inst✝¹ : MeasurableAdd G inst✝ : MeasurableNeg G x₀ : G s : Set G hs : MeasurableSet s h2s : (support fun t => ↑(↑L (f t)) (g (x₀ - t))) ⊆ s hf : IntegrableOn f s hmg : AEStronglyMeasurable g (Measure.map (fun t => x₀ - t) (Measure.restrict μ s)) s' : Set G := (fun t => -t + x₀) ⁻¹' s hbg : BddAbove ((fun i => ‖g i‖) '' s') this : ∀ᵐ (t : G) ∂Measure.restrict μ s, ‖↑(↑L (f t)) (g (x₀ - t))‖ ≤ indicator s (fun t => ‖L‖ * ‖f t‖ * ⨆ (i : ↑s'), ‖g ↑i‖) t ⊢ IntegrableOn (fun t => ↑(↑L (f t)) (g (x₀ - t))) s [PROOFSTEP] refine' Integrable.mono' _ _ this [GOAL] case refine'_1 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : AddGroup G inst✝¹ : MeasurableAdd G inst✝ : MeasurableNeg G x₀ : G s : Set G hs : MeasurableSet s h2s : (support fun t => ↑(↑L (f t)) (g (x₀ - t))) ⊆ s hf : IntegrableOn f s hmg : AEStronglyMeasurable g (Measure.map (fun t => x₀ - t) (Measure.restrict μ s)) s' : Set G := (fun t => -t + x₀) ⁻¹' s hbg : BddAbove ((fun i => ‖g i‖) '' s') this : ∀ᵐ (t : G) ∂Measure.restrict μ s, ‖↑(↑L (f t)) (g (x₀ - t))‖ ≤ indicator s (fun t => ‖L‖ * ‖f t‖ * ⨆ (i : ↑s'), ‖g ↑i‖) t ⊢ Integrable fun a => indicator s (fun t => ‖L‖ * ‖f t‖ * ⨆ (i : ↑s'), ‖g ↑i‖) a [PROOFSTEP] rw [integrable_indicator_iff hs] [GOAL] case refine'_1 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : AddGroup G inst✝¹ : MeasurableAdd G inst✝ : MeasurableNeg G x₀ : G s : Set G hs : MeasurableSet s h2s : (support fun t => ↑(↑L (f t)) (g (x₀ - t))) ⊆ s hf : IntegrableOn f s hmg : AEStronglyMeasurable g (Measure.map (fun t => x₀ - t) (Measure.restrict μ s)) s' : Set G := (fun t => -t + x₀) ⁻¹' s hbg : BddAbove ((fun i => ‖g i‖) '' s') this : ∀ᵐ (t : G) ∂Measure.restrict μ s, ‖↑(↑L (f t)) (g (x₀ - t))‖ ≤ indicator s (fun t => ‖L‖ * ‖f t‖ * ⨆ (i : ↑s'), ‖g ↑i‖) t ⊢ IntegrableOn (fun t => ‖L‖ * ‖f t‖ * ⨆ (i : ↑s'), ‖g ↑i‖) s [PROOFSTEP] exact ((hf.norm.const_mul _).mul_const _).integrableOn [GOAL] case refine'_2 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : AddGroup G inst✝¹ : MeasurableAdd G inst✝ : MeasurableNeg G x₀ : G s : Set G hs : MeasurableSet s h2s : (support fun t => ↑(↑L (f t)) (g (x₀ - t))) ⊆ s hf : IntegrableOn f s hmg : AEStronglyMeasurable g (Measure.map (fun t => x₀ - t) (Measure.restrict μ s)) s' : Set G := (fun t => -t + x₀) ⁻¹' s hbg : BddAbove ((fun i => ‖g i‖) '' s') this : ∀ᵐ (t : G) ∂Measure.restrict μ s, ‖↑(↑L (f t)) (g (x₀ - t))‖ ≤ indicator s (fun t => ‖L‖ * ‖f t‖ * ⨆ (i : ↑s'), ‖g ↑i‖) t ⊢ AEStronglyMeasurable (fun t => ↑(↑L (f t)) (g (x₀ - t))) (Measure.restrict μ s) [PROOFSTEP] exact hf.aestronglyMeasurable.convolution_integrand_snd' L hmg [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : AddGroup G inst✝¹ : MeasurableAdd G inst✝ : MeasurableNeg G x₀ : G h : ConvolutionExistsAt (fun x => ‖f x‖) (fun x => ‖g x‖) x₀ (mul ℝ ℝ) hmf : AEStronglyMeasurable f μ hmg : AEStronglyMeasurable g (Measure.map (fun t => x₀ - t) μ) ⊢ ConvolutionExistsAt f g x₀ L [PROOFSTEP] refine' (h.const_mul ‖L‖).mono' (hmf.convolution_integrand_snd' L hmg) (eventually_of_forall fun x => _) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : AddGroup G inst✝¹ : MeasurableAdd G inst✝ : MeasurableNeg G x₀ : G h : ConvolutionExistsAt (fun x => ‖f x‖) (fun x => ‖g x‖) x₀ (mul ℝ ℝ) hmf : AEStronglyMeasurable f μ hmg : AEStronglyMeasurable g (Measure.map (fun t => x₀ - t) μ) x : G ⊢ ‖↑(↑L (f x)) (g (x₀ - x))‖ ≤ ‖L‖ * ↑(↑(mul ℝ ℝ) ((fun x => ‖f x‖) x)) ((fun x => ‖g x‖) (x₀ - x)) [PROOFSTEP] rw [mul_apply', ← mul_assoc] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : AddGroup G inst✝¹ : MeasurableAdd G inst✝ : MeasurableNeg G x₀ : G h : ConvolutionExistsAt (fun x => ‖f x‖) (fun x => ‖g x‖) x₀ (mul ℝ ℝ) hmf : AEStronglyMeasurable f μ hmg : AEStronglyMeasurable g (Measure.map (fun t => x₀ - t) μ) x : G ⊢ ‖↑(↑L (f x)) (g (x₀ - x))‖ ≤ ‖L‖ * (fun x => ‖f x‖) x * (fun x => ‖g x‖) (x₀ - x) [PROOFSTEP] apply L.le_op_norm₂ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁵ : NormedAddCommGroup E inst✝¹⁴ : NormedAddCommGroup E' inst✝¹³ : NormedAddCommGroup E'' inst✝¹² : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹¹ : NontriviallyNormedField 𝕜 inst✝¹⁰ : NormedSpace 𝕜 E inst✝⁹ : NormedSpace 𝕜 E' inst✝⁸ : NormedSpace 𝕜 E'' inst✝⁷ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁶ : MeasurableSpace G μ ν : Measure G inst✝⁵ : AddGroup G inst✝⁴ : MeasurableAdd₂ G inst✝³ : MeasurableNeg G inst✝² : SigmaFinite μ inst✝¹ : IsAddRightInvariant μ inst✝ : SigmaFinite ν hf : Integrable f hg : Integrable g ⊢ Integrable fun p => ↑(↑L (f p.snd)) (g (p.fst - p.snd)) [PROOFSTEP] have h_meas : AEStronglyMeasurable (fun p : G × G => L (f p.2) (g (p.1 - p.2))) (μ.prod ν) := hf.aestronglyMeasurable.convolution_integrand L hg.aestronglyMeasurable [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁵ : NormedAddCommGroup E inst✝¹⁴ : NormedAddCommGroup E' inst✝¹³ : NormedAddCommGroup E'' inst✝¹² : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹¹ : NontriviallyNormedField 𝕜 inst✝¹⁰ : NormedSpace 𝕜 E inst✝⁹ : NormedSpace 𝕜 E' inst✝⁸ : NormedSpace 𝕜 E'' inst✝⁷ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁶ : MeasurableSpace G μ ν : Measure G inst✝⁵ : AddGroup G inst✝⁴ : MeasurableAdd₂ G inst✝³ : MeasurableNeg G inst✝² : SigmaFinite μ inst✝¹ : IsAddRightInvariant μ inst✝ : SigmaFinite ν hf : Integrable f hg : Integrable g h_meas : AEStronglyMeasurable (fun p => ↑(↑L (f p.snd)) (g (p.fst - p.snd))) (Measure.prod μ ν) ⊢ Integrable fun p => ↑(↑L (f p.snd)) (g (p.fst - p.snd)) [PROOFSTEP] have h2_meas : AEStronglyMeasurable (fun y : G => ∫ x : G, ‖L (f y) (g (x - y))‖ ∂μ) ν := h_meas.prod_swap.norm.integral_prod_right' [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁵ : NormedAddCommGroup E inst✝¹⁴ : NormedAddCommGroup E' inst✝¹³ : NormedAddCommGroup E'' inst✝¹² : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹¹ : NontriviallyNormedField 𝕜 inst✝¹⁰ : NormedSpace 𝕜 E inst✝⁹ : NormedSpace 𝕜 E' inst✝⁸ : NormedSpace 𝕜 E'' inst✝⁷ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁶ : MeasurableSpace G μ ν : Measure G inst✝⁵ : AddGroup G inst✝⁴ : MeasurableAdd₂ G inst✝³ : MeasurableNeg G inst✝² : SigmaFinite μ inst✝¹ : IsAddRightInvariant μ inst✝ : SigmaFinite ν hf : Integrable f hg : Integrable g h_meas : AEStronglyMeasurable (fun p => ↑(↑L (f p.snd)) (g (p.fst - p.snd))) (Measure.prod μ ν) h2_meas : AEStronglyMeasurable (fun y => ∫ (x : G), ‖↑(↑L (f y)) (g (x - y))‖ ∂μ) ν ⊢ Integrable fun p => ↑(↑L (f p.snd)) (g (p.fst - p.snd)) [PROOFSTEP] simp_rw [integrable_prod_iff' h_meas] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁵ : NormedAddCommGroup E inst✝¹⁴ : NormedAddCommGroup E' inst✝¹³ : NormedAddCommGroup E'' inst✝¹² : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹¹ : NontriviallyNormedField 𝕜 inst✝¹⁰ : NormedSpace 𝕜 E inst✝⁹ : NormedSpace 𝕜 E' inst✝⁸ : NormedSpace 𝕜 E'' inst✝⁷ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁶ : MeasurableSpace G μ ν : Measure G inst✝⁵ : AddGroup G inst✝⁴ : MeasurableAdd₂ G inst✝³ : MeasurableNeg G inst✝² : SigmaFinite μ inst✝¹ : IsAddRightInvariant μ inst✝ : SigmaFinite ν hf : Integrable f hg : Integrable g h_meas : AEStronglyMeasurable (fun p => ↑(↑L (f p.snd)) (g (p.fst - p.snd))) (Measure.prod μ ν) h2_meas : AEStronglyMeasurable (fun y => ∫ (x : G), ‖↑(↑L (f y)) (g (x - y))‖ ∂μ) ν ⊢ (∀ᵐ (y : G) ∂ν, Integrable fun x => ↑(↑L (f y)) (g (x - y))) ∧ Integrable fun y => ∫ (x : G), ‖↑(↑L (f y)) (g (x - y))‖ ∂μ [PROOFSTEP] refine' ⟨eventually_of_forall fun t => (L (f t)).integrable_comp (hg.comp_sub_right t), _⟩ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁵ : NormedAddCommGroup E inst✝¹⁴ : NormedAddCommGroup E' inst✝¹³ : NormedAddCommGroup E'' inst✝¹² : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹¹ : NontriviallyNormedField 𝕜 inst✝¹⁰ : NormedSpace 𝕜 E inst✝⁹ : NormedSpace 𝕜 E' inst✝⁸ : NormedSpace 𝕜 E'' inst✝⁷ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁶ : MeasurableSpace G μ ν : Measure G inst✝⁵ : AddGroup G inst✝⁴ : MeasurableAdd₂ G inst✝³ : MeasurableNeg G inst✝² : SigmaFinite μ inst✝¹ : IsAddRightInvariant μ inst✝ : SigmaFinite ν hf : Integrable f hg : Integrable g h_meas : AEStronglyMeasurable (fun p => ↑(↑L (f p.snd)) (g (p.fst - p.snd))) (Measure.prod μ ν) h2_meas : AEStronglyMeasurable (fun y => ∫ (x : G), ‖↑(↑L (f y)) (g (x - y))‖ ∂μ) ν ⊢ Integrable fun y => ∫ (x : G), ‖↑(↑L (f y)) (g (x - y))‖ ∂μ [PROOFSTEP] refine' Integrable.mono' _ h2_meas (eventually_of_forall fun t => (_ : _ ≤ ‖L‖ * ‖f t‖ * ∫ x, ‖g (x - t)‖ ∂μ)) [GOAL] case refine'_1 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁵ : NormedAddCommGroup E inst✝¹⁴ : NormedAddCommGroup E' inst✝¹³ : NormedAddCommGroup E'' inst✝¹² : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹¹ : NontriviallyNormedField 𝕜 inst✝¹⁰ : NormedSpace 𝕜 E inst✝⁹ : NormedSpace 𝕜 E' inst✝⁸ : NormedSpace 𝕜 E'' inst✝⁷ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁶ : MeasurableSpace G μ ν : Measure G inst✝⁵ : AddGroup G inst✝⁴ : MeasurableAdd₂ G inst✝³ : MeasurableNeg G inst✝² : SigmaFinite μ inst✝¹ : IsAddRightInvariant μ inst✝ : SigmaFinite ν hf : Integrable f hg : Integrable g h_meas : AEStronglyMeasurable (fun p => ↑(↑L (f p.snd)) (g (p.fst - p.snd))) (Measure.prod μ ν) h2_meas : AEStronglyMeasurable (fun y => ∫ (x : G), ‖↑(↑L (f y)) (g (x - y))‖ ∂μ) ν ⊢ Integrable fun t => ‖L‖ * ‖f t‖ * ∫ (x : G), ‖g (x - t)‖ ∂μ [PROOFSTEP] simp only [integral_sub_right_eq_self (‖g ·‖)] [GOAL] case refine'_1 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁵ : NormedAddCommGroup E inst✝¹⁴ : NormedAddCommGroup E' inst✝¹³ : NormedAddCommGroup E'' inst✝¹² : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹¹ : NontriviallyNormedField 𝕜 inst✝¹⁰ : NormedSpace 𝕜 E inst✝⁹ : NormedSpace 𝕜 E' inst✝⁸ : NormedSpace 𝕜 E'' inst✝⁷ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁶ : MeasurableSpace G μ ν : Measure G inst✝⁵ : AddGroup G inst✝⁴ : MeasurableAdd₂ G inst✝³ : MeasurableNeg G inst✝² : SigmaFinite μ inst✝¹ : IsAddRightInvariant μ inst✝ : SigmaFinite ν hf : Integrable f hg : Integrable g h_meas : AEStronglyMeasurable (fun p => ↑(↑L (f p.snd)) (g (p.fst - p.snd))) (Measure.prod μ ν) h2_meas : AEStronglyMeasurable (fun y => ∫ (x : G), ‖↑(↑L (f y)) (g (x - y))‖ ∂μ) ν ⊢ Integrable fun t => ‖L‖ * ‖f t‖ * ∫ (x : G), ‖g x‖ ∂μ [PROOFSTEP] exact (hf.norm.const_mul _).mul_const _ [GOAL] case refine'_2 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁵ : NormedAddCommGroup E inst✝¹⁴ : NormedAddCommGroup E' inst✝¹³ : NormedAddCommGroup E'' inst✝¹² : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹¹ : NontriviallyNormedField 𝕜 inst✝¹⁰ : NormedSpace 𝕜 E inst✝⁹ : NormedSpace 𝕜 E' inst✝⁸ : NormedSpace 𝕜 E'' inst✝⁷ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁶ : MeasurableSpace G μ ν : Measure G inst✝⁵ : AddGroup G inst✝⁴ : MeasurableAdd₂ G inst✝³ : MeasurableNeg G inst✝² : SigmaFinite μ inst✝¹ : IsAddRightInvariant μ inst✝ : SigmaFinite ν hf : Integrable f hg : Integrable g h_meas : AEStronglyMeasurable (fun p => ↑(↑L (f p.snd)) (g (p.fst - p.snd))) (Measure.prod μ ν) h2_meas : AEStronglyMeasurable (fun y => ∫ (x : G), ‖↑(↑L (f y)) (g (x - y))‖ ∂μ) ν t : G ⊢ ‖∫ (x : G), ‖↑(↑L (f t)) (g (x - t))‖ ∂μ‖ ≤ ‖L‖ * ‖f t‖ * ∫ (x : G), ‖g (x - t)‖ ∂μ [PROOFSTEP] simp_rw [← integral_mul_left] [GOAL] case refine'_2 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁵ : NormedAddCommGroup E inst✝¹⁴ : NormedAddCommGroup E' inst✝¹³ : NormedAddCommGroup E'' inst✝¹² : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹¹ : NontriviallyNormedField 𝕜 inst✝¹⁰ : NormedSpace 𝕜 E inst✝⁹ : NormedSpace 𝕜 E' inst✝⁸ : NormedSpace 𝕜 E'' inst✝⁷ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁶ : MeasurableSpace G μ ν : Measure G inst✝⁵ : AddGroup G inst✝⁴ : MeasurableAdd₂ G inst✝³ : MeasurableNeg G inst✝² : SigmaFinite μ inst✝¹ : IsAddRightInvariant μ inst✝ : SigmaFinite ν hf : Integrable f hg : Integrable g h_meas : AEStronglyMeasurable (fun p => ↑(↑L (f p.snd)) (g (p.fst - p.snd))) (Measure.prod μ ν) h2_meas : AEStronglyMeasurable (fun y => ∫ (x : G), ‖↑(↑L (f y)) (g (x - y))‖ ∂μ) ν t : G ⊢ ‖∫ (x : G), ‖↑(↑L (f t)) (g (x - t))‖ ∂μ‖ ≤ ∫ (a : G), ‖L‖ * ‖f t‖ * ‖g (a - t)‖ ∂μ [PROOFSTEP] rw [Real.norm_of_nonneg] [GOAL] case refine'_2 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁵ : NormedAddCommGroup E inst✝¹⁴ : NormedAddCommGroup E' inst✝¹³ : NormedAddCommGroup E'' inst✝¹² : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹¹ : NontriviallyNormedField 𝕜 inst✝¹⁰ : NormedSpace 𝕜 E inst✝⁹ : NormedSpace 𝕜 E' inst✝⁸ : NormedSpace 𝕜 E'' inst✝⁷ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁶ : MeasurableSpace G μ ν : Measure G inst✝⁵ : AddGroup G inst✝⁴ : MeasurableAdd₂ G inst✝³ : MeasurableNeg G inst✝² : SigmaFinite μ inst✝¹ : IsAddRightInvariant μ inst✝ : SigmaFinite ν hf : Integrable f hg : Integrable g h_meas : AEStronglyMeasurable (fun p => ↑(↑L (f p.snd)) (g (p.fst - p.snd))) (Measure.prod μ ν) h2_meas : AEStronglyMeasurable (fun y => ∫ (x : G), ‖↑(↑L (f y)) (g (x - y))‖ ∂μ) ν t : G ⊢ ∫ (x : G), ‖↑(↑L (f t)) (g (x - t))‖ ∂μ ≤ ∫ (a : G), ‖L‖ * ‖f t‖ * ‖g (a - t)‖ ∂μ [PROOFSTEP] exact integral_mono_of_nonneg (eventually_of_forall fun t => norm_nonneg _) ((hg.comp_sub_right t).norm.const_mul _) (eventually_of_forall fun t => L.le_op_norm₂ _ _) [GOAL] case refine'_2 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁵ : NormedAddCommGroup E inst✝¹⁴ : NormedAddCommGroup E' inst✝¹³ : NormedAddCommGroup E'' inst✝¹² : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹¹ : NontriviallyNormedField 𝕜 inst✝¹⁰ : NormedSpace 𝕜 E inst✝⁹ : NormedSpace 𝕜 E' inst✝⁸ : NormedSpace 𝕜 E'' inst✝⁷ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁶ : MeasurableSpace G μ ν : Measure G inst✝⁵ : AddGroup G inst✝⁴ : MeasurableAdd₂ G inst✝³ : MeasurableNeg G inst✝² : SigmaFinite μ inst✝¹ : IsAddRightInvariant μ inst✝ : SigmaFinite ν hf : Integrable f hg : Integrable g h_meas : AEStronglyMeasurable (fun p => ↑(↑L (f p.snd)) (g (p.fst - p.snd))) (Measure.prod μ ν) h2_meas : AEStronglyMeasurable (fun y => ∫ (x : G), ‖↑(↑L (f y)) (g (x - y))‖ ∂μ) ν t : G ⊢ 0 ≤ ∫ (x : G), ‖↑(↑L (f t)) (g (x - t))‖ ∂μ [PROOFSTEP] exact integral_nonneg fun x => norm_nonneg _ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁹ : NontriviallyNormedField 𝕜 inst✝⁸ : NormedSpace 𝕜 E inst✝⁷ : NormedSpace 𝕜 E' inst✝⁶ : NormedSpace 𝕜 E'' inst✝⁵ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : MeasurableSpace G μ ν : Measure G inst✝³ : AddGroup G inst✝² : TopologicalSpace G inst✝¹ : TopologicalAddGroup G inst✝ : BorelSpace G x₀ : G h : HasCompactSupport fun t => ↑(↑L (f t)) (g (x₀ - t)) hf : LocallyIntegrable f hg : Continuous g ⊢ ConvolutionExistsAt f g x₀ L [PROOFSTEP] let u := (Homeomorph.neg G).trans (Homeomorph.addRight x₀) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁹ : NontriviallyNormedField 𝕜 inst✝⁸ : NormedSpace 𝕜 E inst✝⁷ : NormedSpace 𝕜 E' inst✝⁶ : NormedSpace 𝕜 E'' inst✝⁵ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : MeasurableSpace G μ ν : Measure G inst✝³ : AddGroup G inst✝² : TopologicalSpace G inst✝¹ : TopologicalAddGroup G inst✝ : BorelSpace G x₀ : G h : HasCompactSupport fun t => ↑(↑L (f t)) (g (x₀ - t)) hf : LocallyIntegrable f hg : Continuous g u : G ≃ₜ G := Homeomorph.trans (Homeomorph.neg G) (Homeomorph.addRight x₀) ⊢ ConvolutionExistsAt f g x₀ L [PROOFSTEP] let v := (Homeomorph.neg G).trans (Homeomorph.addLeft x₀) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁹ : NontriviallyNormedField 𝕜 inst✝⁸ : NormedSpace 𝕜 E inst✝⁷ : NormedSpace 𝕜 E' inst✝⁶ : NormedSpace 𝕜 E'' inst✝⁵ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : MeasurableSpace G μ ν : Measure G inst✝³ : AddGroup G inst✝² : TopologicalSpace G inst✝¹ : TopologicalAddGroup G inst✝ : BorelSpace G x₀ : G h : HasCompactSupport fun t => ↑(↑L (f t)) (g (x₀ - t)) hf : LocallyIntegrable f hg : Continuous g u : G ≃ₜ G := Homeomorph.trans (Homeomorph.neg G) (Homeomorph.addRight x₀) v : G ≃ₜ G := Homeomorph.trans (Homeomorph.neg G) (Homeomorph.addLeft x₀) ⊢ ConvolutionExistsAt f g x₀ L [PROOFSTEP] apply ((u.isCompact_preimage.mpr h).bddAbove_image hg.norm.continuousOn).convolutionExistsAt' L isClosed_closure.measurableSet subset_closure (hf.integrableOn_isCompact h) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁹ : NontriviallyNormedField 𝕜 inst✝⁸ : NormedSpace 𝕜 E inst✝⁷ : NormedSpace 𝕜 E' inst✝⁶ : NormedSpace 𝕜 E'' inst✝⁵ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : MeasurableSpace G μ ν : Measure G inst✝³ : AddGroup G inst✝² : TopologicalSpace G inst✝¹ : TopologicalAddGroup G inst✝ : BorelSpace G x₀ : G h : HasCompactSupport fun t => ↑(↑L (f t)) (g (x₀ - t)) hf : LocallyIntegrable f hg : Continuous g u : G ≃ₜ G := Homeomorph.trans (Homeomorph.neg G) (Homeomorph.addRight x₀) v : G ≃ₜ G := Homeomorph.trans (Homeomorph.neg G) (Homeomorph.addLeft x₀) ⊢ AEStronglyMeasurable (fun x => g x) (Measure.map (fun t => ↑(↑toAddUnits x₀) - t) (Measure.restrict μ (tsupport fun t => ↑(↑L (f t)) (g (x₀ - t))))) [PROOFSTEP] have A : AEStronglyMeasurable (g ∘ v) (μ.restrict (tsupport fun t : G => L (f t) (g (x₀ - t)))) [GOAL] case A 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁹ : NontriviallyNormedField 𝕜 inst✝⁸ : NormedSpace 𝕜 E inst✝⁷ : NormedSpace 𝕜 E' inst✝⁶ : NormedSpace 𝕜 E'' inst✝⁵ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : MeasurableSpace G μ ν : Measure G inst✝³ : AddGroup G inst✝² : TopologicalSpace G inst✝¹ : TopologicalAddGroup G inst✝ : BorelSpace G x₀ : G h : HasCompactSupport fun t => ↑(↑L (f t)) (g (x₀ - t)) hf : LocallyIntegrable f hg : Continuous g u : G ≃ₜ G := Homeomorph.trans (Homeomorph.neg G) (Homeomorph.addRight x₀) v : G ≃ₜ G := Homeomorph.trans (Homeomorph.neg G) (Homeomorph.addLeft x₀) ⊢ AEStronglyMeasurable (g ∘ ↑v) (Measure.restrict μ (tsupport fun t => ↑(↑L (f t)) (g (x₀ - t)))) [PROOFSTEP] apply (hg.comp v.continuous).continuousOn.aestronglyMeasurable_of_isCompact h [GOAL] case A 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁹ : NontriviallyNormedField 𝕜 inst✝⁸ : NormedSpace 𝕜 E inst✝⁷ : NormedSpace 𝕜 E' inst✝⁶ : NormedSpace 𝕜 E'' inst✝⁵ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : MeasurableSpace G μ ν : Measure G inst✝³ : AddGroup G inst✝² : TopologicalSpace G inst✝¹ : TopologicalAddGroup G inst✝ : BorelSpace G x₀ : G h : HasCompactSupport fun t => ↑(↑L (f t)) (g (x₀ - t)) hf : LocallyIntegrable f hg : Continuous g u : G ≃ₜ G := Homeomorph.trans (Homeomorph.neg G) (Homeomorph.addRight x₀) v : G ≃ₜ G := Homeomorph.trans (Homeomorph.neg G) (Homeomorph.addLeft x₀) ⊢ MeasurableSet (tsupport fun t => ↑(↑L (f t)) (g (x₀ - t))) [PROOFSTEP] exact (isClosed_tsupport _).measurableSet [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁹ : NontriviallyNormedField 𝕜 inst✝⁸ : NormedSpace 𝕜 E inst✝⁷ : NormedSpace 𝕜 E' inst✝⁶ : NormedSpace 𝕜 E'' inst✝⁵ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : MeasurableSpace G μ ν : Measure G inst✝³ : AddGroup G inst✝² : TopologicalSpace G inst✝¹ : TopologicalAddGroup G inst✝ : BorelSpace G x₀ : G h : HasCompactSupport fun t => ↑(↑L (f t)) (g (x₀ - t)) hf : LocallyIntegrable f hg : Continuous g u : G ≃ₜ G := Homeomorph.trans (Homeomorph.neg G) (Homeomorph.addRight x₀) v : G ≃ₜ G := Homeomorph.trans (Homeomorph.neg G) (Homeomorph.addLeft x₀) A : AEStronglyMeasurable (g ∘ ↑v) (Measure.restrict μ (tsupport fun t => ↑(↑L (f t)) (g (x₀ - t)))) ⊢ AEStronglyMeasurable (fun x => g x) (Measure.map (fun t => ↑(↑toAddUnits x₀) - t) (Measure.restrict μ (tsupport fun t => ↑(↑L (f t)) (g (x₀ - t))))) [PROOFSTEP] convert ((v.continuous.measurable.measurePreserving (μ.restrict (tsupport fun t => L (f t) (g (x₀ - t))))).aestronglyMeasurable_comp_iff v.toMeasurableEquiv.measurableEmbedding).1 A [GOAL] case h.e'_6.h.e'_5.h.h.e 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁹ : NontriviallyNormedField 𝕜 inst✝⁸ : NormedSpace 𝕜 E inst✝⁷ : NormedSpace 𝕜 E' inst✝⁶ : NormedSpace 𝕜 E'' inst✝⁵ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : MeasurableSpace G μ ν : Measure G inst✝³ : AddGroup G inst✝² : TopologicalSpace G inst✝¹ : TopologicalAddGroup G inst✝ : BorelSpace G x₀ : G h : HasCompactSupport fun t => ↑(↑L (f t)) (g (x₀ - t)) hf : LocallyIntegrable f hg : Continuous g u : G ≃ₜ G := Homeomorph.trans (Homeomorph.neg G) (Homeomorph.addRight x₀) v : G ≃ₜ G := Homeomorph.trans (Homeomorph.neg G) (Homeomorph.addLeft x₀) A : AEStronglyMeasurable (g ∘ ↑v) (Measure.restrict μ (tsupport fun t => ↑(↑L (f t)) (g (x₀ - t)))) x✝ : G ⊢ HSub.hSub ↑(↑toAddUnits x₀) = ↑v [PROOFSTEP] ext x [GOAL] case h.e'_6.h.e'_5.h.h.e.h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝¹ x' : G y y' : E inst✝⁹ : NontriviallyNormedField 𝕜 inst✝⁸ : NormedSpace 𝕜 E inst✝⁷ : NormedSpace 𝕜 E' inst✝⁶ : NormedSpace 𝕜 E'' inst✝⁵ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : MeasurableSpace G μ ν : Measure G inst✝³ : AddGroup G inst✝² : TopologicalSpace G inst✝¹ : TopologicalAddGroup G inst✝ : BorelSpace G x₀ : G h : HasCompactSupport fun t => ↑(↑L (f t)) (g (x₀ - t)) hf : LocallyIntegrable f hg : Continuous g u : G ≃ₜ G := Homeomorph.trans (Homeomorph.neg G) (Homeomorph.addRight x₀) v : G ≃ₜ G := Homeomorph.trans (Homeomorph.neg G) (Homeomorph.addLeft x₀) A : AEStronglyMeasurable (g ∘ ↑v) (Measure.restrict μ (tsupport fun t => ↑(↑L (f t)) (g (x₀ - t)))) x✝ x : G ⊢ ↑(↑toAddUnits x₀) - x = ↑v x [PROOFSTEP] simp only [Homeomorph.neg, sub_eq_add_neg, coe_toAddUnits, Homeomorph.trans_apply, Equiv.neg_apply, Equiv.toFun_as_coe, Homeomorph.homeomorph_mk_coe, Equiv.coe_fn_mk, Homeomorph.coe_addLeft] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁹ : NontriviallyNormedField 𝕜 inst✝⁸ : NormedSpace 𝕜 E inst✝⁷ : NormedSpace 𝕜 E' inst✝⁶ : NormedSpace 𝕜 E'' inst✝⁵ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : MeasurableSpace G μ ν : Measure G inst✝³ : AddGroup G inst✝² : TopologicalSpace G inst✝¹ : TopologicalAddGroup G inst✝ : BorelSpace G hcg : HasCompactSupport g hf : LocallyIntegrable f hg : Continuous g ⊢ ConvolutionExists f g L [PROOFSTEP] intro x₀ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁹ : NontriviallyNormedField 𝕜 inst✝⁸ : NormedSpace 𝕜 E inst✝⁷ : NormedSpace 𝕜 E' inst✝⁶ : NormedSpace 𝕜 E'' inst✝⁵ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : MeasurableSpace G μ ν : Measure G inst✝³ : AddGroup G inst✝² : TopologicalSpace G inst✝¹ : TopologicalAddGroup G inst✝ : BorelSpace G hcg : HasCompactSupport g hf : LocallyIntegrable f hg : Continuous g x₀ : G ⊢ ConvolutionExistsAt f g x₀ L [PROOFSTEP] refine' HasCompactSupport.convolutionExistsAt L _ hf hg [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁹ : NontriviallyNormedField 𝕜 inst✝⁸ : NormedSpace 𝕜 E inst✝⁷ : NormedSpace 𝕜 E' inst✝⁶ : NormedSpace 𝕜 E'' inst✝⁵ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : MeasurableSpace G μ ν : Measure G inst✝³ : AddGroup G inst✝² : TopologicalSpace G inst✝¹ : TopologicalAddGroup G inst✝ : BorelSpace G hcg : HasCompactSupport g hf : LocallyIntegrable f hg : Continuous g x₀ : G ⊢ HasCompactSupport fun t => ↑(↑L (f t)) (g (x₀ - t)) [PROOFSTEP] refine' (hcg.comp_homeomorph (Homeomorph.subLeft x₀)).mono _ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁹ : NontriviallyNormedField 𝕜 inst✝⁸ : NormedSpace 𝕜 E inst✝⁷ : NormedSpace 𝕜 E' inst✝⁶ : NormedSpace 𝕜 E'' inst✝⁵ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : MeasurableSpace G μ ν : Measure G inst✝³ : AddGroup G inst✝² : TopologicalSpace G inst✝¹ : TopologicalAddGroup G inst✝ : BorelSpace G hcg : HasCompactSupport g hf : LocallyIntegrable f hg : Continuous g x₀ : G ⊢ (support fun t => ↑(↑L (f t)) (g (x₀ - t))) ⊆ support (g ∘ ↑(Homeomorph.subLeft x₀)) [PROOFSTEP] refine' fun t => mt fun ht : g (x₀ - t) = 0 => _ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁹ : NontriviallyNormedField 𝕜 inst✝⁸ : NormedSpace 𝕜 E inst✝⁷ : NormedSpace 𝕜 E' inst✝⁶ : NormedSpace 𝕜 E'' inst✝⁵ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : MeasurableSpace G μ ν : Measure G inst✝³ : AddGroup G inst✝² : TopologicalSpace G inst✝¹ : TopologicalAddGroup G inst✝ : BorelSpace G hcg : HasCompactSupport g hf : LocallyIntegrable f hg : Continuous g x₀ t : G ht : g (x₀ - t) = 0 ⊢ (fun t => ↑(↑L (f t)) (g (x₀ - t))) t = 0 [PROOFSTEP] simp_rw [ht, (L _).map_zero] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁹ : NontriviallyNormedField 𝕜 inst✝⁸ : NormedSpace 𝕜 E inst✝⁷ : NormedSpace 𝕜 E' inst✝⁶ : NormedSpace 𝕜 E'' inst✝⁵ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : MeasurableSpace G μ ν : Measure G inst✝³ : AddGroup G inst✝² : TopologicalSpace G inst✝¹ : TopologicalAddGroup G inst✝ : BorelSpace G hcf : HasCompactSupport f hf : LocallyIntegrable f hg : Continuous g ⊢ ConvolutionExists f g L [PROOFSTEP] intro x₀ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁹ : NontriviallyNormedField 𝕜 inst✝⁸ : NormedSpace 𝕜 E inst✝⁷ : NormedSpace 𝕜 E' inst✝⁶ : NormedSpace 𝕜 E'' inst✝⁵ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : MeasurableSpace G μ ν : Measure G inst✝³ : AddGroup G inst✝² : TopologicalSpace G inst✝¹ : TopologicalAddGroup G inst✝ : BorelSpace G hcf : HasCompactSupport f hf : LocallyIntegrable f hg : Continuous g x₀ : G ⊢ ConvolutionExistsAt f g x₀ L [PROOFSTEP] refine' HasCompactSupport.convolutionExistsAt L _ hf hg [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁹ : NontriviallyNormedField 𝕜 inst✝⁸ : NormedSpace 𝕜 E inst✝⁷ : NormedSpace 𝕜 E' inst✝⁶ : NormedSpace 𝕜 E'' inst✝⁵ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : MeasurableSpace G μ ν : Measure G inst✝³ : AddGroup G inst✝² : TopologicalSpace G inst✝¹ : TopologicalAddGroup G inst✝ : BorelSpace G hcf : HasCompactSupport f hf : LocallyIntegrable f hg : Continuous g x₀ : G ⊢ HasCompactSupport fun t => ↑(↑L (f t)) (g (x₀ - t)) [PROOFSTEP] refine' hcf.mono _ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁹ : NontriviallyNormedField 𝕜 inst✝⁸ : NormedSpace 𝕜 E inst✝⁷ : NormedSpace 𝕜 E' inst✝⁶ : NormedSpace 𝕜 E'' inst✝⁵ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : MeasurableSpace G μ ν : Measure G inst✝³ : AddGroup G inst✝² : TopologicalSpace G inst✝¹ : TopologicalAddGroup G inst✝ : BorelSpace G hcf : HasCompactSupport f hf : LocallyIntegrable f hg : Continuous g x₀ : G ⊢ (support fun t => ↑(↑L (f t)) (g (x₀ - t))) ⊆ support f [PROOFSTEP] refine' fun t => mt fun ht : f t = 0 => _ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁹ : NontriviallyNormedField 𝕜 inst✝⁸ : NormedSpace 𝕜 E inst✝⁷ : NormedSpace 𝕜 E' inst✝⁶ : NormedSpace 𝕜 E'' inst✝⁵ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : MeasurableSpace G μ ν : Measure G inst✝³ : AddGroup G inst✝² : TopologicalSpace G inst✝¹ : TopologicalAddGroup G inst✝ : BorelSpace G hcf : HasCompactSupport f hf : LocallyIntegrable f hg : Continuous g x₀ t : G ht : f t = 0 ⊢ (fun t => ↑(↑L (f t)) (g (x₀ - t))) t = 0 [PROOFSTEP] simp_rw [ht, L.map_zero₂] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁴ : NormedAddCommGroup E inst✝¹³ : NormedAddCommGroup E' inst✝¹² : NormedAddCommGroup E'' inst✝¹¹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁰ : NontriviallyNormedField 𝕜 inst✝⁹ : NormedSpace 𝕜 E inst✝⁸ : NormedSpace 𝕜 E' inst✝⁷ : NormedSpace 𝕜 E'' inst✝⁶ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁵ : MeasurableSpace G μ ν : Measure G inst✝⁴ : AddCommGroup G inst✝³ : MeasurableNeg G inst✝² : IsAddLeftInvariant μ inst✝¹ : MeasurableAdd₂ G inst✝ : SigmaFinite μ x₀ : G s : Set G hbg : BddAbove ((fun i => ‖g i‖) '' ((fun t => x₀ - t) ⁻¹' s)) hs : MeasurableSet s h2s : (support fun t => ↑(↑L (f t)) (g (x₀ - t))) ⊆ s hf : IntegrableOn f s hmg : AEStronglyMeasurable g μ ⊢ ConvolutionExistsAt f g x₀ L [PROOFSTEP] refine' BddAbove.convolutionExistsAt' L _ hs h2s hf _ [GOAL] case refine'_1 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁴ : NormedAddCommGroup E inst✝¹³ : NormedAddCommGroup E' inst✝¹² : NormedAddCommGroup E'' inst✝¹¹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁰ : NontriviallyNormedField 𝕜 inst✝⁹ : NormedSpace 𝕜 E inst✝⁸ : NormedSpace 𝕜 E' inst✝⁷ : NormedSpace 𝕜 E'' inst✝⁶ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁵ : MeasurableSpace G μ ν : Measure G inst✝⁴ : AddCommGroup G inst✝³ : MeasurableNeg G inst✝² : IsAddLeftInvariant μ inst✝¹ : MeasurableAdd₂ G inst✝ : SigmaFinite μ x₀ : G s : Set G hbg : BddAbove ((fun i => ‖g i‖) '' ((fun t => x₀ - t) ⁻¹' s)) hs : MeasurableSet s h2s : (support fun t => ↑(↑L (f t)) (g (x₀ - t))) ⊆ s hf : IntegrableOn f s hmg : AEStronglyMeasurable g μ ⊢ BddAbove ((fun i => ‖g i‖) '' ((fun t => -t + x₀) ⁻¹' s)) [PROOFSTEP] simp_rw [← sub_eq_neg_add, hbg] [GOAL] case refine'_2 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁴ : NormedAddCommGroup E inst✝¹³ : NormedAddCommGroup E' inst✝¹² : NormedAddCommGroup E'' inst✝¹¹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁰ : NontriviallyNormedField 𝕜 inst✝⁹ : NormedSpace 𝕜 E inst✝⁸ : NormedSpace 𝕜 E' inst✝⁷ : NormedSpace 𝕜 E'' inst✝⁶ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁵ : MeasurableSpace G μ ν : Measure G inst✝⁴ : AddCommGroup G inst✝³ : MeasurableNeg G inst✝² : IsAddLeftInvariant μ inst✝¹ : MeasurableAdd₂ G inst✝ : SigmaFinite μ x₀ : G s : Set G hbg : BddAbove ((fun i => ‖g i‖) '' ((fun t => x₀ - t) ⁻¹' s)) hs : MeasurableSet s h2s : (support fun t => ↑(↑L (f t)) (g (x₀ - t))) ⊆ s hf : IntegrableOn f s hmg : AEStronglyMeasurable g μ ⊢ AEStronglyMeasurable g (Measure.map (fun t => x₀ - t) (Measure.restrict μ s)) [PROOFSTEP] have : AEStronglyMeasurable g (map (fun t : G => x₀ - t) μ) := hmg.mono' (quasiMeasurePreserving_sub_left_of_right_invariant μ x₀).absolutelyContinuous [GOAL] case refine'_2 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁴ : NormedAddCommGroup E inst✝¹³ : NormedAddCommGroup E' inst✝¹² : NormedAddCommGroup E'' inst✝¹¹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁰ : NontriviallyNormedField 𝕜 inst✝⁹ : NormedSpace 𝕜 E inst✝⁸ : NormedSpace 𝕜 E' inst✝⁷ : NormedSpace 𝕜 E'' inst✝⁶ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁵ : MeasurableSpace G μ ν : Measure G inst✝⁴ : AddCommGroup G inst✝³ : MeasurableNeg G inst✝² : IsAddLeftInvariant μ inst✝¹ : MeasurableAdd₂ G inst✝ : SigmaFinite μ x₀ : G s : Set G hbg : BddAbove ((fun i => ‖g i‖) '' ((fun t => x₀ - t) ⁻¹' s)) hs : MeasurableSet s h2s : (support fun t => ↑(↑L (f t)) (g (x₀ - t))) ⊆ s hf : IntegrableOn f s hmg : AEStronglyMeasurable g μ this : AEStronglyMeasurable g (Measure.map (fun t => x₀ - t) μ) ⊢ AEStronglyMeasurable g (Measure.map (fun t => x₀ - t) (Measure.restrict μ s)) [PROOFSTEP] apply this.mono_measure [GOAL] case refine'_2 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁴ : NormedAddCommGroup E inst✝¹³ : NormedAddCommGroup E' inst✝¹² : NormedAddCommGroup E'' inst✝¹¹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁰ : NontriviallyNormedField 𝕜 inst✝⁹ : NormedSpace 𝕜 E inst✝⁸ : NormedSpace 𝕜 E' inst✝⁷ : NormedSpace 𝕜 E'' inst✝⁶ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁵ : MeasurableSpace G μ ν : Measure G inst✝⁴ : AddCommGroup G inst✝³ : MeasurableNeg G inst✝² : IsAddLeftInvariant μ inst✝¹ : MeasurableAdd₂ G inst✝ : SigmaFinite μ x₀ : G s : Set G hbg : BddAbove ((fun i => ‖g i‖) '' ((fun t => x₀ - t) ⁻¹' s)) hs : MeasurableSet s h2s : (support fun t => ↑(↑L (f t)) (g (x₀ - t))) ⊆ s hf : IntegrableOn f s hmg : AEStronglyMeasurable g μ this : AEStronglyMeasurable g (Measure.map (fun t => x₀ - t) μ) ⊢ Measure.map (fun t => x₀ - t) (Measure.restrict μ s) ≤ Measure.map (fun t => x₀ - t) μ [PROOFSTEP] exact map_mono restrict_le_self (measurable_const.sub measurable_id') [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁴ : NormedAddCommGroup E inst✝¹³ : NormedAddCommGroup E' inst✝¹² : NormedAddCommGroup E'' inst✝¹¹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁰ : NontriviallyNormedField 𝕜 inst✝⁹ : NormedSpace 𝕜 E inst✝⁸ : NormedSpace 𝕜 E' inst✝⁷ : NormedSpace 𝕜 E'' inst✝⁶ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁵ : MeasurableSpace G μ ν : Measure G inst✝⁴ : AddCommGroup G inst✝³ : MeasurableNeg G inst✝² : IsAddLeftInvariant μ inst✝¹ : MeasurableAdd G inst✝ : IsNegInvariant μ ⊢ ConvolutionExistsAt g f x (ContinuousLinearMap.flip L) ↔ ConvolutionExistsAt f g x L [PROOFSTEP] simp_rw [ConvolutionExistsAt, -- porting note: added `(μ := μ)`← integrable_comp_sub_left (μ := μ) (fun t => L (f t) (g (x - t))) x, sub_sub_cancel, flip_apply] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁴ : NormedAddCommGroup E inst✝¹³ : NormedAddCommGroup E' inst✝¹² : NormedAddCommGroup E'' inst✝¹¹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁰ : NontriviallyNormedField 𝕜 inst✝⁹ : NormedSpace 𝕜 E inst✝⁸ : NormedSpace 𝕜 E' inst✝⁷ : NormedSpace 𝕜 E'' inst✝⁶ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁵ : MeasurableSpace G μ ν : Measure G inst✝⁴ : AddCommGroup G inst✝³ : MeasurableNeg G inst✝² : IsAddLeftInvariant μ inst✝¹ : MeasurableAdd G inst✝ : IsNegInvariant μ h : ConvolutionExistsAt f g x L ⊢ Integrable fun t => ↑(↑L (f (x - t))) (g t) [PROOFSTEP] convert h.comp_sub_left x [GOAL] case h.e'_5.h.h.e'_6.h.e'_1 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁴ : NormedAddCommGroup E inst✝¹³ : NormedAddCommGroup E' inst✝¹² : NormedAddCommGroup E'' inst✝¹¹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁰ : NontriviallyNormedField 𝕜 inst✝⁹ : NormedSpace 𝕜 E inst✝⁸ : NormedSpace 𝕜 E' inst✝⁷ : NormedSpace 𝕜 E'' inst✝⁶ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁵ : MeasurableSpace G μ ν : Measure G inst✝⁴ : AddCommGroup G inst✝³ : MeasurableNeg G inst✝² : IsAddLeftInvariant μ inst✝¹ : MeasurableAdd G inst✝ : IsNegInvariant μ h : ConvolutionExistsAt f g x L x✝ : G ⊢ x✝ = x - (x - x✝) [PROOFSTEP] simp_rw [sub_sub_self] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y✝ y' : E inst✝⁹ : NontriviallyNormedField 𝕜 inst✝⁸ : NormedSpace 𝕜 E inst✝⁷ : NormedSpace 𝕜 E' inst✝⁶ : NormedSpace 𝕜 E'' inst✝⁵ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : MeasurableSpace G μ ν : Measure G inst✝³ : NormedSpace ℝ F inst✝² : CompleteSpace F inst✝¹ : AddGroup G inst✝ : SMulCommClass ℝ 𝕜 F y : 𝕜 ⊢ convolution (y • f) g L = y • convolution f g L [PROOFSTEP] ext [GOAL] case h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y✝ y' : E inst✝⁹ : NontriviallyNormedField 𝕜 inst✝⁸ : NormedSpace 𝕜 E inst✝⁷ : NormedSpace 𝕜 E' inst✝⁶ : NormedSpace 𝕜 E'' inst✝⁵ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : MeasurableSpace G μ ν : Measure G inst✝³ : NormedSpace ℝ F inst✝² : CompleteSpace F inst✝¹ : AddGroup G inst✝ : SMulCommClass ℝ 𝕜 F y : 𝕜 x✝ : G ⊢ y • f ⋆[L, x✝] g = (y • convolution f g L) x✝ [PROOFSTEP] simp only [Pi.smul_apply, convolution_def, ← integral_smul, L.map_smul₂] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y✝ y' : E inst✝⁹ : NontriviallyNormedField 𝕜 inst✝⁸ : NormedSpace 𝕜 E inst✝⁷ : NormedSpace 𝕜 E' inst✝⁶ : NormedSpace 𝕜 E'' inst✝⁵ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : MeasurableSpace G μ ν : Measure G inst✝³ : NormedSpace ℝ F inst✝² : CompleteSpace F inst✝¹ : AddGroup G inst✝ : SMulCommClass ℝ 𝕜 F y : 𝕜 ⊢ convolution f (y • g) L = y • convolution f g L [PROOFSTEP] ext [GOAL] case h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y✝ y' : E inst✝⁹ : NontriviallyNormedField 𝕜 inst✝⁸ : NormedSpace 𝕜 E inst✝⁷ : NormedSpace 𝕜 E' inst✝⁶ : NormedSpace 𝕜 E'' inst✝⁵ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : MeasurableSpace G μ ν : Measure G inst✝³ : NormedSpace ℝ F inst✝² : CompleteSpace F inst✝¹ : AddGroup G inst✝ : SMulCommClass ℝ 𝕜 F y : 𝕜 x✝ : G ⊢ f ⋆[L, x✝] y • g = (y • convolution f g L) x✝ [PROOFSTEP] simp only [Pi.smul_apply, convolution_def, ← integral_smul, (L _).map_smul] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G ⊢ convolution 0 g L = 0 [PROOFSTEP] ext [GOAL] case h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G x✝ : G ⊢ 0 ⋆[L, x✝] g = OfNat.ofNat 0 x✝ [PROOFSTEP] simp_rw [convolution_def, Pi.zero_apply, L.map_zero₂, integral_zero] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G ⊢ convolution f 0 L = 0 [PROOFSTEP] ext [GOAL] case h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G x✝ : G ⊢ f ⋆[L, x✝] 0 = OfNat.ofNat 0 x✝ [PROOFSTEP] simp_rw [convolution_def, Pi.zero_apply, (L _).map_zero, integral_zero] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G x : G hfg : ConvolutionExistsAt f g x L hfg' : ConvolutionExistsAt f g' x L ⊢ f ⋆[L, x] (g + g') = f ⋆[L, x] g + f ⋆[L, x] g' [PROOFSTEP] simp only [convolution_def, (L _).map_add, Pi.add_apply, integral_add hfg hfg'] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G hfg : ConvolutionExists f g L hfg' : ConvolutionExists f g' L ⊢ convolution f (g + g') L = convolution f g L + convolution f g' L [PROOFSTEP] ext x [GOAL] case h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G hfg : ConvolutionExists f g L hfg' : ConvolutionExists f g' L x : G ⊢ f ⋆[L, x] (g + g') = (convolution f g L + convolution f g' L) x [PROOFSTEP] exact (hfg x).distrib_add (hfg' x) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G x : G hfg : ConvolutionExistsAt f g x L hfg' : ConvolutionExistsAt f' g x L ⊢ (f + f') ⋆[L, x] g = f ⋆[L, x] g + f' ⋆[L, x] g [PROOFSTEP] simp only [convolution_def, L.map_add₂, Pi.add_apply, integral_add hfg hfg'] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G hfg : ConvolutionExists f g L hfg' : ConvolutionExists f' g L ⊢ convolution (f + f') g L = convolution f g L + convolution f' g L [PROOFSTEP] ext x [GOAL] case h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G hfg : ConvolutionExists f g L hfg' : ConvolutionExists f' g L x : G ⊢ (f + f') ⋆[L, x] g = (convolution f g L + convolution f' g L) x [PROOFSTEP] exact (hfg x).add_distrib (hfg' x) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f✝ f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G f g g' : G → ℝ hfg : ConvolutionExistsAt f g x (lsmul ℝ ℝ) hfg' : ConvolutionExistsAt f g' x (lsmul ℝ ℝ) hf : ∀ (x : G), 0 ≤ f x hg : ∀ (x : G), g x ≤ g' x ⊢ f ⋆[lsmul ℝ ℝ, x] g ≤ f ⋆[lsmul ℝ ℝ, x] g' [PROOFSTEP] apply integral_mono hfg hfg' [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f✝ f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G f g g' : G → ℝ hfg : ConvolutionExistsAt f g x (lsmul ℝ ℝ) hfg' : ConvolutionExistsAt f g' x (lsmul ℝ ℝ) hf : ∀ (x : G), 0 ≤ f x hg : ∀ (x : G), g x ≤ g' x ⊢ (fun t => ↑(↑(lsmul ℝ ℝ) (f t)) (g (x - t))) ≤ fun t => ↑(↑(lsmul ℝ ℝ) (f t)) (g' (x - t)) [PROOFSTEP] simp only [lsmul_apply, Algebra.id.smul_eq_mul] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f✝ f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G f g g' : G → ℝ hfg : ConvolutionExistsAt f g x (lsmul ℝ ℝ) hfg' : ConvolutionExistsAt f g' x (lsmul ℝ ℝ) hf : ∀ (x : G), 0 ≤ f x hg : ∀ (x : G), g x ≤ g' x ⊢ (fun t => f t * g (x - t)) ≤ fun t => f t * g' (x - t) [PROOFSTEP] intro t [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f✝ f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G f g g' : G → ℝ hfg : ConvolutionExistsAt f g x (lsmul ℝ ℝ) hfg' : ConvolutionExistsAt f g' x (lsmul ℝ ℝ) hf : ∀ (x : G), 0 ≤ f x hg : ∀ (x : G), g x ≤ g' x t : G ⊢ (fun t => f t * g (x - t)) t ≤ (fun t => f t * g' (x - t)) t [PROOFSTEP] apply mul_le_mul_of_nonneg_left (hg _) (hf _) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f✝ f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G f g g' : G → ℝ hfg' : ConvolutionExistsAt f g' x (lsmul ℝ ℝ) hf : ∀ (x : G), 0 ≤ f x hg : ∀ (x : G), g x ≤ g' x hg' : ∀ (x : G), 0 ≤ g' x ⊢ f ⋆[lsmul ℝ ℝ, x] g ≤ f ⋆[lsmul ℝ ℝ, x] g' [PROOFSTEP] by_cases H : ConvolutionExistsAt f g x (lsmul ℝ ℝ) μ [GOAL] case pos 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f✝ f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G f g g' : G → ℝ hfg' : ConvolutionExistsAt f g' x (lsmul ℝ ℝ) hf : ∀ (x : G), 0 ≤ f x hg : ∀ (x : G), g x ≤ g' x hg' : ∀ (x : G), 0 ≤ g' x H : ConvolutionExistsAt f g x (lsmul ℝ ℝ) ⊢ f ⋆[lsmul ℝ ℝ, x] g ≤ f ⋆[lsmul ℝ ℝ, x] g' [PROOFSTEP] exact convolution_mono_right H hfg' hf hg [GOAL] case neg 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f✝ f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G f g g' : G → ℝ hfg' : ConvolutionExistsAt f g' x (lsmul ℝ ℝ) hf : ∀ (x : G), 0 ≤ f x hg : ∀ (x : G), g x ≤ g' x hg' : ∀ (x : G), 0 ≤ g' x H : ¬ConvolutionExistsAt f g x (lsmul ℝ ℝ) ⊢ f ⋆[lsmul ℝ ℝ, x] g ≤ f ⋆[lsmul ℝ ℝ, x] g' [PROOFSTEP] have : (f ⋆[lsmul ℝ ℝ, μ] g) x = 0 := integral_undef H [GOAL] case neg 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f✝ f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G f g g' : G → ℝ hfg' : ConvolutionExistsAt f g' x (lsmul ℝ ℝ) hf : ∀ (x : G), 0 ≤ f x hg : ∀ (x : G), g x ≤ g' x hg' : ∀ (x : G), 0 ≤ g' x H : ¬ConvolutionExistsAt f g x (lsmul ℝ ℝ) this : f ⋆[lsmul ℝ ℝ, x] g = 0 ⊢ f ⋆[lsmul ℝ ℝ, x] g ≤ f ⋆[lsmul ℝ ℝ, x] g' [PROOFSTEP] rw [this] [GOAL] case neg 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f✝ f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G f g g' : G → ℝ hfg' : ConvolutionExistsAt f g' x (lsmul ℝ ℝ) hf : ∀ (x : G), 0 ≤ f x hg : ∀ (x : G), g x ≤ g' x hg' : ∀ (x : G), 0 ≤ g' x H : ¬ConvolutionExistsAt f g x (lsmul ℝ ℝ) this : f ⋆[lsmul ℝ ℝ, x] g = 0 ⊢ 0 ≤ f ⋆[lsmul ℝ ℝ, x] g' [PROOFSTEP] exact integral_nonneg fun y => mul_nonneg (hf y) (hg' (x - y)) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : AddGroup G inst✝³ : MeasurableAdd₂ G inst✝² : MeasurableNeg G inst✝¹ : SigmaFinite μ inst✝ : IsAddRightInvariant μ h1 : f =ᶠ[ae μ] f' h2 : g =ᶠ[ae μ] g' ⊢ convolution f g L = convolution f' g' L [PROOFSTEP] ext x [GOAL] case h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : AddGroup G inst✝³ : MeasurableAdd₂ G inst✝² : MeasurableNeg G inst✝¹ : SigmaFinite μ inst✝ : IsAddRightInvariant μ h1 : f =ᶠ[ae μ] f' h2 : g =ᶠ[ae μ] g' x : G ⊢ f ⋆[L, x] g = f' ⋆[L, x] g' [PROOFSTEP] apply integral_congr_ae [GOAL] case h.h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : AddGroup G inst✝³ : MeasurableAdd₂ G inst✝² : MeasurableNeg G inst✝¹ : SigmaFinite μ inst✝ : IsAddRightInvariant μ h1 : f =ᶠ[ae μ] f' h2 : g =ᶠ[ae μ] g' x : G ⊢ (fun a => ↑(↑L (f a)) (g (x - a))) =ᶠ[ae μ] fun a => ↑(↑L (f' a)) (g' (x - a)) [PROOFSTEP] exact (h1.prod_mk <| h2.comp_tendsto (quasiMeasurePreserving_sub_left_of_right_invariant μ x).tendsto_ae).fun_comp ↿fun x y => L x y [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G ⊢ support (convolution f g L) ⊆ support g + support f [PROOFSTEP] intro x h2x [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G x : G h2x : x ∈ support (convolution f g L) ⊢ x ∈ support g + support f [PROOFSTEP] by_contra hx [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G x : G h2x : x ∈ support (convolution f g L) hx : ¬x ∈ support g + support f ⊢ False [PROOFSTEP] apply h2x [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G x : G h2x : x ∈ support (convolution f g L) hx : ¬x ∈ support g + support f ⊢ f ⋆[L, x] g = 0 [PROOFSTEP] simp_rw [Set.mem_add, not_exists, not_and_or, nmem_support] at hx [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G x : G h2x : x ∈ support (convolution f g L) hx : ∀ (x_1 x_2 : G), g x_1 = 0 ∨ f x_2 = 0 ∨ ¬x_1 + x_2 = x ⊢ f ⋆[L, x] g = 0 [PROOFSTEP] rw [convolution_def] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G x : G h2x : x ∈ support (convolution f g L) hx : ∀ (x_1 x_2 : G), g x_1 = 0 ∨ f x_2 = 0 ∨ ¬x_1 + x_2 = x ⊢ ∫ (t : G), ↑(↑L (f t)) (g (x - t)) ∂μ = 0 [PROOFSTEP] convert integral_zero G F using 2 [GOAL] case h.e'_2.h.e'_7 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G x : G h2x : x ∈ support (convolution f g L) hx : ∀ (x_1 x_2 : G), g x_1 = 0 ∨ f x_2 = 0 ∨ ¬x_1 + x_2 = x ⊢ (fun t => ↑(↑L (f t)) (g (x - t))) = fun x => 0 [PROOFSTEP] ext t [GOAL] case h.e'_2.h.e'_7.h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G x : G h2x : x ∈ support (convolution f g L) hx : ∀ (x_1 x_2 : G), g x_1 = 0 ∨ f x_2 = 0 ∨ ¬x_1 + x_2 = x t : G ⊢ ↑(↑L (f t)) (g (x - t)) = 0 [PROOFSTEP] rcases hx (x - t) t with (h | h | h) [GOAL] case h.e'_2.h.e'_7.h.inl 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G x : G h2x : x ∈ support (convolution f g L) hx : ∀ (x_1 x_2 : G), g x_1 = 0 ∨ f x_2 = 0 ∨ ¬x_1 + x_2 = x t : G h : g (x - t) = 0 ⊢ ↑(↑L (f t)) (g (x - t)) = 0 [PROOFSTEP] rw [h, (L _).map_zero] [GOAL] case h.e'_2.h.e'_7.h.inr.inl 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G x : G h2x : x ∈ support (convolution f g L) hx : ∀ (x_1 x_2 : G), g x_1 = 0 ∨ f x_2 = 0 ∨ ¬x_1 + x_2 = x t : G h : f t = 0 ⊢ ↑(↑L (f t)) (g (x - t)) = 0 [PROOFSTEP] rw [h, L.map_zero₂] [GOAL] case h.e'_2.h.e'_7.h.inr.inr 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : AddGroup G x : G h2x : x ∈ support (convolution f g L) hx : ∀ (x_1 x_2 : G), g x_1 = 0 ∨ f x_2 = 0 ∨ ¬x_1 + x_2 = x t : G h : ¬x - t + t = x ⊢ ↑(↑L (f t)) (g (x - t)) = 0 [PROOFSTEP] exact (h <| sub_add_cancel x t).elim [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) ⊢ ContinuousOn (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] intro q₀ hq₀ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀ ∈ s ×ˢ univ ⊢ ContinuousWithinAt (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) q₀ [PROOFSTEP] replace hq₀ : q₀.1 ∈ s [GOAL] case hq₀ 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀ ∈ s ×ˢ univ ⊢ q₀.fst ∈ s [PROOFSTEP] simpa only [mem_prod, mem_univ, and_true] using hq₀ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s ⊢ ContinuousWithinAt (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) q₀ [PROOFSTEP] have A : ∀ p ∈ s, Continuous (g p) := fun p hp ↦ by refine hg.comp_continuous (continuous_const.prod_mk continuous_id') fun x => ?_ simpa only [prod_mk_mem_set_prod_eq, mem_univ, and_true] using hp [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s p : P hp : p ∈ s ⊢ Continuous (g p) [PROOFSTEP] refine hg.comp_continuous (continuous_const.prod_mk continuous_id') fun x => ?_ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s p : P hp : p ∈ s x : G ⊢ (p, x) ∈ s ×ˢ univ [PROOFSTEP] simpa only [prod_mk_mem_set_prod_eq, mem_univ, and_true] using hp [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) ⊢ ContinuousWithinAt (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) q₀ [PROOFSTEP] have B : ∀ p ∈ s, tsupport (g p) ⊆ k := fun p hp => closure_minimal (support_subset_iff'.2 fun z hz => hgs _ _ hp hz) h'k [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k ⊢ ContinuousWithinAt (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) q₀ [PROOFSTEP] obtain ⟨w, C, w_open, q₀w, hw⟩ : ∃ w C, IsOpen w ∧ q₀.1 ∈ w ∧ ∀ p x, p ∈ w ∩ s → ‖g p x‖ ≤ C := by have A : IsCompact ({q₀.1} ×ˢ k) := isCompact_singleton.prod hk obtain ⟨t, kt, t_open, ht⟩ : ∃ t, {q₀.1} ×ˢ k ⊆ t ∧ IsOpen t ∧ Bounded (↿g '' (t ∩ s ×ˢ univ)) := by apply exists_isOpen_bounded_image_inter_of_isCompact_of_continuousOn A _ hg simp only [prod_subset_prod_iff, hq₀, singleton_subset_iff, subset_univ, and_self_iff, true_or_iff] obtain ⟨C, Cpos, hC⟩ : ∃ C, 0 < C ∧ ↿g '' (t ∩ s ×ˢ univ) ⊆ closedBall (0 : E') C := ht.subset_ball_lt 0 0 obtain ⟨w, w_open, q₀w, hw⟩ : ∃ w, IsOpen w ∧ q₀.1 ∈ w ∧ w ×ˢ k ⊆ t · obtain ⟨w, v, w_open, -, hw, hv, hvw⟩ : ∃ (w : Set P) (v : Set G), IsOpen w ∧ IsOpen v ∧ { q₀.fst } ⊆ w ∧ k ⊆ v ∧ w ×ˢ v ⊆ t exact generalized_tube_lemma isCompact_singleton hk t_open kt exact ⟨w, w_open, singleton_subset_iff.1 hw, Subset.trans (Set.prod_mono Subset.rfl hv) hvw⟩ refine' ⟨w, C, w_open, q₀w, _⟩ rintro p x ⟨hp, hps⟩ by_cases hx : x ∈ k · have H : (p, x) ∈ t := by apply hw simp only [prod_mk_mem_set_prod_eq, hp, hx, and_true_iff] have H' : (p, x) ∈ (s ×ˢ univ : Set (P × G)) := by simpa only [prod_mk_mem_set_prod_eq, mem_univ, and_true_iff] using hps have : g p x ∈ closedBall (0 : E') C := hC (mem_image_of_mem _ (mem_inter H H')) rwa [mem_closedBall_zero_iff] at this · have : g p x = 0 := hgs _ _ hps hx rw [this] simpa only [norm_zero] using Cpos.le [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k ⊢ ∃ w C, IsOpen w ∧ q₀.fst ∈ w ∧ ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C [PROOFSTEP] have A : IsCompact ({q₀.1} ×ˢ k) := isCompact_singleton.prod hk [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A✝ : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k A : IsCompact ({q₀.fst} ×ˢ k) ⊢ ∃ w C, IsOpen w ∧ q₀.fst ∈ w ∧ ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C [PROOFSTEP] obtain ⟨t, kt, t_open, ht⟩ : ∃ t, {q₀.1} ×ˢ k ⊆ t ∧ IsOpen t ∧ Bounded (↿g '' (t ∩ s ×ˢ univ)) := by apply exists_isOpen_bounded_image_inter_of_isCompact_of_continuousOn A _ hg simp only [prod_subset_prod_iff, hq₀, singleton_subset_iff, subset_univ, and_self_iff, true_or_iff] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A✝ : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k A : IsCompact ({q₀.fst} ×ˢ k) ⊢ ∃ t, {q₀.fst} ×ˢ k ⊆ t ∧ IsOpen t ∧ Metric.Bounded (↿g '' (t ∩ s ×ˢ univ)) [PROOFSTEP] apply exists_isOpen_bounded_image_inter_of_isCompact_of_continuousOn A _ hg [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A✝ : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k A : IsCompact ({q₀.fst} ×ˢ k) ⊢ {q₀.fst} ×ˢ k ⊆ s ×ˢ univ [PROOFSTEP] simp only [prod_subset_prod_iff, hq₀, singleton_subset_iff, subset_univ, and_self_iff, true_or_iff] [GOAL] case intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A✝ : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (↿g '' (t ∩ s ×ˢ univ)) ⊢ ∃ w C, IsOpen w ∧ q₀.fst ∈ w ∧ ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C [PROOFSTEP] obtain ⟨C, Cpos, hC⟩ : ∃ C, 0 < C ∧ ↿g '' (t ∩ s ×ˢ univ) ⊆ closedBall (0 : E') C := ht.subset_ball_lt 0 0 [GOAL] case intro.intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A✝ : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (↿g '' (t ∩ s ×ˢ univ)) C : ℝ Cpos : 0 < C hC : ↿g '' (t ∩ s ×ˢ univ) ⊆ closedBall 0 C ⊢ ∃ w C, IsOpen w ∧ q₀.fst ∈ w ∧ ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C [PROOFSTEP] obtain ⟨w, w_open, q₀w, hw⟩ : ∃ w, IsOpen w ∧ q₀.1 ∈ w ∧ w ×ˢ k ⊆ t [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A✝ : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (↿g '' (t ∩ s ×ˢ univ)) C : ℝ Cpos : 0 < C hC : ↿g '' (t ∩ s ×ˢ univ) ⊆ closedBall 0 C ⊢ ∃ w, IsOpen w ∧ q₀.fst ∈ w ∧ w ×ˢ k ⊆ t [PROOFSTEP] obtain ⟨w, v, w_open, -, hw, hv, hvw⟩ : ∃ (w : Set P) (v : Set G), IsOpen w ∧ IsOpen v ∧ { q₀.fst } ⊆ w ∧ k ⊆ v ∧ w ×ˢ v ⊆ t [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A✝ : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (↿g '' (t ∩ s ×ˢ univ)) C : ℝ Cpos : 0 < C hC : ↿g '' (t ∩ s ×ˢ univ) ⊆ closedBall 0 C ⊢ ∃ w v, IsOpen w ∧ IsOpen v ∧ {q₀.fst} ⊆ w ∧ k ⊆ v ∧ w ×ˢ v ⊆ t case intro.intro.intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A✝ : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (↿g '' (t ∩ s ×ˢ univ)) C : ℝ Cpos : 0 < C hC : ↿g '' (t ∩ s ×ˢ univ) ⊆ closedBall 0 C w : Set P v : Set G w_open : IsOpen w hw : {q₀.fst} ⊆ w hv : k ⊆ v hvw : w ×ˢ v ⊆ t ⊢ ∃ w, IsOpen w ∧ q₀.fst ∈ w ∧ w ×ˢ k ⊆ t [PROOFSTEP] exact generalized_tube_lemma isCompact_singleton hk t_open kt [GOAL] case intro.intro.intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A✝ : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (↿g '' (t ∩ s ×ˢ univ)) C : ℝ Cpos : 0 < C hC : ↿g '' (t ∩ s ×ˢ univ) ⊆ closedBall 0 C w : Set P v : Set G w_open : IsOpen w hw : {q₀.fst} ⊆ w hv : k ⊆ v hvw : w ×ˢ v ⊆ t ⊢ ∃ w, IsOpen w ∧ q₀.fst ∈ w ∧ w ×ˢ k ⊆ t [PROOFSTEP] exact ⟨w, w_open, singleton_subset_iff.1 hw, Subset.trans (Set.prod_mono Subset.rfl hv) hvw⟩ [GOAL] case intro.intro.intro.intro.intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A✝ : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (↿g '' (t ∩ s ×ˢ univ)) C : ℝ Cpos : 0 < C hC : ↿g '' (t ∩ s ×ˢ univ) ⊆ closedBall 0 C w : Set P w_open : IsOpen w q₀w : q₀.fst ∈ w hw : w ×ˢ k ⊆ t ⊢ ∃ w C, IsOpen w ∧ q₀.fst ∈ w ∧ ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C [PROOFSTEP] refine' ⟨w, C, w_open, q₀w, _⟩ [GOAL] case intro.intro.intro.intro.intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A✝ : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (↿g '' (t ∩ s ×ˢ univ)) C : ℝ Cpos : 0 < C hC : ↿g '' (t ∩ s ×ˢ univ) ⊆ closedBall 0 C w : Set P w_open : IsOpen w q₀w : q₀.fst ∈ w hw : w ×ˢ k ⊆ t ⊢ ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C [PROOFSTEP] rintro p x ⟨hp, hps⟩ [GOAL] case intro.intro.intro.intro.intro.intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A✝ : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (↿g '' (t ∩ s ×ˢ univ)) C : ℝ Cpos : 0 < C hC : ↿g '' (t ∩ s ×ˢ univ) ⊆ closedBall 0 C w : Set P w_open : IsOpen w q₀w : q₀.fst ∈ w hw : w ×ˢ k ⊆ t p : P x : G hp : p ∈ w hps : p ∈ s ⊢ ‖g p x‖ ≤ C [PROOFSTEP] by_cases hx : x ∈ k [GOAL] case pos 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A✝ : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (↿g '' (t ∩ s ×ˢ univ)) C : ℝ Cpos : 0 < C hC : ↿g '' (t ∩ s ×ˢ univ) ⊆ closedBall 0 C w : Set P w_open : IsOpen w q₀w : q₀.fst ∈ w hw : w ×ˢ k ⊆ t p : P x : G hp : p ∈ w hps : p ∈ s hx : x ∈ k ⊢ ‖g p x‖ ≤ C [PROOFSTEP] have H : (p, x) ∈ t := by apply hw simp only [prod_mk_mem_set_prod_eq, hp, hx, and_true_iff] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A✝ : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (↿g '' (t ∩ s ×ˢ univ)) C : ℝ Cpos : 0 < C hC : ↿g '' (t ∩ s ×ˢ univ) ⊆ closedBall 0 C w : Set P w_open : IsOpen w q₀w : q₀.fst ∈ w hw : w ×ˢ k ⊆ t p : P x : G hp : p ∈ w hps : p ∈ s hx : x ∈ k ⊢ (p, x) ∈ t [PROOFSTEP] apply hw [GOAL] case a 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A✝ : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (↿g '' (t ∩ s ×ˢ univ)) C : ℝ Cpos : 0 < C hC : ↿g '' (t ∩ s ×ˢ univ) ⊆ closedBall 0 C w : Set P w_open : IsOpen w q₀w : q₀.fst ∈ w hw : w ×ˢ k ⊆ t p : P x : G hp : p ∈ w hps : p ∈ s hx : x ∈ k ⊢ (p, x) ∈ w ×ˢ k [PROOFSTEP] simp only [prod_mk_mem_set_prod_eq, hp, hx, and_true_iff] [GOAL] case pos 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A✝ : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (↿g '' (t ∩ s ×ˢ univ)) C : ℝ Cpos : 0 < C hC : ↿g '' (t ∩ s ×ˢ univ) ⊆ closedBall 0 C w : Set P w_open : IsOpen w q₀w : q₀.fst ∈ w hw : w ×ˢ k ⊆ t p : P x : G hp : p ∈ w hps : p ∈ s hx : x ∈ k H : (p, x) ∈ t ⊢ ‖g p x‖ ≤ C [PROOFSTEP] have H' : (p, x) ∈ (s ×ˢ univ : Set (P × G)) := by simpa only [prod_mk_mem_set_prod_eq, mem_univ, and_true_iff] using hps [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A✝ : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (↿g '' (t ∩ s ×ˢ univ)) C : ℝ Cpos : 0 < C hC : ↿g '' (t ∩ s ×ˢ univ) ⊆ closedBall 0 C w : Set P w_open : IsOpen w q₀w : q₀.fst ∈ w hw : w ×ˢ k ⊆ t p : P x : G hp : p ∈ w hps : p ∈ s hx : x ∈ k H : (p, x) ∈ t ⊢ (p, x) ∈ s ×ˢ univ [PROOFSTEP] simpa only [prod_mk_mem_set_prod_eq, mem_univ, and_true_iff] using hps [GOAL] case pos 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A✝ : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (↿g '' (t ∩ s ×ˢ univ)) C : ℝ Cpos : 0 < C hC : ↿g '' (t ∩ s ×ˢ univ) ⊆ closedBall 0 C w : Set P w_open : IsOpen w q₀w : q₀.fst ∈ w hw : w ×ˢ k ⊆ t p : P x : G hp : p ∈ w hps : p ∈ s hx : x ∈ k H : (p, x) ∈ t H' : (p, x) ∈ s ×ˢ univ ⊢ ‖g p x‖ ≤ C [PROOFSTEP] have : g p x ∈ closedBall (0 : E') C := hC (mem_image_of_mem _ (mem_inter H H')) [GOAL] case pos 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A✝ : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (↿g '' (t ∩ s ×ˢ univ)) C : ℝ Cpos : 0 < C hC : ↿g '' (t ∩ s ×ˢ univ) ⊆ closedBall 0 C w : Set P w_open : IsOpen w q₀w : q₀.fst ∈ w hw : w ×ˢ k ⊆ t p : P x : G hp : p ∈ w hps : p ∈ s hx : x ∈ k H : (p, x) ∈ t H' : (p, x) ∈ s ×ˢ univ this : g p x ∈ closedBall 0 C ⊢ ‖g p x‖ ≤ C [PROOFSTEP] rwa [mem_closedBall_zero_iff] at this [GOAL] case neg 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A✝ : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (↿g '' (t ∩ s ×ˢ univ)) C : ℝ Cpos : 0 < C hC : ↿g '' (t ∩ s ×ˢ univ) ⊆ closedBall 0 C w : Set P w_open : IsOpen w q₀w : q₀.fst ∈ w hw : w ×ˢ k ⊆ t p : P x : G hp : p ∈ w hps : p ∈ s hx : ¬x ∈ k ⊢ ‖g p x‖ ≤ C [PROOFSTEP] have : g p x = 0 := hgs _ _ hps hx [GOAL] case neg 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A✝ : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (↿g '' (t ∩ s ×ˢ univ)) C : ℝ Cpos : 0 < C hC : ↿g '' (t ∩ s ×ˢ univ) ⊆ closedBall 0 C w : Set P w_open : IsOpen w q₀w : q₀.fst ∈ w hw : w ×ˢ k ⊆ t p : P x : G hp : p ∈ w hps : p ∈ s hx : ¬x ∈ k this : g p x = 0 ⊢ ‖g p x‖ ≤ C [PROOFSTEP] rw [this] [GOAL] case neg 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A✝ : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (↿g '' (t ∩ s ×ˢ univ)) C : ℝ Cpos : 0 < C hC : ↿g '' (t ∩ s ×ˢ univ) ⊆ closedBall 0 C w : Set P w_open : IsOpen w q₀w : q₀.fst ∈ w hw : w ×ˢ k ⊆ t p : P x : G hp : p ∈ w hps : p ∈ s hx : ¬x ∈ k this : g p x = 0 ⊢ ‖0‖ ≤ C [PROOFSTEP] simpa only [norm_zero] using Cpos.le [GOAL] case intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C ⊢ ContinuousWithinAt (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) q₀ [PROOFSTEP] have I1 : ∀ᶠ q : P × G in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a : G => L (f a) (g q.1 (q.2 - a))) μ := by filter_upwards [self_mem_nhdsWithin] rintro ⟨p, x⟩ ⟨hp, -⟩ refine' (HasCompactSupport.convolutionExists_right L _ hf (A _ hp) _).1 exact isCompact_of_isClosed_subset hk (isClosed_tsupport _) (B p hp) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C ⊢ ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ [PROOFSTEP] filter_upwards [self_mem_nhdsWithin] [GOAL] case h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C ⊢ ∀ (a : P × G), a ∈ s ×ˢ univ → AEStronglyMeasurable (fun a_2 => ↑(↑L (f a_2)) (g a.fst (a.snd - a_2))) μ [PROOFSTEP] rintro ⟨p, x⟩ ⟨hp, -⟩ [GOAL] case h.mk.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C p : P x : G hp : (p, x).fst ∈ s ⊢ AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g (p, x).fst ((p, x).snd - a))) μ [PROOFSTEP] refine' (HasCompactSupport.convolutionExists_right L _ hf (A _ hp) _).1 [GOAL] case h.mk.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C p : P x : G hp : (p, x).fst ∈ s ⊢ HasCompactSupport (g (p, x).fst) [PROOFSTEP] exact isCompact_of_isClosed_subset hk (isClosed_tsupport _) (B p hp) [GOAL] case intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ ⊢ ContinuousWithinAt (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) q₀ [PROOFSTEP] let K' := -k + {q₀.2} [GOAL] case intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} ⊢ ContinuousWithinAt (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) q₀ [PROOFSTEP] have hK' : IsCompact K' := hk.neg.add isCompact_singleton [GOAL] case intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' ⊢ ContinuousWithinAt (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) q₀ [PROOFSTEP] obtain ⟨U, U_open, K'U, hU⟩ : ∃ U, IsOpen U ∧ K' ⊆ U ∧ IntegrableOn f U μ := hf.integrableOn_nhds_isCompact hK' [GOAL] case intro.intro.intro.intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U ⊢ ContinuousWithinAt (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) q₀ [PROOFSTEP] let bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C [GOAL] case intro.intro.intro.intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C ⊢ ContinuousWithinAt (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) q₀ [PROOFSTEP] have I2 : ∀ᶠ q : P × G in 𝓝[s ×ˢ univ] q₀, ∀ᵐ a ∂μ, ‖L (f a) (g q.1 (q.2 - a))‖ ≤ bound a := by obtain ⟨V, V_mem, hV⟩ : ∃ V ∈ 𝓝 (0 : G), K' + V ⊆ U := compact_open_separated_add_right hK' U_open K'U have : ((w ∩ s) ×ˢ ({q₀.2} + V) : Set (P × G)) ∈ 𝓝[s ×ˢ univ] q₀ := by conv_rhs => rw [← @Prod.mk.eta _ _ q₀, nhdsWithin_prod_eq, nhdsWithin_univ] refine' Filter.prod_mem_prod _ (singleton_add_mem_nhds_of_nhds_zero q₀.2 V_mem) exact mem_nhdsWithin_iff_exists_mem_nhds_inter.2 ⟨w, w_open.mem_nhds q₀w, Subset.rfl⟩ filter_upwards [this] rintro ⟨p, x⟩ hpx simp only [prod_mk_mem_set_prod_eq] at hpx refine eventually_of_forall fun a => ?_ apply convolution_integrand_bound_right_of_le_of_subset _ _ hpx.2 _ · intro x exact hw _ _ hpx.1 · rw [← add_assoc] apply Subset.trans (add_subset_add_right (add_subset_add_right _)) hV rw [neg_subset_neg] exact B p hpx.1.2 [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C ⊢ ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, ∀ᵐ (a : G) ∂μ, ‖↑(↑L (f a)) (g q.fst (q.snd - a))‖ ≤ bound a [PROOFSTEP] obtain ⟨V, V_mem, hV⟩ : ∃ V ∈ 𝓝 (0 : G), K' + V ⊆ U := compact_open_separated_add_right hK' U_open K'U [GOAL] case intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C V : Set G V_mem : V ∈ 𝓝 0 hV : K' + V ⊆ U ⊢ ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, ∀ᵐ (a : G) ∂μ, ‖↑(↑L (f a)) (g q.fst (q.snd - a))‖ ≤ bound a [PROOFSTEP] have : ((w ∩ s) ×ˢ ({q₀.2} + V) : Set (P × G)) ∈ 𝓝[s ×ˢ univ] q₀ := by conv_rhs => rw [← @Prod.mk.eta _ _ q₀, nhdsWithin_prod_eq, nhdsWithin_univ] refine' Filter.prod_mem_prod _ (singleton_add_mem_nhds_of_nhds_zero q₀.2 V_mem) exact mem_nhdsWithin_iff_exists_mem_nhds_inter.2 ⟨w, w_open.mem_nhds q₀w, Subset.rfl⟩ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C V : Set G V_mem : V ∈ 𝓝 0 hV : K' + V ⊆ U ⊢ (w ∩ s) ×ˢ ({q₀.snd} + V) ∈ 𝓝[s ×ˢ univ] q₀ [PROOFSTEP] conv_rhs => rw [← @Prod.mk.eta _ _ q₀, nhdsWithin_prod_eq, nhdsWithin_univ] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C V : Set G V_mem : V ∈ 𝓝 0 hV : K' + V ⊆ U | 𝓝[s ×ˢ univ] q₀ [PROOFSTEP] rw [← @Prod.mk.eta _ _ q₀, nhdsWithin_prod_eq, nhdsWithin_univ] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C V : Set G V_mem : V ∈ 𝓝 0 hV : K' + V ⊆ U | 𝓝[s ×ˢ univ] q₀ [PROOFSTEP] rw [← @Prod.mk.eta _ _ q₀, nhdsWithin_prod_eq, nhdsWithin_univ] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C V : Set G V_mem : V ∈ 𝓝 0 hV : K' + V ⊆ U | 𝓝[s ×ˢ univ] q₀ [PROOFSTEP] rw [← @Prod.mk.eta _ _ q₀, nhdsWithin_prod_eq, nhdsWithin_univ] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C V : Set G V_mem : V ∈ 𝓝 0 hV : K' + V ⊆ U ⊢ (w ∩ s) ×ˢ ({q₀.snd} + V) ∈ 𝓝[s] q₀.fst ×ˢ 𝓝 q₀.snd [PROOFSTEP] refine' Filter.prod_mem_prod _ (singleton_add_mem_nhds_of_nhds_zero q₀.2 V_mem) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C V : Set G V_mem : V ∈ 𝓝 0 hV : K' + V ⊆ U ⊢ w ∩ s ∈ 𝓝[s] q₀.fst [PROOFSTEP] exact mem_nhdsWithin_iff_exists_mem_nhds_inter.2 ⟨w, w_open.mem_nhds q₀w, Subset.rfl⟩ [GOAL] case intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C V : Set G V_mem : V ∈ 𝓝 0 hV : K' + V ⊆ U this : (w ∩ s) ×ˢ ({q₀.snd} + V) ∈ 𝓝[s ×ˢ univ] q₀ ⊢ ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, ∀ᵐ (a : G) ∂μ, ‖↑(↑L (f a)) (g q.fst (q.snd - a))‖ ≤ bound a [PROOFSTEP] filter_upwards [this] [GOAL] case h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C V : Set G V_mem : V ∈ 𝓝 0 hV : K' + V ⊆ U this : (w ∩ s) ×ˢ ({q₀.snd} + V) ∈ 𝓝[s ×ˢ univ] q₀ ⊢ ∀ (a : P × G), a ∈ (w ∩ s) ×ˢ ({q₀.snd} + V) → ∀ᵐ (a_2 : G) ∂μ, ‖↑(↑L (f a_2)) (g a.fst (a.snd - a_2))‖ ≤ indicator U (fun a => ‖L‖ * ‖f a‖ * C) a_2 [PROOFSTEP] rintro ⟨p, x⟩ hpx [GOAL] case h.mk 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C V : Set G V_mem : V ∈ 𝓝 0 hV : K' + V ⊆ U this : (w ∩ s) ×ˢ ({q₀.snd} + V) ∈ 𝓝[s ×ˢ univ] q₀ p : P x : G hpx : (p, x) ∈ (w ∩ s) ×ˢ ({q₀.snd} + V) ⊢ ∀ᵐ (a : G) ∂μ, ‖↑(↑L (f a)) (g (p, x).fst ((p, x).snd - a))‖ ≤ indicator U (fun a => ‖L‖ * ‖f a‖ * C) a [PROOFSTEP] simp only [prod_mk_mem_set_prod_eq] at hpx [GOAL] case h.mk 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C V : Set G V_mem : V ∈ 𝓝 0 hV : K' + V ⊆ U this : (w ∩ s) ×ˢ ({q₀.snd} + V) ∈ 𝓝[s ×ˢ univ] q₀ p : P x : G hpx : p ∈ w ∩ s ∧ x ∈ {q₀.snd} + V ⊢ ∀ᵐ (a : G) ∂μ, ‖↑(↑L (f a)) (g (p, x).fst ((p, x).snd - a))‖ ≤ indicator U (fun a => ‖L‖ * ‖f a‖ * C) a [PROOFSTEP] refine eventually_of_forall fun a => ?_ [GOAL] case h.mk 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C V : Set G V_mem : V ∈ 𝓝 0 hV : K' + V ⊆ U this : (w ∩ s) ×ˢ ({q₀.snd} + V) ∈ 𝓝[s ×ˢ univ] q₀ p : P x : G hpx : p ∈ w ∩ s ∧ x ∈ {q₀.snd} + V a : G ⊢ ‖↑(↑L (f a)) (g (p, x).fst ((p, x).snd - a))‖ ≤ indicator U (fun a => ‖L‖ * ‖f a‖ * C) a [PROOFSTEP] apply convolution_integrand_bound_right_of_le_of_subset _ _ hpx.2 _ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C V : Set G V_mem : V ∈ 𝓝 0 hV : K' + V ⊆ U this : (w ∩ s) ×ˢ ({q₀.snd} + V) ∈ 𝓝[s ×ˢ univ] q₀ p : P x : G hpx : p ∈ w ∩ s ∧ x ∈ {q₀.snd} + V a : G ⊢ ∀ (i : G), ‖g (p, x).fst i‖ ≤ C [PROOFSTEP] intro x [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝¹ x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C V : Set G V_mem : V ∈ 𝓝 0 hV : K' + V ⊆ U this : (w ∩ s) ×ˢ ({q₀.snd} + V) ∈ 𝓝[s ×ˢ univ] q₀ p : P x✝ : G hpx : p ∈ w ∩ s ∧ x✝ ∈ {q₀.snd} + V a x : G ⊢ ‖g (p, x✝).fst x‖ ≤ C [PROOFSTEP] exact hw _ _ hpx.1 [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C V : Set G V_mem : V ∈ 𝓝 0 hV : K' + V ⊆ U this : (w ∩ s) ×ˢ ({q₀.snd} + V) ∈ 𝓝[s ×ˢ univ] q₀ p : P x : G hpx : p ∈ w ∩ s ∧ x ∈ {q₀.snd} + V a : G ⊢ -tsupport (g (p, x).fst) + ({q₀.snd} + V) ⊆ U [PROOFSTEP] rw [← add_assoc] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C V : Set G V_mem : V ∈ 𝓝 0 hV : K' + V ⊆ U this : (w ∩ s) ×ˢ ({q₀.snd} + V) ∈ 𝓝[s ×ˢ univ] q₀ p : P x : G hpx : p ∈ w ∩ s ∧ x ∈ {q₀.snd} + V a : G ⊢ -tsupport (g (p, x).fst) + {q₀.snd} + V ⊆ U [PROOFSTEP] apply Subset.trans (add_subset_add_right (add_subset_add_right _)) hV [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C V : Set G V_mem : V ∈ 𝓝 0 hV : K' + V ⊆ U this : (w ∩ s) ×ˢ ({q₀.snd} + V) ∈ 𝓝[s ×ˢ univ] q₀ p : P x : G hpx : p ∈ w ∩ s ∧ x ∈ {q₀.snd} + V a : G ⊢ -tsupport (g (p, x).fst) ⊆ -k [PROOFSTEP] rw [neg_subset_neg] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C V : Set G V_mem : V ∈ 𝓝 0 hV : K' + V ⊆ U this : (w ∩ s) ×ˢ ({q₀.snd} + V) ∈ 𝓝[s ×ˢ univ] q₀ p : P x : G hpx : p ∈ w ∩ s ∧ x ∈ {q₀.snd} + V a : G ⊢ tsupport (g (p, x).fst) ⊆ k [PROOFSTEP] exact B p hpx.1.2 [GOAL] case intro.intro.intro.intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C I2 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, ∀ᵐ (a : G) ∂μ, ‖↑(↑L (f a)) (g q.fst (q.snd - a))‖ ≤ bound a ⊢ ContinuousWithinAt (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) q₀ [PROOFSTEP] have I3 : Integrable bound μ := by rw [integrable_indicator_iff U_open.measurableSet] exact (hU.norm.const_mul _).mul_const _ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C I2 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, ∀ᵐ (a : G) ∂μ, ‖↑(↑L (f a)) (g q.fst (q.snd - a))‖ ≤ bound a ⊢ Integrable bound [PROOFSTEP] rw [integrable_indicator_iff U_open.measurableSet] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C I2 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, ∀ᵐ (a : G) ∂μ, ‖↑(↑L (f a)) (g q.fst (q.snd - a))‖ ≤ bound a ⊢ IntegrableOn (fun a => ‖L‖ * ‖f a‖ * C) U [PROOFSTEP] exact (hU.norm.const_mul _).mul_const _ [GOAL] case intro.intro.intro.intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C I2 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, ∀ᵐ (a : G) ∂μ, ‖↑(↑L (f a)) (g q.fst (q.snd - a))‖ ≤ bound a I3 : Integrable bound ⊢ ContinuousWithinAt (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) q₀ [PROOFSTEP] have I4 : ∀ᵐ a : G ∂μ, ContinuousWithinAt (fun q : P × G => L (f a) (g q.1 (q.2 - a))) (s ×ˢ univ) q₀ := by refine eventually_of_forall fun a => ?_ suffices H : ContinuousWithinAt (fun q : P × G => (f a, g q.1 (q.2 - a))) (s ×ˢ univ) q₀ exact L.continuous₂.continuousAt.comp_continuousWithinAt H apply continuousWithinAt_const.prod change ContinuousWithinAt (fun q : P × G => (↿g) (q.1, q.2 - a)) (s ×ˢ univ) q₀ have : ContinuousAt (fun q : P × G => (q.1, q.2 - a)) (q₀.1, q₀.2) := (continuous_fst.prod_mk (continuous_snd.sub continuous_const)).continuousAt rw [← @Prod.mk.eta _ _ q₀] have h'q₀ : (q₀.1, q₀.2 - a) ∈ (s ×ˢ univ : Set (P × G)) := ⟨hq₀, mem_univ _⟩ refine' ContinuousWithinAt.comp (hg _ h'q₀) this.continuousWithinAt _ rintro ⟨q, x⟩ ⟨hq, -⟩ exact ⟨hq, mem_univ _⟩ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C I2 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, ∀ᵐ (a : G) ∂μ, ‖↑(↑L (f a)) (g q.fst (q.snd - a))‖ ≤ bound a I3 : Integrable bound ⊢ ∀ᵐ (a : G) ∂μ, ContinuousWithinAt (fun q => ↑(↑L (f a)) (g q.fst (q.snd - a))) (s ×ˢ univ) q₀ [PROOFSTEP] refine eventually_of_forall fun a => ?_ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C I2 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, ∀ᵐ (a : G) ∂μ, ‖↑(↑L (f a)) (g q.fst (q.snd - a))‖ ≤ bound a I3 : Integrable bound a : G ⊢ ContinuousWithinAt (fun q => ↑(↑L (f a)) (g q.fst (q.snd - a))) (s ×ˢ univ) q₀ [PROOFSTEP] suffices H : ContinuousWithinAt (fun q : P × G => (f a, g q.1 (q.2 - a))) (s ×ˢ univ) q₀ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C I2 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, ∀ᵐ (a : G) ∂μ, ‖↑(↑L (f a)) (g q.fst (q.snd - a))‖ ≤ bound a I3 : Integrable bound a : G H : ContinuousWithinAt (fun q => (f a, g q.fst (q.snd - a))) (s ×ˢ univ) q₀ ⊢ ContinuousWithinAt (fun q => ↑(↑L (f a)) (g q.fst (q.snd - a))) (s ×ˢ univ) q₀ case H 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C I2 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, ∀ᵐ (a : G) ∂μ, ‖↑(↑L (f a)) (g q.fst (q.snd - a))‖ ≤ bound a I3 : Integrable bound a : G ⊢ ContinuousWithinAt (fun q => (f a, g q.fst (q.snd - a))) (s ×ˢ univ) q₀ [PROOFSTEP] exact L.continuous₂.continuousAt.comp_continuousWithinAt H [GOAL] case H 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C I2 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, ∀ᵐ (a : G) ∂μ, ‖↑(↑L (f a)) (g q.fst (q.snd - a))‖ ≤ bound a I3 : Integrable bound a : G ⊢ ContinuousWithinAt (fun q => (f a, g q.fst (q.snd - a))) (s ×ˢ univ) q₀ [PROOFSTEP] apply continuousWithinAt_const.prod [GOAL] case H 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C I2 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, ∀ᵐ (a : G) ∂μ, ‖↑(↑L (f a)) (g q.fst (q.snd - a))‖ ≤ bound a I3 : Integrable bound a : G ⊢ ContinuousWithinAt (fun x => g x.fst (x.snd - a)) (s ×ˢ univ) q₀ [PROOFSTEP] change ContinuousWithinAt (fun q : P × G => (↿g) (q.1, q.2 - a)) (s ×ˢ univ) q₀ [GOAL] case H 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C I2 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, ∀ᵐ (a : G) ∂μ, ‖↑(↑L (f a)) (g q.fst (q.snd - a))‖ ≤ bound a I3 : Integrable bound a : G ⊢ ContinuousWithinAt (fun q => (↿g) (q.fst, q.snd - a)) (s ×ˢ univ) q₀ [PROOFSTEP] have : ContinuousAt (fun q : P × G => (q.1, q.2 - a)) (q₀.1, q₀.2) := (continuous_fst.prod_mk (continuous_snd.sub continuous_const)).continuousAt [GOAL] case H 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C I2 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, ∀ᵐ (a : G) ∂μ, ‖↑(↑L (f a)) (g q.fst (q.snd - a))‖ ≤ bound a I3 : Integrable bound a : G this : ContinuousAt (fun q => (q.fst, q.snd - a)) (q₀.fst, q₀.snd) ⊢ ContinuousWithinAt (fun q => (↿g) (q.fst, q.snd - a)) (s ×ˢ univ) q₀ [PROOFSTEP] rw [← @Prod.mk.eta _ _ q₀] [GOAL] case H 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C I2 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, ∀ᵐ (a : G) ∂μ, ‖↑(↑L (f a)) (g q.fst (q.snd - a))‖ ≤ bound a I3 : Integrable bound a : G this : ContinuousAt (fun q => (q.fst, q.snd - a)) (q₀.fst, q₀.snd) ⊢ ContinuousWithinAt (fun q => (↿g) (q.fst, q.snd - a)) (s ×ˢ univ) (q₀.fst, q₀.snd) [PROOFSTEP] have h'q₀ : (q₀.1, q₀.2 - a) ∈ (s ×ˢ univ : Set (P × G)) := ⟨hq₀, mem_univ _⟩ [GOAL] case H 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C I2 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, ∀ᵐ (a : G) ∂μ, ‖↑(↑L (f a)) (g q.fst (q.snd - a))‖ ≤ bound a I3 : Integrable bound a : G this : ContinuousAt (fun q => (q.fst, q.snd - a)) (q₀.fst, q₀.snd) h'q₀ : (q₀.fst, q₀.snd - a) ∈ s ×ˢ univ ⊢ ContinuousWithinAt (fun q => (↿g) (q.fst, q.snd - a)) (s ×ˢ univ) (q₀.fst, q₀.snd) [PROOFSTEP] refine' ContinuousWithinAt.comp (hg _ h'q₀) this.continuousWithinAt _ [GOAL] case H 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C I2 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, ∀ᵐ (a : G) ∂μ, ‖↑(↑L (f a)) (g q.fst (q.snd - a))‖ ≤ bound a I3 : Integrable bound a : G this : ContinuousAt (fun q => (q.fst, q.snd - a)) (q₀.fst, q₀.snd) h'q₀ : (q₀.fst, q₀.snd - a) ∈ s ×ˢ univ ⊢ MapsTo (fun q => (q.fst, q.snd - a)) (s ×ˢ univ) (s ×ˢ univ) [PROOFSTEP] rintro ⟨q, x⟩ ⟨hq, -⟩ [GOAL] case H.mk.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C I2 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, ∀ᵐ (a : G) ∂μ, ‖↑(↑L (f a)) (g q.fst (q.snd - a))‖ ≤ bound a I3 : Integrable bound a : G this : ContinuousAt (fun q => (q.fst, q.snd - a)) (q₀.fst, q₀.snd) h'q₀ : (q₀.fst, q₀.snd - a) ∈ s ×ˢ univ q : P x : G hq : (q, x).fst ∈ s ⊢ (fun q => (q.fst, q.snd - a)) (q, x) ∈ s ×ˢ univ [PROOFSTEP] exact ⟨hq, mem_univ _⟩ [GOAL] case intro.intro.intro.intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P g : P → G → E' s : Set P k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s A : ∀ (p : P), p ∈ s → Continuous (g p) B : ∀ (p : P), p ∈ s → tsupport (g p) ⊆ k w : Set P C : ℝ w_open : IsOpen w q₀w : q₀.fst ∈ w hw : ∀ (p : P) (x : G), p ∈ w ∩ s → ‖g p x‖ ≤ C I1 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g q.fst (q.snd - a))) μ K' : Set G := -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U bound : G → ℝ := indicator U fun a => ‖L‖ * ‖f a‖ * C I2 : ∀ᶠ (q : P × G) in 𝓝[s ×ˢ univ] q₀, ∀ᵐ (a : G) ∂μ, ‖↑(↑L (f a)) (g q.fst (q.snd - a))‖ ≤ bound a I3 : Integrable bound I4 : ∀ᵐ (a : G) ∂μ, ContinuousWithinAt (fun q => ↑(↑L (f a)) (g q.fst (q.snd - a))) (s ×ˢ univ) q₀ ⊢ ContinuousWithinAt (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) q₀ [PROOFSTEP] exact continuousWithinAt_of_dominated I1 I2 I3 I4 [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P s : Set P v : P → G hv : ContinuousOn v s g : P → G → E' k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) ⊢ ContinuousOn (fun x => f ⋆[L, v x] g x) s [PROOFSTEP] apply (continuousOn_convolution_right_with_param' L hk h'k hgs hf hg).comp (continuousOn_id.prod hv) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P s : Set P v : P → G hv : ContinuousOn v s g : P → G → E' k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) ⊢ MapsTo (fun x => (_root_.id x, v x)) s (s ×ˢ univ) [PROOFSTEP] intro x hx [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P s : Set P v : P → G hv : ContinuousOn v s g : P → G → E' k : Set G hk : IsCompact k h'k : IsClosed k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContinuousOn (↿g) (s ×ˢ univ) x : P hx : x ∈ s ⊢ (fun x => (_root_.id x, v x)) x ∈ s ×ˢ univ [PROOFSTEP] simp only [hx, prod_mk_mem_set_prod_eq, mem_univ, and_self_iff, id.def] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P hcg : HasCompactSupport g hf : LocallyIntegrable f hg : Continuous g ⊢ Continuous (convolution f g L) [PROOFSTEP] rw [continuous_iff_continuousOn_univ] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P hcg : HasCompactSupport g hf : LocallyIntegrable f hg : Continuous g ⊢ ContinuousOn (convolution f g L) univ [PROOFSTEP] let g' : G → G → E' := fun _ q => g q [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g g'✝ : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P hcg : HasCompactSupport g hf : LocallyIntegrable f hg : Continuous g g' : G → G → E' := fun x q => g q ⊢ ContinuousOn (convolution f g L) univ [PROOFSTEP] have : ContinuousOn (↿g') (univ ×ˢ univ) := (hg.comp continuous_snd).continuousOn [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g g'✝ : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddGroup G inst✝⁵ : TopologicalSpace G inst✝⁴ : TopologicalAddGroup G inst✝³ : BorelSpace G inst✝² : FirstCountableTopology G inst✝¹ : TopologicalSpace P inst✝ : FirstCountableTopology P hcg : HasCompactSupport g hf : LocallyIntegrable f hg : Continuous g g' : G → G → E' := fun x q => g q this : ContinuousOn (↿g') (univ ×ˢ univ) ⊢ ContinuousOn (convolution f g L) univ [PROOFSTEP] exact continuousOn_convolution_right_with_param_comp' L (continuous_iff_continuousOn_univ.1 continuous_id) hcg (isClosed_tsupport _) (fun p x _ hx => image_eq_zero_of_nmem_tsupport hx) hf this [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : AddGroup G inst✝⁶ : TopologicalSpace G inst✝⁵ : TopologicalAddGroup G inst✝⁴ : BorelSpace G inst✝³ : FirstCountableTopology G inst✝² : TopologicalSpace P inst✝¹ : FirstCountableTopology P inst✝ : SecondCountableTopology G hbg : BddAbove (range fun x => ‖g x‖) hf : Integrable f hg : Continuous g ⊢ Continuous (convolution f g L) [PROOFSTEP] refine' continuous_iff_continuousAt.mpr fun x₀ => _ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : AddGroup G inst✝⁶ : TopologicalSpace G inst✝⁵ : TopologicalAddGroup G inst✝⁴ : BorelSpace G inst✝³ : FirstCountableTopology G inst✝² : TopologicalSpace P inst✝¹ : FirstCountableTopology P inst✝ : SecondCountableTopology G hbg : BddAbove (range fun x => ‖g x‖) hf : Integrable f hg : Continuous g x₀ : G ⊢ ContinuousAt (convolution f g L) x₀ [PROOFSTEP] have : ∀ᶠ x in 𝓝 x₀, ∀ᵐ t : G ∂μ, ‖L (f t) (g (x - t))‖ ≤ ‖L‖ * ‖f t‖ * ⨆ i, ‖g i‖ := by refine' eventually_of_forall fun x => eventually_of_forall fun t => _ apply_rules [L.le_of_op_norm₂_le_of_le, le_rfl, le_ciSup hbg (x - t)] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : AddGroup G inst✝⁶ : TopologicalSpace G inst✝⁵ : TopologicalAddGroup G inst✝⁴ : BorelSpace G inst✝³ : FirstCountableTopology G inst✝² : TopologicalSpace P inst✝¹ : FirstCountableTopology P inst✝ : SecondCountableTopology G hbg : BddAbove (range fun x => ‖g x‖) hf : Integrable f hg : Continuous g x₀ : G ⊢ ∀ᶠ (x : G) in 𝓝 x₀, ∀ᵐ (t : G) ∂μ, ‖↑(↑L (f t)) (g (x - t))‖ ≤ ‖L‖ * ‖f t‖ * ⨆ (i : G), ‖g i‖ [PROOFSTEP] refine' eventually_of_forall fun x => eventually_of_forall fun t => _ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : AddGroup G inst✝⁶ : TopologicalSpace G inst✝⁵ : TopologicalAddGroup G inst✝⁴ : BorelSpace G inst✝³ : FirstCountableTopology G inst✝² : TopologicalSpace P inst✝¹ : FirstCountableTopology P inst✝ : SecondCountableTopology G hbg : BddAbove (range fun x => ‖g x‖) hf : Integrable f hg : Continuous g x₀ x t : G ⊢ ‖↑(↑L (f t)) (g (x - t))‖ ≤ ‖L‖ * ‖f t‖ * ⨆ (i : G), ‖g i‖ [PROOFSTEP] apply_rules [L.le_of_op_norm₂_le_of_le, le_rfl, le_ciSup hbg (x - t)] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : AddGroup G inst✝⁶ : TopologicalSpace G inst✝⁵ : TopologicalAddGroup G inst✝⁴ : BorelSpace G inst✝³ : FirstCountableTopology G inst✝² : TopologicalSpace P inst✝¹ : FirstCountableTopology P inst✝ : SecondCountableTopology G hbg : BddAbove (range fun x => ‖g x‖) hf : Integrable f hg : Continuous g x₀ : G this : ∀ᶠ (x : G) in 𝓝 x₀, ∀ᵐ (t : G) ∂μ, ‖↑(↑L (f t)) (g (x - t))‖ ≤ ‖L‖ * ‖f t‖ * ⨆ (i : G), ‖g i‖ ⊢ ContinuousAt (convolution f g L) x₀ [PROOFSTEP] refine' continuousAt_of_dominated _ this _ _ [GOAL] case refine'_1 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : AddGroup G inst✝⁶ : TopologicalSpace G inst✝⁵ : TopologicalAddGroup G inst✝⁴ : BorelSpace G inst✝³ : FirstCountableTopology G inst✝² : TopologicalSpace P inst✝¹ : FirstCountableTopology P inst✝ : SecondCountableTopology G hbg : BddAbove (range fun x => ‖g x‖) hf : Integrable f hg : Continuous g x₀ : G this : ∀ᶠ (x : G) in 𝓝 x₀, ∀ᵐ (t : G) ∂μ, ‖↑(↑L (f t)) (g (x - t))‖ ≤ ‖L‖ * ‖f t‖ * ⨆ (i : G), ‖g i‖ ⊢ ∀ᶠ (x : G) in 𝓝 x₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g (x - a))) μ [PROOFSTEP] exact eventually_of_forall fun x => hf.aestronglyMeasurable.convolution_integrand_snd' L hg.aestronglyMeasurable [GOAL] case refine'_2 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : AddGroup G inst✝⁶ : TopologicalSpace G inst✝⁵ : TopologicalAddGroup G inst✝⁴ : BorelSpace G inst✝³ : FirstCountableTopology G inst✝² : TopologicalSpace P inst✝¹ : FirstCountableTopology P inst✝ : SecondCountableTopology G hbg : BddAbove (range fun x => ‖g x‖) hf : Integrable f hg : Continuous g x₀ : G this : ∀ᶠ (x : G) in 𝓝 x₀, ∀ᵐ (t : G) ∂μ, ‖↑(↑L (f t)) (g (x - t))‖ ≤ ‖L‖ * ‖f t‖ * ⨆ (i : G), ‖g i‖ ⊢ Integrable fun a => ‖L‖ * ‖f a‖ * ⨆ (i : G), ‖g i‖ [PROOFSTEP] exact (hf.norm.const_mul _).mul_const _ [GOAL] case refine'_3 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : AddGroup G inst✝⁶ : TopologicalSpace G inst✝⁵ : TopologicalAddGroup G inst✝⁴ : BorelSpace G inst✝³ : FirstCountableTopology G inst✝² : TopologicalSpace P inst✝¹ : FirstCountableTopology P inst✝ : SecondCountableTopology G hbg : BddAbove (range fun x => ‖g x‖) hf : Integrable f hg : Continuous g x₀ : G this : ∀ᶠ (x : G) in 𝓝 x₀, ∀ᵐ (t : G) ∂μ, ‖↑(↑L (f t)) (g (x - t))‖ ≤ ‖L‖ * ‖f t‖ * ⨆ (i : G), ‖g i‖ ⊢ ∀ᵐ (a : G) ∂μ, ContinuousAt (fun x => ↑(↑L (f a)) (g (x - a))) x₀ [PROOFSTEP] exact eventually_of_forall fun t => (L.continuous₂.comp₂ continuous_const <| hg.comp <| continuous_id.sub continuous_const).continuousAt [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : AddCommGroup G inst✝³ : IsAddLeftInvariant μ inst✝² : IsNegInvariant μ inst✝¹ : MeasurableNeg G inst✝ : MeasurableAdd G ⊢ convolution g f (ContinuousLinearMap.flip L) = convolution f g L [PROOFSTEP] ext1 x [GOAL] case h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : AddCommGroup G inst✝³ : IsAddLeftInvariant μ inst✝² : IsNegInvariant μ inst✝¹ : MeasurableNeg G inst✝ : MeasurableAdd G x : G ⊢ g ⋆[ContinuousLinearMap.flip L, x] f = f ⋆[L, x] g [PROOFSTEP] simp_rw [convolution_def] [GOAL] case h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : AddCommGroup G inst✝³ : IsAddLeftInvariant μ inst✝² : IsNegInvariant μ inst✝¹ : MeasurableNeg G inst✝ : MeasurableAdd G x : G ⊢ ∫ (t : G), ↑(↑(ContinuousLinearMap.flip L) (g t)) (f (x - t)) ∂μ = ∫ (t : G), ↑(↑L (f t)) (g (x - t)) ∂μ [PROOFSTEP] rw [← integral_sub_left_eq_self _ μ x] [GOAL] case h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : AddCommGroup G inst✝³ : IsAddLeftInvariant μ inst✝² : IsNegInvariant μ inst✝¹ : MeasurableNeg G inst✝ : MeasurableAdd G x : G ⊢ ∫ (x_1 : G), ↑(↑(ContinuousLinearMap.flip L) (g (x - x_1))) (f (x - (x - x_1))) ∂μ = ∫ (t : G), ↑(↑L (f t)) (g (x - t)) ∂μ [PROOFSTEP] simp_rw [sub_sub_self, flip_apply] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : AddCommGroup G inst✝³ : IsAddLeftInvariant μ inst✝² : IsNegInvariant μ inst✝¹ : MeasurableNeg G inst✝ : MeasurableAdd G ⊢ f ⋆[L, x] g = ∫ (t : G), ↑(↑L (f (x - t))) (g t) ∂μ [PROOFSTEP] rw [← convolution_flip] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : AddCommGroup G inst✝³ : IsAddLeftInvariant μ inst✝² : IsNegInvariant μ inst✝¹ : MeasurableNeg G inst✝ : MeasurableAdd G ⊢ g ⋆[ContinuousLinearMap.flip L, x] f = ∫ (t : G), ↑(↑L (f (x - t))) (g t) ∂μ [PROOFSTEP] rfl [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : AddCommGroup G inst✝³ : IsAddLeftInvariant μ inst✝² : IsNegInvariant μ inst✝¹ : MeasurableNeg G inst✝ : MeasurableAdd G h1 : ∀ᵐ (x : G) ∂μ, f (-x) = f x h2 : ∀ᵐ (x : G) ∂μ, g (-x) = g x ⊢ ∫ (t : G), ↑(↑L (f t)) (g (-x - t)) ∂μ = ∫ (t : G), ↑(↑L (f (-t))) (g (x + t)) ∂μ [PROOFSTEP] apply integral_congr_ae [GOAL] case h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : AddCommGroup G inst✝³ : IsAddLeftInvariant μ inst✝² : IsNegInvariant μ inst✝¹ : MeasurableNeg G inst✝ : MeasurableAdd G h1 : ∀ᵐ (x : G) ∂μ, f (-x) = f x h2 : ∀ᵐ (x : G) ∂μ, g (-x) = g x ⊢ (fun a => ↑(↑L (f a)) (g (-x - a))) =ᶠ[ae μ] fun a => ↑(↑L (f (-a))) (g (x + a)) [PROOFSTEP] filter_upwards [h1, (eventually_add_left_iff μ x).2 h2] with t ht h't [GOAL] case h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : AddCommGroup G inst✝³ : IsAddLeftInvariant μ inst✝² : IsNegInvariant μ inst✝¹ : MeasurableNeg G inst✝ : MeasurableAdd G h1 : ∀ᵐ (x : G) ∂μ, f (-x) = f x h2 : ∀ᵐ (x : G) ∂μ, g (-x) = g x t : G ht : f (-t) = f t h't : g (-(x + t)) = g (x + t) ⊢ ↑(↑L (f t)) (g (-x - t)) = ↑(↑L (f (-t))) (g (x + t)) [PROOFSTEP] simp_rw [ht, ← h't, neg_add'] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : AddCommGroup G inst✝³ : IsAddLeftInvariant μ inst✝² : IsNegInvariant μ inst✝¹ : MeasurableNeg G inst✝ : MeasurableAdd G h1 : ∀ᵐ (x : G) ∂μ, f (-x) = f x h2 : ∀ᵐ (x : G) ∂μ, g (-x) = g x ⊢ ∫ (t : G), ↑(↑L (f (-t))) (g (x + t)) ∂μ = ∫ (t : G), ↑(↑L (f t)) (g (x - t)) ∂μ [PROOFSTEP] rw [← integral_neg_eq_self] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : AddCommGroup G inst✝³ : IsAddLeftInvariant μ inst✝² : IsNegInvariant μ inst✝¹ : MeasurableNeg G inst✝ : MeasurableAdd G h1 : ∀ᵐ (x : G) ∂μ, f (-x) = f x h2 : ∀ᵐ (x : G) ∂μ, g (-x) = g x ⊢ ∫ (x_1 : G), ↑(↑L (f (- -x_1))) (g (x + -x_1)) ∂μ = ∫ (t : G), ↑(↑L (f t)) (g (x - t)) ∂μ [PROOFSTEP] simp only [neg_neg, ← sub_eq_add_neg] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddCommGroup G inst✝⁵ : IsAddLeftInvariant μ inst✝⁴ : IsNegInvariant μ inst✝³ : TopologicalSpace G inst✝² : TopologicalAddGroup G inst✝¹ : BorelSpace G inst✝ : FirstCountableTopology G hcf : HasCompactSupport f hf : Continuous f hg : LocallyIntegrable g ⊢ Continuous (convolution f g L) [PROOFSTEP] rw [← convolution_flip] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddCommGroup G inst✝⁵ : IsAddLeftInvariant μ inst✝⁴ : IsNegInvariant μ inst✝³ : TopologicalSpace G inst✝² : TopologicalAddGroup G inst✝¹ : BorelSpace G inst✝ : FirstCountableTopology G hcf : HasCompactSupport f hf : Continuous f hg : LocallyIntegrable g ⊢ Continuous (convolution g f (ContinuousLinearMap.flip L)) [PROOFSTEP] exact hcf.continuous_convolution_right L.flip hg hf [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddCommGroup G inst✝⁵ : IsAddLeftInvariant μ inst✝⁴ : IsNegInvariant μ inst✝³ : TopologicalSpace G inst✝² : TopologicalAddGroup G inst✝¹ : BorelSpace G inst✝ : SecondCountableTopology G hbf : BddAbove (range fun x => ‖f x‖) hf : Continuous f hg : Integrable g ⊢ Continuous (convolution f g L) [PROOFSTEP] rw [← convolution_flip] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁴ : NontriviallyNormedField 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁹ : MeasurableSpace G μ ν : Measure G inst✝⁸ : NormedSpace ℝ F inst✝⁷ : CompleteSpace F inst✝⁶ : AddCommGroup G inst✝⁵ : IsAddLeftInvariant μ inst✝⁴ : IsNegInvariant μ inst✝³ : TopologicalSpace G inst✝² : TopologicalAddGroup G inst✝¹ : BorelSpace G inst✝ : SecondCountableTopology G hbf : BddAbove (range fun x => ‖f x‖) hf : Continuous f hg : Integrable g ⊢ Continuous (convolution g f (ContinuousLinearMap.flip L)) [PROOFSTEP] exact hbf.continuous_convolution_right_of_integrable L.flip hg hf [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : SeminormedAddCommGroup G x₀ : G R : ℝ hf : support f ⊆ ball 0 R hg : ∀ (x : G), x ∈ ball x₀ R → g x = g x₀ ⊢ f ⋆[L, x₀] g = ∫ (t : G), ↑(↑L (f t)) (g x₀) ∂μ [PROOFSTEP] have h2 : ∀ t, L (f t) (g (x₀ - t)) = L (f t) (g x₀) := fun t ↦ by by_cases ht : t ∈ support f · have h2t := hf ht rw [mem_ball_zero_iff] at h2t specialize hg (x₀ - t) rw [sub_eq_add_neg, add_mem_ball_iff_norm, norm_neg, ← sub_eq_add_neg] at hg rw [hg h2t] · rw [nmem_support] at ht simp_rw [ht, L.map_zero₂] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : SeminormedAddCommGroup G x₀ : G R : ℝ hf : support f ⊆ ball 0 R hg : ∀ (x : G), x ∈ ball x₀ R → g x = g x₀ t : G ⊢ ↑(↑L (f t)) (g (x₀ - t)) = ↑(↑L (f t)) (g x₀) [PROOFSTEP] by_cases ht : t ∈ support f [GOAL] case pos 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : SeminormedAddCommGroup G x₀ : G R : ℝ hf : support f ⊆ ball 0 R hg : ∀ (x : G), x ∈ ball x₀ R → g x = g x₀ t : G ht : t ∈ support f ⊢ ↑(↑L (f t)) (g (x₀ - t)) = ↑(↑L (f t)) (g x₀) [PROOFSTEP] have h2t := hf ht [GOAL] case pos 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : SeminormedAddCommGroup G x₀ : G R : ℝ hf : support f ⊆ ball 0 R hg : ∀ (x : G), x ∈ ball x₀ R → g x = g x₀ t : G ht : t ∈ support f h2t : t ∈ ball 0 R ⊢ ↑(↑L (f t)) (g (x₀ - t)) = ↑(↑L (f t)) (g x₀) [PROOFSTEP] rw [mem_ball_zero_iff] at h2t [GOAL] case pos 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : SeminormedAddCommGroup G x₀ : G R : ℝ hf : support f ⊆ ball 0 R hg : ∀ (x : G), x ∈ ball x₀ R → g x = g x₀ t : G ht : t ∈ support f h2t : ‖t‖ < R ⊢ ↑(↑L (f t)) (g (x₀ - t)) = ↑(↑L (f t)) (g x₀) [PROOFSTEP] specialize hg (x₀ - t) [GOAL] case pos 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : SeminormedAddCommGroup G x₀ : G R : ℝ hf : support f ⊆ ball 0 R t : G ht : t ∈ support f h2t : ‖t‖ < R hg : x₀ - t ∈ ball x₀ R → g (x₀ - t) = g x₀ ⊢ ↑(↑L (f t)) (g (x₀ - t)) = ↑(↑L (f t)) (g x₀) [PROOFSTEP] rw [sub_eq_add_neg, add_mem_ball_iff_norm, norm_neg, ← sub_eq_add_neg] at hg [GOAL] case pos 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : SeminormedAddCommGroup G x₀ : G R : ℝ hf : support f ⊆ ball 0 R t : G ht : t ∈ support f h2t : ‖t‖ < R hg : ‖t‖ < R → g (x₀ - t) = g x₀ ⊢ ↑(↑L (f t)) (g (x₀ - t)) = ↑(↑L (f t)) (g x₀) [PROOFSTEP] rw [hg h2t] [GOAL] case neg 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : SeminormedAddCommGroup G x₀ : G R : ℝ hf : support f ⊆ ball 0 R hg : ∀ (x : G), x ∈ ball x₀ R → g x = g x₀ t : G ht : ¬t ∈ support f ⊢ ↑(↑L (f t)) (g (x₀ - t)) = ↑(↑L (f t)) (g x₀) [PROOFSTEP] rw [nmem_support] at ht [GOAL] case neg 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : SeminormedAddCommGroup G x₀ : G R : ℝ hf : support f ⊆ ball 0 R hg : ∀ (x : G), x ∈ ball x₀ R → g x = g x₀ t : G ht : f t = 0 ⊢ ↑(↑L (f t)) (g (x₀ - t)) = ↑(↑L (f t)) (g x₀) [PROOFSTEP] simp_rw [ht, L.map_zero₂] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : NontriviallyNormedField 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace 𝕜 E'' inst✝⁴ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝³ : MeasurableSpace G μ ν : Measure G inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F inst✝ : SeminormedAddCommGroup G x₀ : G R : ℝ hf : support f ⊆ ball 0 R hg : ∀ (x : G), x ∈ ball x₀ R → g x = g x₀ h2 : ∀ (t : G), ↑(↑L (f t)) (g (x₀ - t)) = ↑(↑L (f t)) (g x₀) ⊢ f ⋆[L, x₀] g = ∫ (t : G), ↑(↑L (f t)) (g x₀) ∂μ [PROOFSTEP] simp_rw [convolution_def, h2] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε ⊢ dist (f ⋆[L, x₀] g) (∫ (t : G), ↑(↑L (f t)) z₀ ∂μ) ≤ (‖L‖ * ∫ (x : G), ‖f x‖ ∂μ) * ε [PROOFSTEP] have hfg : ConvolutionExistsAt f g x₀ L μ := by refine' BddAbove.convolutionExistsAt L _ Metric.isOpen_ball.measurableSet (Subset.trans _ hf) hif.integrableOn hmg swap; · refine' fun t => mt fun ht : f t = 0 => _; simp_rw [ht, L.map_zero₂] rw [bddAbove_def] refine' ⟨‖z₀‖ + ε, _⟩ rintro _ ⟨x, hx, rfl⟩ refine' norm_le_norm_add_const_of_dist_le (hg x _) rwa [mem_ball_iff_norm, norm_sub_rev, ← mem_ball_zero_iff] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε ⊢ ConvolutionExistsAt f g x₀ L [PROOFSTEP] refine' BddAbove.convolutionExistsAt L _ Metric.isOpen_ball.measurableSet (Subset.trans _ hf) hif.integrableOn hmg [GOAL] case refine'_1 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε ⊢ BddAbove ((fun i => ‖g i‖) '' ((fun t => x₀ - t) ⁻¹' ball 0 R)) case refine'_2 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε ⊢ (support fun t => ↑(↑L (f t)) (g (x₀ - t))) ⊆ support f [PROOFSTEP] swap [GOAL] case refine'_2 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε ⊢ (support fun t => ↑(↑L (f t)) (g (x₀ - t))) ⊆ support f [PROOFSTEP] refine' fun t => mt fun ht : f t = 0 => _ [GOAL] case refine'_2 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε t : G ht : f t = 0 ⊢ (fun t => ↑(↑L (f t)) (g (x₀ - t))) t = 0 [PROOFSTEP] simp_rw [ht, L.map_zero₂] [GOAL] case refine'_1 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε ⊢ BddAbove ((fun i => ‖g i‖) '' ((fun t => x₀ - t) ⁻¹' ball 0 R)) [PROOFSTEP] rw [bddAbove_def] [GOAL] case refine'_1 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε ⊢ ∃ x, ∀ (y : ℝ), y ∈ (fun i => ‖g i‖) '' ((fun t => x₀ - t) ⁻¹' ball 0 R) → y ≤ x [PROOFSTEP] refine' ⟨‖z₀‖ + ε, _⟩ [GOAL] case refine'_1 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε ⊢ ∀ (y : ℝ), y ∈ (fun i => ‖g i‖) '' ((fun t => x₀ - t) ⁻¹' ball 0 R) → y ≤ ‖z₀‖ + ε [PROOFSTEP] rintro _ ⟨x, hx, rfl⟩ [GOAL] case refine'_1.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε x : G hx : x ∈ (fun t => x₀ - t) ⁻¹' ball 0 R ⊢ (fun i => ‖g i‖) x ≤ ‖z₀‖ + ε [PROOFSTEP] refine' norm_le_norm_add_const_of_dist_le (hg x _) [GOAL] case refine'_1.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε x : G hx : x ∈ (fun t => x₀ - t) ⁻¹' ball 0 R ⊢ x ∈ ball x₀ R [PROOFSTEP] rwa [mem_ball_iff_norm, norm_sub_rev, ← mem_ball_zero_iff] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε hfg : ConvolutionExistsAt f g x₀ L ⊢ dist (f ⋆[L, x₀] g) (∫ (t : G), ↑(↑L (f t)) z₀ ∂μ) ≤ (‖L‖ * ∫ (x : G), ‖f x‖ ∂μ) * ε [PROOFSTEP] have h2 : ∀ t, dist (L (f t) (g (x₀ - t))) (L (f t) z₀) ≤ ‖L (f t)‖ * ε := by intro t; by_cases ht : t ∈ support f · have h2t := hf ht rw [mem_ball_zero_iff] at h2t specialize hg (x₀ - t) rw [sub_eq_add_neg, add_mem_ball_iff_norm, norm_neg, ← sub_eq_add_neg] at hg refine' ((L (f t)).dist_le_op_norm _ _).trans _ exact mul_le_mul_of_nonneg_left (hg h2t) (norm_nonneg _) · rw [nmem_support] at ht simp_rw [ht, L.map_zero₂, L.map_zero, norm_zero, zero_mul, dist_self] rfl [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε hfg : ConvolutionExistsAt f g x₀ L ⊢ ∀ (t : G), dist (↑(↑L (f t)) (g (x₀ - t))) (↑(↑L (f t)) z₀) ≤ ‖↑L (f t)‖ * ε [PROOFSTEP] intro t [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε hfg : ConvolutionExistsAt f g x₀ L t : G ⊢ dist (↑(↑L (f t)) (g (x₀ - t))) (↑(↑L (f t)) z₀) ≤ ‖↑L (f t)‖ * ε [PROOFSTEP] by_cases ht : t ∈ support f [GOAL] case pos 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε hfg : ConvolutionExistsAt f g x₀ L t : G ht : t ∈ support f ⊢ dist (↑(↑L (f t)) (g (x₀ - t))) (↑(↑L (f t)) z₀) ≤ ‖↑L (f t)‖ * ε [PROOFSTEP] have h2t := hf ht [GOAL] case pos 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε hfg : ConvolutionExistsAt f g x₀ L t : G ht : t ∈ support f h2t : t ∈ ball 0 R ⊢ dist (↑(↑L (f t)) (g (x₀ - t))) (↑(↑L (f t)) z₀) ≤ ‖↑L (f t)‖ * ε [PROOFSTEP] rw [mem_ball_zero_iff] at h2t [GOAL] case pos 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε hfg : ConvolutionExistsAt f g x₀ L t : G ht : t ∈ support f h2t : ‖t‖ < R ⊢ dist (↑(↑L (f t)) (g (x₀ - t))) (↑(↑L (f t)) z₀) ≤ ‖↑L (f t)‖ * ε [PROOFSTEP] specialize hg (x₀ - t) [GOAL] case pos 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hfg : ConvolutionExistsAt f g x₀ L t : G ht : t ∈ support f h2t : ‖t‖ < R hg : x₀ - t ∈ ball x₀ R → dist (g (x₀ - t)) z₀ ≤ ε ⊢ dist (↑(↑L (f t)) (g (x₀ - t))) (↑(↑L (f t)) z₀) ≤ ‖↑L (f t)‖ * ε [PROOFSTEP] rw [sub_eq_add_neg, add_mem_ball_iff_norm, norm_neg, ← sub_eq_add_neg] at hg [GOAL] case pos 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hfg : ConvolutionExistsAt f g x₀ L t : G ht : t ∈ support f h2t : ‖t‖ < R hg : ‖t‖ < R → dist (g (x₀ - t)) z₀ ≤ ε ⊢ dist (↑(↑L (f t)) (g (x₀ - t))) (↑(↑L (f t)) z₀) ≤ ‖↑L (f t)‖ * ε [PROOFSTEP] refine' ((L (f t)).dist_le_op_norm _ _).trans _ [GOAL] case pos 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hfg : ConvolutionExistsAt f g x₀ L t : G ht : t ∈ support f h2t : ‖t‖ < R hg : ‖t‖ < R → dist (g (x₀ - t)) z₀ ≤ ε ⊢ ‖↑L (f t)‖ * dist (g (x₀ - t)) z₀ ≤ ‖↑L (f t)‖ * ε [PROOFSTEP] exact mul_le_mul_of_nonneg_left (hg h2t) (norm_nonneg _) [GOAL] case neg 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε hfg : ConvolutionExistsAt f g x₀ L t : G ht : ¬t ∈ support f ⊢ dist (↑(↑L (f t)) (g (x₀ - t))) (↑(↑L (f t)) z₀) ≤ ‖↑L (f t)‖ * ε [PROOFSTEP] rw [nmem_support] at ht [GOAL] case neg 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε hfg : ConvolutionExistsAt f g x₀ L t : G ht : f t = 0 ⊢ dist (↑(↑L (f t)) (g (x₀ - t))) (↑(↑L (f t)) z₀) ≤ ‖↑L (f t)‖ * ε [PROOFSTEP] simp_rw [ht, L.map_zero₂, L.map_zero, norm_zero, zero_mul, dist_self] [GOAL] case neg 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε hfg : ConvolutionExistsAt f g x₀ L t : G ht : f t = 0 ⊢ 0 ≤ 0 [PROOFSTEP] rfl [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε hfg : ConvolutionExistsAt f g x₀ L h2 : ∀ (t : G), dist (↑(↑L (f t)) (g (x₀ - t))) (↑(↑L (f t)) z₀) ≤ ‖↑L (f t)‖ * ε ⊢ dist (f ⋆[L, x₀] g) (∫ (t : G), ↑(↑L (f t)) z₀ ∂μ) ≤ (‖L‖ * ∫ (x : G), ‖f x‖ ∂μ) * ε [PROOFSTEP] simp_rw [convolution_def] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε hfg : ConvolutionExistsAt f g x₀ L h2 : ∀ (t : G), dist (↑(↑L (f t)) (g (x₀ - t))) (↑(↑L (f t)) z₀) ≤ ‖↑L (f t)‖ * ε ⊢ dist (∫ (t : G), ↑(↑L (f t)) (g (x₀ - t)) ∂μ) (∫ (t : G), ↑(↑L (f t)) z₀ ∂μ) ≤ (‖L‖ * ∫ (x : G), ‖f x‖ ∂μ) * ε [PROOFSTEP] simp_rw [dist_eq_norm] at h2 ⊢ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε hfg : ConvolutionExistsAt f g x₀ L h2 : ∀ (t : G), ‖↑(↑L (f t)) (g (x₀ - t)) - ↑(↑L (f t)) z₀‖ ≤ ‖↑L (f t)‖ * ε ⊢ ‖∫ (t : G), ↑(↑L (f t)) (g (x₀ - t)) ∂μ - ∫ (t : G), ↑(↑L (f t)) z₀ ∂μ‖ ≤ (‖L‖ * ∫ (x : G), ‖f x‖ ∂μ) * ε [PROOFSTEP] rw [← integral_sub hfg.integrable] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε hfg : ConvolutionExistsAt f g x₀ L h2 : ∀ (t : G), ‖↑(↑L (f t)) (g (x₀ - t)) - ↑(↑L (f t)) z₀‖ ≤ ‖↑L (f t)‖ * ε ⊢ ‖∫ (a : G), ↑(↑L (f a)) (g (x₀ - a)) - ↑(↑L (f a)) z₀ ∂μ‖ ≤ (‖L‖ * ∫ (x : G), ‖f x‖ ∂μ) * ε 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε hfg : ConvolutionExistsAt f g x₀ L h2 : ∀ (t : G), ‖↑(↑L (f t)) (g (x₀ - t)) - ↑(↑L (f t)) z₀‖ ≤ ‖↑L (f t)‖ * ε ⊢ Integrable fun t => ↑(↑L (f t)) z₀ [PROOFSTEP] swap [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε hfg : ConvolutionExistsAt f g x₀ L h2 : ∀ (t : G), ‖↑(↑L (f t)) (g (x₀ - t)) - ↑(↑L (f t)) z₀‖ ≤ ‖↑L (f t)‖ * ε ⊢ Integrable fun t => ↑(↑L (f t)) z₀ [PROOFSTEP] exact (L.flip z₀).integrable_comp hif [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε hfg : ConvolutionExistsAt f g x₀ L h2 : ∀ (t : G), ‖↑(↑L (f t)) (g (x₀ - t)) - ↑(↑L (f t)) z₀‖ ≤ ‖↑L (f t)‖ * ε ⊢ ‖∫ (a : G), ↑(↑L (f a)) (g (x₀ - a)) - ↑(↑L (f a)) z₀ ∂μ‖ ≤ (‖L‖ * ∫ (x : G), ‖f x‖ ∂μ) * ε [PROOFSTEP] refine' (norm_integral_le_of_norm_le ((L.integrable_comp hif).norm.mul_const ε) (eventually_of_forall h2)).trans _ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε hfg : ConvolutionExistsAt f g x₀ L h2 : ∀ (t : G), ‖↑(↑L (f t)) (g (x₀ - t)) - ↑(↑L (f t)) z₀‖ ≤ ‖↑L (f t)‖ * ε ⊢ ∫ (x : G), ‖↑L (f x)‖ * ε ∂μ ≤ (‖L‖ * ∫ (x : G), ‖f x‖ ∂μ) * ε [PROOFSTEP] rw [integral_mul_right] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε hfg : ConvolutionExistsAt f g x₀ L h2 : ∀ (t : G), ‖↑(↑L (f t)) (g (x₀ - t)) - ↑(↑L (f t)) z₀‖ ≤ ‖↑L (f t)‖ * ε ⊢ (∫ (a : G), ‖↑L (f a)‖ ∂μ) * ε ≤ (‖L‖ * ∫ (x : G), ‖f x‖ ∂μ) * ε [PROOFSTEP] refine' mul_le_mul_of_nonneg_right _ hε [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε hfg : ConvolutionExistsAt f g x₀ L h2 : ∀ (t : G), ‖↑(↑L (f t)) (g (x₀ - t)) - ↑(↑L (f t)) z₀‖ ≤ ‖↑L (f t)‖ * ε ⊢ ∫ (a : G), ‖↑L (f a)‖ ∂μ ≤ ‖L‖ * ∫ (x : G), ‖f x‖ ∂μ [PROOFSTEP] have h3 : ∀ t, ‖L (f t)‖ ≤ ‖L‖ * ‖f t‖ := by intro t exact L.le_op_norm (f t) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε hfg : ConvolutionExistsAt f g x₀ L h2 : ∀ (t : G), ‖↑(↑L (f t)) (g (x₀ - t)) - ↑(↑L (f t)) z₀‖ ≤ ‖↑L (f t)‖ * ε ⊢ ∀ (t : G), ‖↑L (f t)‖ ≤ ‖L‖ * ‖f t‖ [PROOFSTEP] intro t [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε hfg : ConvolutionExistsAt f g x₀ L h2 : ∀ (t : G), ‖↑(↑L (f t)) (g (x₀ - t)) - ↑(↑L (f t)) z₀‖ ≤ ‖↑L (f t)‖ * ε t : G ⊢ ‖↑L (f t)‖ ≤ ‖L‖ * ‖f t‖ [PROOFSTEP] exact L.le_op_norm (f t) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε hfg : ConvolutionExistsAt f g x₀ L h2 : ∀ (t : G), ‖↑(↑L (f t)) (g (x₀ - t)) - ↑(↑L (f t)) z₀‖ ≤ ‖↑L (f t)‖ * ε h3 : ∀ (t : G), ‖↑L (f t)‖ ≤ ‖L‖ * ‖f t‖ ⊢ ∫ (a : G), ‖↑L (f a)‖ ∂μ ≤ ‖L‖ * ∫ (x : G), ‖f x‖ ∂μ [PROOFSTEP] refine' (integral_mono (L.integrable_comp hif).norm (hif.norm.const_mul _) h3).trans_eq _ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : NontriviallyNormedField 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝⁷ : MeasurableSpace G μ ν : Measure G inst✝⁶ : NormedSpace ℝ F inst✝⁵ : CompleteSpace F inst✝⁴ : SeminormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : SecondCountableTopology G inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hif : Integrable f hf : support f ⊆ ball 0 R hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε hfg : ConvolutionExistsAt f g x₀ L h2 : ∀ (t : G), ‖↑(↑L (f t)) (g (x₀ - t)) - ↑(↑L (f t)) z₀‖ ≤ ‖↑L (f t)‖ * ε h3 : ∀ (t : G), ‖↑L (f t)‖ ≤ ‖L‖ * ‖f t‖ ⊢ ∫ (a : G), ‖L‖ * ‖f a‖ ∂μ = ‖L‖ * ∫ (x : G), ‖f x‖ ∂μ [PROOFSTEP] rw [integral_mul_left] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f✝ f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : SeminormedAddCommGroup G inst✝⁶ : BorelSpace G inst✝⁵ : SecondCountableTopology G inst✝⁴ : IsAddLeftInvariant μ inst✝³ : SigmaFinite μ inst✝² : NormedSpace ℝ E inst✝¹ : NormedSpace ℝ E' inst✝ : CompleteSpace E' f : G → ℝ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hf : support f ⊆ ball 0 R hnf : ∀ (x : G), 0 ≤ f x hintf : ∫ (x : G), f x ∂μ = 1 hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε ⊢ dist (f ⋆[lsmul ℝ ℝ, x₀] g) z₀ ≤ ε [PROOFSTEP] have hif : Integrable f μ := integrable_of_integral_eq_one hintf [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f✝ f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : SeminormedAddCommGroup G inst✝⁶ : BorelSpace G inst✝⁵ : SecondCountableTopology G inst✝⁴ : IsAddLeftInvariant μ inst✝³ : SigmaFinite μ inst✝² : NormedSpace ℝ E inst✝¹ : NormedSpace ℝ E' inst✝ : CompleteSpace E' f : G → ℝ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hf : support f ⊆ ball 0 R hnf : ∀ (x : G), 0 ≤ f x hintf : ∫ (x : G), f x ∂μ = 1 hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε hif : Integrable f ⊢ dist (f ⋆[lsmul ℝ ℝ, x₀] g) z₀ ≤ ε [PROOFSTEP] convert (dist_convolution_le' (lsmul ℝ ℝ) hε hif hf hmg hg).trans _ [GOAL] case h.e'_3.h.e'_4 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f✝ f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : SeminormedAddCommGroup G inst✝⁶ : BorelSpace G inst✝⁵ : SecondCountableTopology G inst✝⁴ : IsAddLeftInvariant μ inst✝³ : SigmaFinite μ inst✝² : NormedSpace ℝ E inst✝¹ : NormedSpace ℝ E' inst✝ : CompleteSpace E' f : G → ℝ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hf : support f ⊆ ball 0 R hnf : ∀ (x : G), 0 ≤ f x hintf : ∫ (x : G), f x ∂μ = 1 hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε hif : Integrable f ⊢ z₀ = ∫ (t : G), ↑(↑(lsmul ℝ ℝ) (f t)) z₀ ∂μ [PROOFSTEP] simp_rw [lsmul_apply, integral_smul_const, hintf, one_smul] [GOAL] case convert_2 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f✝ f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : SeminormedAddCommGroup G inst✝⁶ : BorelSpace G inst✝⁵ : SecondCountableTopology G inst✝⁴ : IsAddLeftInvariant μ inst✝³ : SigmaFinite μ inst✝² : NormedSpace ℝ E inst✝¹ : NormedSpace ℝ E' inst✝ : CompleteSpace E' f : G → ℝ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hf : support f ⊆ ball 0 R hnf : ∀ (x : G), 0 ≤ f x hintf : ∫ (x : G), f x ∂μ = 1 hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε hif : Integrable f ⊢ (‖lsmul ℝ ℝ‖ * ∫ (x : G), ‖f x‖ ∂μ) * ε ≤ ε [PROOFSTEP] simp_rw [Real.norm_of_nonneg (hnf _), hintf, mul_one] [GOAL] case convert_2 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f✝ f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : SeminormedAddCommGroup G inst✝⁶ : BorelSpace G inst✝⁵ : SecondCountableTopology G inst✝⁴ : IsAddLeftInvariant μ inst✝³ : SigmaFinite μ inst✝² : NormedSpace ℝ E inst✝¹ : NormedSpace ℝ E' inst✝ : CompleteSpace E' f : G → ℝ x₀ : G R ε : ℝ z₀ : E' hε : 0 ≤ ε hf : support f ⊆ ball 0 R hnf : ∀ (x : G), 0 ≤ f x hintf : ∫ (x : G), f x ∂μ = 1 hmg : AEStronglyMeasurable g μ hg : ∀ (x : G), x ∈ ball x₀ R → dist (g x) z₀ ≤ ε hif : Integrable f ⊢ ‖lsmul ℝ ℝ‖ * ε ≤ ε [PROOFSTEP] exact (mul_le_mul_of_nonneg_right op_norm_lsmul_le hε).trans_eq (one_mul ε) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : SeminormedAddCommGroup G inst✝⁶ : BorelSpace G inst✝⁵ : SecondCountableTopology G inst✝⁴ : IsAddLeftInvariant μ inst✝³ : SigmaFinite μ inst✝² : NormedSpace ℝ E inst✝¹ : NormedSpace ℝ E' inst✝ : CompleteSpace E' ι : Type u_1 g : ι → G → E' l : Filter ι x₀ : G z₀ : E' φ : ι → G → ℝ k : ι → G hnφ : ∀ᶠ (i : ι) in l, ∀ (x : G), 0 ≤ φ i x hiφ : ∀ᶠ (i : ι) in l, ∫ (x : G), φ i x ∂μ = 1 hφ : Tendsto (fun n => support (φ n)) l (smallSets (𝓝 0)) hmg : ∀ᶠ (i : ι) in l, AEStronglyMeasurable (g i) μ hcg : Tendsto (uncurry g) (l ×ˢ 𝓝 x₀) (𝓝 z₀) hk : Tendsto k l (𝓝 x₀) ⊢ Tendsto (fun i => φ i ⋆[lsmul ℝ ℝ, k i] g i) l (𝓝 z₀) [PROOFSTEP] simp_rw [tendsto_smallSets_iff] at hφ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : SeminormedAddCommGroup G inst✝⁶ : BorelSpace G inst✝⁵ : SecondCountableTopology G inst✝⁴ : IsAddLeftInvariant μ inst✝³ : SigmaFinite μ inst✝² : NormedSpace ℝ E inst✝¹ : NormedSpace ℝ E' inst✝ : CompleteSpace E' ι : Type u_1 g : ι → G → E' l : Filter ι x₀ : G z₀ : E' φ : ι → G → ℝ k : ι → G hnφ : ∀ᶠ (i : ι) in l, ∀ (x : G), 0 ≤ φ i x hiφ : ∀ᶠ (i : ι) in l, ∫ (x : G), φ i x ∂μ = 1 hmg : ∀ᶠ (i : ι) in l, AEStronglyMeasurable (g i) μ hcg : Tendsto (uncurry g) (l ×ˢ 𝓝 x₀) (𝓝 z₀) hk : Tendsto k l (𝓝 x₀) hφ : ∀ (t : Set G), t ∈ 𝓝 0 → ∀ᶠ (x : ι) in l, support (φ x) ⊆ t ⊢ Tendsto (fun i => φ i ⋆[lsmul ℝ ℝ, k i] g i) l (𝓝 z₀) [PROOFSTEP] rw [Metric.tendsto_nhds] at hcg ⊢ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : SeminormedAddCommGroup G inst✝⁶ : BorelSpace G inst✝⁵ : SecondCountableTopology G inst✝⁴ : IsAddLeftInvariant μ inst✝³ : SigmaFinite μ inst✝² : NormedSpace ℝ E inst✝¹ : NormedSpace ℝ E' inst✝ : CompleteSpace E' ι : Type u_1 g : ι → G → E' l : Filter ι x₀ : G z₀ : E' φ : ι → G → ℝ k : ι → G hnφ : ∀ᶠ (i : ι) in l, ∀ (x : G), 0 ≤ φ i x hiφ : ∀ᶠ (i : ι) in l, ∫ (x : G), φ i x ∂μ = 1 hmg : ∀ᶠ (i : ι) in l, AEStronglyMeasurable (g i) μ hcg : ∀ (ε : ℝ), ε > 0 → ∀ᶠ (x : ι × G) in l ×ˢ 𝓝 x₀, dist (uncurry g x) z₀ < ε hk : Tendsto k l (𝓝 x₀) hφ : ∀ (t : Set G), t ∈ 𝓝 0 → ∀ᶠ (x : ι) in l, support (φ x) ⊆ t ⊢ ∀ (ε : ℝ), ε > 0 → ∀ᶠ (x : ι) in l, dist (φ x ⋆[lsmul ℝ ℝ, k x] g x) z₀ < ε [PROOFSTEP] simp_rw [Metric.eventually_prod_nhds_iff] at hcg [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : SeminormedAddCommGroup G inst✝⁶ : BorelSpace G inst✝⁵ : SecondCountableTopology G inst✝⁴ : IsAddLeftInvariant μ inst✝³ : SigmaFinite μ inst✝² : NormedSpace ℝ E inst✝¹ : NormedSpace ℝ E' inst✝ : CompleteSpace E' ι : Type u_1 g : ι → G → E' l : Filter ι x₀ : G z₀ : E' φ : ι → G → ℝ k : ι → G hnφ : ∀ᶠ (i : ι) in l, ∀ (x : G), 0 ≤ φ i x hiφ : ∀ᶠ (i : ι) in l, ∫ (x : G), φ i x ∂μ = 1 hmg : ∀ᶠ (i : ι) in l, AEStronglyMeasurable (g i) μ hk : Tendsto k l (𝓝 x₀) hφ : ∀ (t : Set G), t ∈ 𝓝 0 → ∀ᶠ (x : ι) in l, support (φ x) ⊆ t hcg : ∀ (ε : ℝ), ε > 0 → ∃ pa, (∀ᶠ (i : ι) in l, pa i) ∧ ∃ ε_1, ε_1 > 0 ∧ ∀ {i : ι}, pa i → ∀ {x : G}, dist x x₀ < ε_1 → dist (uncurry g (i, x)) z₀ < ε ⊢ ∀ (ε : ℝ), ε > 0 → ∀ᶠ (x : ι) in l, dist (φ x ⋆[lsmul ℝ ℝ, k x] g x) z₀ < ε [PROOFSTEP] intro ε hε [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : SeminormedAddCommGroup G inst✝⁶ : BorelSpace G inst✝⁵ : SecondCountableTopology G inst✝⁴ : IsAddLeftInvariant μ inst✝³ : SigmaFinite μ inst✝² : NormedSpace ℝ E inst✝¹ : NormedSpace ℝ E' inst✝ : CompleteSpace E' ι : Type u_1 g : ι → G → E' l : Filter ι x₀ : G z₀ : E' φ : ι → G → ℝ k : ι → G hnφ : ∀ᶠ (i : ι) in l, ∀ (x : G), 0 ≤ φ i x hiφ : ∀ᶠ (i : ι) in l, ∫ (x : G), φ i x ∂μ = 1 hmg : ∀ᶠ (i : ι) in l, AEStronglyMeasurable (g i) μ hk : Tendsto k l (𝓝 x₀) hφ : ∀ (t : Set G), t ∈ 𝓝 0 → ∀ᶠ (x : ι) in l, support (φ x) ⊆ t hcg : ∀ (ε : ℝ), ε > 0 → ∃ pa, (∀ᶠ (i : ι) in l, pa i) ∧ ∃ ε_1, ε_1 > 0 ∧ ∀ {i : ι}, pa i → ∀ {x : G}, dist x x₀ < ε_1 → dist (uncurry g (i, x)) z₀ < ε ε : ℝ hε : ε > 0 ⊢ ∀ᶠ (x : ι) in l, dist (φ x ⋆[lsmul ℝ ℝ, k x] g x) z₀ < ε [PROOFSTEP] have h2ε : 0 < ε / 3 := div_pos hε (by norm_num) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : SeminormedAddCommGroup G inst✝⁶ : BorelSpace G inst✝⁵ : SecondCountableTopology G inst✝⁴ : IsAddLeftInvariant μ inst✝³ : SigmaFinite μ inst✝² : NormedSpace ℝ E inst✝¹ : NormedSpace ℝ E' inst✝ : CompleteSpace E' ι : Type u_1 g : ι → G → E' l : Filter ι x₀ : G z₀ : E' φ : ι → G → ℝ k : ι → G hnφ : ∀ᶠ (i : ι) in l, ∀ (x : G), 0 ≤ φ i x hiφ : ∀ᶠ (i : ι) in l, ∫ (x : G), φ i x ∂μ = 1 hmg : ∀ᶠ (i : ι) in l, AEStronglyMeasurable (g i) μ hk : Tendsto k l (𝓝 x₀) hφ : ∀ (t : Set G), t ∈ 𝓝 0 → ∀ᶠ (x : ι) in l, support (φ x) ⊆ t hcg : ∀ (ε : ℝ), ε > 0 → ∃ pa, (∀ᶠ (i : ι) in l, pa i) ∧ ∃ ε_1, ε_1 > 0 ∧ ∀ {i : ι}, pa i → ∀ {x : G}, dist x x₀ < ε_1 → dist (uncurry g (i, x)) z₀ < ε ε : ℝ hε : ε > 0 ⊢ 0 < 3 [PROOFSTEP] norm_num [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : SeminormedAddCommGroup G inst✝⁶ : BorelSpace G inst✝⁵ : SecondCountableTopology G inst✝⁴ : IsAddLeftInvariant μ inst✝³ : SigmaFinite μ inst✝² : NormedSpace ℝ E inst✝¹ : NormedSpace ℝ E' inst✝ : CompleteSpace E' ι : Type u_1 g : ι → G → E' l : Filter ι x₀ : G z₀ : E' φ : ι → G → ℝ k : ι → G hnφ : ∀ᶠ (i : ι) in l, ∀ (x : G), 0 ≤ φ i x hiφ : ∀ᶠ (i : ι) in l, ∫ (x : G), φ i x ∂μ = 1 hmg : ∀ᶠ (i : ι) in l, AEStronglyMeasurable (g i) μ hk : Tendsto k l (𝓝 x₀) hφ : ∀ (t : Set G), t ∈ 𝓝 0 → ∀ᶠ (x : ι) in l, support (φ x) ⊆ t hcg : ∀ (ε : ℝ), ε > 0 → ∃ pa, (∀ᶠ (i : ι) in l, pa i) ∧ ∃ ε_1, ε_1 > 0 ∧ ∀ {i : ι}, pa i → ∀ {x : G}, dist x x₀ < ε_1 → dist (uncurry g (i, x)) z₀ < ε ε : ℝ hε : ε > 0 h2ε : 0 < ε / 3 ⊢ ∀ᶠ (x : ι) in l, dist (φ x ⋆[lsmul ℝ ℝ, k x] g x) z₀ < ε [PROOFSTEP] obtain ⟨p, hp, δ, hδ, hgδ⟩ := hcg _ h2ε [GOAL] case intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : SeminormedAddCommGroup G inst✝⁶ : BorelSpace G inst✝⁵ : SecondCountableTopology G inst✝⁴ : IsAddLeftInvariant μ inst✝³ : SigmaFinite μ inst✝² : NormedSpace ℝ E inst✝¹ : NormedSpace ℝ E' inst✝ : CompleteSpace E' ι : Type u_1 g : ι → G → E' l : Filter ι x₀ : G z₀ : E' φ : ι → G → ℝ k : ι → G hnφ : ∀ᶠ (i : ι) in l, ∀ (x : G), 0 ≤ φ i x hiφ : ∀ᶠ (i : ι) in l, ∫ (x : G), φ i x ∂μ = 1 hmg : ∀ᶠ (i : ι) in l, AEStronglyMeasurable (g i) μ hk : Tendsto k l (𝓝 x₀) hφ : ∀ (t : Set G), t ∈ 𝓝 0 → ∀ᶠ (x : ι) in l, support (φ x) ⊆ t hcg : ∀ (ε : ℝ), ε > 0 → ∃ pa, (∀ᶠ (i : ι) in l, pa i) ∧ ∃ ε_1, ε_1 > 0 ∧ ∀ {i : ι}, pa i → ∀ {x : G}, dist x x₀ < ε_1 → dist (uncurry g (i, x)) z₀ < ε ε : ℝ hε : ε > 0 h2ε : 0 < ε / 3 p : ι → Prop hp : ∀ᶠ (i : ι) in l, p i δ : ℝ hδ : δ > 0 hgδ : ∀ {i : ι}, p i → ∀ {x : G}, dist x x₀ < δ → dist (uncurry g (i, x)) z₀ < ε / 3 ⊢ ∀ᶠ (x : ι) in l, dist (φ x ⋆[lsmul ℝ ℝ, k x] g x) z₀ < ε [PROOFSTEP] dsimp only [uncurry] at hgδ [GOAL] case intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : SeminormedAddCommGroup G inst✝⁶ : BorelSpace G inst✝⁵ : SecondCountableTopology G inst✝⁴ : IsAddLeftInvariant μ inst✝³ : SigmaFinite μ inst✝² : NormedSpace ℝ E inst✝¹ : NormedSpace ℝ E' inst✝ : CompleteSpace E' ι : Type u_1 g : ι → G → E' l : Filter ι x₀ : G z₀ : E' φ : ι → G → ℝ k : ι → G hnφ : ∀ᶠ (i : ι) in l, ∀ (x : G), 0 ≤ φ i x hiφ : ∀ᶠ (i : ι) in l, ∫ (x : G), φ i x ∂μ = 1 hmg : ∀ᶠ (i : ι) in l, AEStronglyMeasurable (g i) μ hk : Tendsto k l (𝓝 x₀) hφ : ∀ (t : Set G), t ∈ 𝓝 0 → ∀ᶠ (x : ι) in l, support (φ x) ⊆ t hcg : ∀ (ε : ℝ), ε > 0 → ∃ pa, (∀ᶠ (i : ι) in l, pa i) ∧ ∃ ε_1, ε_1 > 0 ∧ ∀ {i : ι}, pa i → ∀ {x : G}, dist x x₀ < ε_1 → dist (uncurry g (i, x)) z₀ < ε ε : ℝ hε : ε > 0 h2ε : 0 < ε / 3 p : ι → Prop hp : ∀ᶠ (i : ι) in l, p i δ : ℝ hδ : δ > 0 hgδ : ∀ {i : ι}, p i → ∀ {x : G}, dist x x₀ < δ → dist (g i x) z₀ < ε / 3 ⊢ ∀ᶠ (x : ι) in l, dist (φ x ⋆[lsmul ℝ ℝ, k x] g x) z₀ < ε [PROOFSTEP] have h2k := hk.eventually (ball_mem_nhds x₀ <| half_pos hδ) [GOAL] case intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : SeminormedAddCommGroup G inst✝⁶ : BorelSpace G inst✝⁵ : SecondCountableTopology G inst✝⁴ : IsAddLeftInvariant μ inst✝³ : SigmaFinite μ inst✝² : NormedSpace ℝ E inst✝¹ : NormedSpace ℝ E' inst✝ : CompleteSpace E' ι : Type u_1 g : ι → G → E' l : Filter ι x₀ : G z₀ : E' φ : ι → G → ℝ k : ι → G hnφ : ∀ᶠ (i : ι) in l, ∀ (x : G), 0 ≤ φ i x hiφ : ∀ᶠ (i : ι) in l, ∫ (x : G), φ i x ∂μ = 1 hmg : ∀ᶠ (i : ι) in l, AEStronglyMeasurable (g i) μ hk : Tendsto k l (𝓝 x₀) hφ : ∀ (t : Set G), t ∈ 𝓝 0 → ∀ᶠ (x : ι) in l, support (φ x) ⊆ t hcg : ∀ (ε : ℝ), ε > 0 → ∃ pa, (∀ᶠ (i : ι) in l, pa i) ∧ ∃ ε_1, ε_1 > 0 ∧ ∀ {i : ι}, pa i → ∀ {x : G}, dist x x₀ < ε_1 → dist (uncurry g (i, x)) z₀ < ε ε : ℝ hε : ε > 0 h2ε : 0 < ε / 3 p : ι → Prop hp : ∀ᶠ (i : ι) in l, p i δ : ℝ hδ : δ > 0 hgδ : ∀ {i : ι}, p i → ∀ {x : G}, dist x x₀ < δ → dist (g i x) z₀ < ε / 3 h2k : ∀ᶠ (x : ι) in l, dist (k x) x₀ < δ / 2 ⊢ ∀ᶠ (x : ι) in l, dist (φ x ⋆[lsmul ℝ ℝ, k x] g x) z₀ < ε [PROOFSTEP] have h2φ := hφ (ball (0 : G) _) <| ball_mem_nhds _ (half_pos hδ) [GOAL] case intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : SeminormedAddCommGroup G inst✝⁶ : BorelSpace G inst✝⁵ : SecondCountableTopology G inst✝⁴ : IsAddLeftInvariant μ inst✝³ : SigmaFinite μ inst✝² : NormedSpace ℝ E inst✝¹ : NormedSpace ℝ E' inst✝ : CompleteSpace E' ι : Type u_1 g : ι → G → E' l : Filter ι x₀ : G z₀ : E' φ : ι → G → ℝ k : ι → G hnφ : ∀ᶠ (i : ι) in l, ∀ (x : G), 0 ≤ φ i x hiφ : ∀ᶠ (i : ι) in l, ∫ (x : G), φ i x ∂μ = 1 hmg : ∀ᶠ (i : ι) in l, AEStronglyMeasurable (g i) μ hk : Tendsto k l (𝓝 x₀) hφ : ∀ (t : Set G), t ∈ 𝓝 0 → ∀ᶠ (x : ι) in l, support (φ x) ⊆ t hcg : ∀ (ε : ℝ), ε > 0 → ∃ pa, (∀ᶠ (i : ι) in l, pa i) ∧ ∃ ε_1, ε_1 > 0 ∧ ∀ {i : ι}, pa i → ∀ {x : G}, dist x x₀ < ε_1 → dist (uncurry g (i, x)) z₀ < ε ε : ℝ hε : ε > 0 h2ε : 0 < ε / 3 p : ι → Prop hp : ∀ᶠ (i : ι) in l, p i δ : ℝ hδ : δ > 0 hgδ : ∀ {i : ι}, p i → ∀ {x : G}, dist x x₀ < δ → dist (g i x) z₀ < ε / 3 h2k : ∀ᶠ (x : ι) in l, dist (k x) x₀ < δ / 2 h2φ : ∀ᶠ (x : ι) in l, support (φ x) ⊆ ball 0 (δ / 2) ⊢ ∀ᶠ (x : ι) in l, dist (φ x ⋆[lsmul ℝ ℝ, k x] g x) z₀ < ε [PROOFSTEP] filter_upwards [hp, h2k, h2φ, hnφ, hiφ, hmg] with i hpi hki hφi hnφi hiφi hmgi [GOAL] case h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : SeminormedAddCommGroup G inst✝⁶ : BorelSpace G inst✝⁵ : SecondCountableTopology G inst✝⁴ : IsAddLeftInvariant μ inst✝³ : SigmaFinite μ inst✝² : NormedSpace ℝ E inst✝¹ : NormedSpace ℝ E' inst✝ : CompleteSpace E' ι : Type u_1 g : ι → G → E' l : Filter ι x₀ : G z₀ : E' φ : ι → G → ℝ k : ι → G hnφ : ∀ᶠ (i : ι) in l, ∀ (x : G), 0 ≤ φ i x hiφ : ∀ᶠ (i : ι) in l, ∫ (x : G), φ i x ∂μ = 1 hmg : ∀ᶠ (i : ι) in l, AEStronglyMeasurable (g i) μ hk : Tendsto k l (𝓝 x₀) hφ : ∀ (t : Set G), t ∈ 𝓝 0 → ∀ᶠ (x : ι) in l, support (φ x) ⊆ t hcg : ∀ (ε : ℝ), ε > 0 → ∃ pa, (∀ᶠ (i : ι) in l, pa i) ∧ ∃ ε_1, ε_1 > 0 ∧ ∀ {i : ι}, pa i → ∀ {x : G}, dist x x₀ < ε_1 → dist (uncurry g (i, x)) z₀ < ε ε : ℝ hε : ε > 0 h2ε : 0 < ε / 3 p : ι → Prop hp : ∀ᶠ (i : ι) in l, p i δ : ℝ hδ : δ > 0 hgδ : ∀ {i : ι}, p i → ∀ {x : G}, dist x x₀ < δ → dist (g i x) z₀ < ε / 3 h2k : ∀ᶠ (x : ι) in l, dist (k x) x₀ < δ / 2 h2φ : ∀ᶠ (x : ι) in l, support (φ x) ⊆ ball 0 (δ / 2) i : ι hpi : p i hki : dist (k i) x₀ < δ / 2 hφi : support (φ i) ⊆ ball 0 (δ / 2) hnφi : ∀ (x : G), 0 ≤ φ i x hiφi : ∫ (x : G), φ i x ∂μ = 1 hmgi : AEStronglyMeasurable (g i) μ ⊢ dist (φ i ⋆[lsmul ℝ ℝ, k i] g i) z₀ < ε [PROOFSTEP] have hgi : dist (g i (k i)) z₀ < ε / 3 := hgδ hpi (hki.trans <| half_lt_self hδ) [GOAL] case h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : SeminormedAddCommGroup G inst✝⁶ : BorelSpace G inst✝⁵ : SecondCountableTopology G inst✝⁴ : IsAddLeftInvariant μ inst✝³ : SigmaFinite μ inst✝² : NormedSpace ℝ E inst✝¹ : NormedSpace ℝ E' inst✝ : CompleteSpace E' ι : Type u_1 g : ι → G → E' l : Filter ι x₀ : G z₀ : E' φ : ι → G → ℝ k : ι → G hnφ : ∀ᶠ (i : ι) in l, ∀ (x : G), 0 ≤ φ i x hiφ : ∀ᶠ (i : ι) in l, ∫ (x : G), φ i x ∂μ = 1 hmg : ∀ᶠ (i : ι) in l, AEStronglyMeasurable (g i) μ hk : Tendsto k l (𝓝 x₀) hφ : ∀ (t : Set G), t ∈ 𝓝 0 → ∀ᶠ (x : ι) in l, support (φ x) ⊆ t hcg : ∀ (ε : ℝ), ε > 0 → ∃ pa, (∀ᶠ (i : ι) in l, pa i) ∧ ∃ ε_1, ε_1 > 0 ∧ ∀ {i : ι}, pa i → ∀ {x : G}, dist x x₀ < ε_1 → dist (uncurry g (i, x)) z₀ < ε ε : ℝ hε : ε > 0 h2ε : 0 < ε / 3 p : ι → Prop hp : ∀ᶠ (i : ι) in l, p i δ : ℝ hδ : δ > 0 hgδ : ∀ {i : ι}, p i → ∀ {x : G}, dist x x₀ < δ → dist (g i x) z₀ < ε / 3 h2k : ∀ᶠ (x : ι) in l, dist (k x) x₀ < δ / 2 h2φ : ∀ᶠ (x : ι) in l, support (φ x) ⊆ ball 0 (δ / 2) i : ι hpi : p i hki : dist (k i) x₀ < δ / 2 hφi : support (φ i) ⊆ ball 0 (δ / 2) hnφi : ∀ (x : G), 0 ≤ φ i x hiφi : ∫ (x : G), φ i x ∂μ = 1 hmgi : AEStronglyMeasurable (g i) μ hgi : dist (g i (k i)) z₀ < ε / 3 ⊢ dist (φ i ⋆[lsmul ℝ ℝ, k i] g i) z₀ < ε [PROOFSTEP] have h1 : ∀ x' ∈ ball (k i) (δ / 2), dist (g i x') (g i (k i)) ≤ ε / 3 + ε / 3 := by intro x' hx' refine' (dist_triangle_right _ _ _).trans (add_le_add (hgδ hpi _).le hgi.le) exact ((dist_triangle _ _ _).trans_lt (add_lt_add hx'.out hki)).trans_eq (add_halves δ) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : SeminormedAddCommGroup G inst✝⁶ : BorelSpace G inst✝⁵ : SecondCountableTopology G inst✝⁴ : IsAddLeftInvariant μ inst✝³ : SigmaFinite μ inst✝² : NormedSpace ℝ E inst✝¹ : NormedSpace ℝ E' inst✝ : CompleteSpace E' ι : Type u_1 g : ι → G → E' l : Filter ι x₀ : G z₀ : E' φ : ι → G → ℝ k : ι → G hnφ : ∀ᶠ (i : ι) in l, ∀ (x : G), 0 ≤ φ i x hiφ : ∀ᶠ (i : ι) in l, ∫ (x : G), φ i x ∂μ = 1 hmg : ∀ᶠ (i : ι) in l, AEStronglyMeasurable (g i) μ hk : Tendsto k l (𝓝 x₀) hφ : ∀ (t : Set G), t ∈ 𝓝 0 → ∀ᶠ (x : ι) in l, support (φ x) ⊆ t hcg : ∀ (ε : ℝ), ε > 0 → ∃ pa, (∀ᶠ (i : ι) in l, pa i) ∧ ∃ ε_1, ε_1 > 0 ∧ ∀ {i : ι}, pa i → ∀ {x : G}, dist x x₀ < ε_1 → dist (uncurry g (i, x)) z₀ < ε ε : ℝ hε : ε > 0 h2ε : 0 < ε / 3 p : ι → Prop hp : ∀ᶠ (i : ι) in l, p i δ : ℝ hδ : δ > 0 hgδ : ∀ {i : ι}, p i → ∀ {x : G}, dist x x₀ < δ → dist (g i x) z₀ < ε / 3 h2k : ∀ᶠ (x : ι) in l, dist (k x) x₀ < δ / 2 h2φ : ∀ᶠ (x : ι) in l, support (φ x) ⊆ ball 0 (δ / 2) i : ι hpi : p i hki : dist (k i) x₀ < δ / 2 hφi : support (φ i) ⊆ ball 0 (δ / 2) hnφi : ∀ (x : G), 0 ≤ φ i x hiφi : ∫ (x : G), φ i x ∂μ = 1 hmgi : AEStronglyMeasurable (g i) μ hgi : dist (g i (k i)) z₀ < ε / 3 ⊢ ∀ (x' : G), x' ∈ ball (k i) (δ / 2) → dist (g i x') (g i (k i)) ≤ ε / 3 + ε / 3 [PROOFSTEP] intro x' hx' [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x'✝ : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : SeminormedAddCommGroup G inst✝⁶ : BorelSpace G inst✝⁵ : SecondCountableTopology G inst✝⁴ : IsAddLeftInvariant μ inst✝³ : SigmaFinite μ inst✝² : NormedSpace ℝ E inst✝¹ : NormedSpace ℝ E' inst✝ : CompleteSpace E' ι : Type u_1 g : ι → G → E' l : Filter ι x₀ : G z₀ : E' φ : ι → G → ℝ k : ι → G hnφ : ∀ᶠ (i : ι) in l, ∀ (x : G), 0 ≤ φ i x hiφ : ∀ᶠ (i : ι) in l, ∫ (x : G), φ i x ∂μ = 1 hmg : ∀ᶠ (i : ι) in l, AEStronglyMeasurable (g i) μ hk : Tendsto k l (𝓝 x₀) hφ : ∀ (t : Set G), t ∈ 𝓝 0 → ∀ᶠ (x : ι) in l, support (φ x) ⊆ t hcg : ∀ (ε : ℝ), ε > 0 → ∃ pa, (∀ᶠ (i : ι) in l, pa i) ∧ ∃ ε_1, ε_1 > 0 ∧ ∀ {i : ι}, pa i → ∀ {x : G}, dist x x₀ < ε_1 → dist (uncurry g (i, x)) z₀ < ε ε : ℝ hε : ε > 0 h2ε : 0 < ε / 3 p : ι → Prop hp : ∀ᶠ (i : ι) in l, p i δ : ℝ hδ : δ > 0 hgδ : ∀ {i : ι}, p i → ∀ {x : G}, dist x x₀ < δ → dist (g i x) z₀ < ε / 3 h2k : ∀ᶠ (x : ι) in l, dist (k x) x₀ < δ / 2 h2φ : ∀ᶠ (x : ι) in l, support (φ x) ⊆ ball 0 (δ / 2) i : ι hpi : p i hki : dist (k i) x₀ < δ / 2 hφi : support (φ i) ⊆ ball 0 (δ / 2) hnφi : ∀ (x : G), 0 ≤ φ i x hiφi : ∫ (x : G), φ i x ∂μ = 1 hmgi : AEStronglyMeasurable (g i) μ hgi : dist (g i (k i)) z₀ < ε / 3 x' : G hx' : x' ∈ ball (k i) (δ / 2) ⊢ dist (g i x') (g i (k i)) ≤ ε / 3 + ε / 3 [PROOFSTEP] refine' (dist_triangle_right _ _ _).trans (add_le_add (hgδ hpi _).le hgi.le) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x'✝ : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : SeminormedAddCommGroup G inst✝⁶ : BorelSpace G inst✝⁵ : SecondCountableTopology G inst✝⁴ : IsAddLeftInvariant μ inst✝³ : SigmaFinite μ inst✝² : NormedSpace ℝ E inst✝¹ : NormedSpace ℝ E' inst✝ : CompleteSpace E' ι : Type u_1 g : ι → G → E' l : Filter ι x₀ : G z₀ : E' φ : ι → G → ℝ k : ι → G hnφ : ∀ᶠ (i : ι) in l, ∀ (x : G), 0 ≤ φ i x hiφ : ∀ᶠ (i : ι) in l, ∫ (x : G), φ i x ∂μ = 1 hmg : ∀ᶠ (i : ι) in l, AEStronglyMeasurable (g i) μ hk : Tendsto k l (𝓝 x₀) hφ : ∀ (t : Set G), t ∈ 𝓝 0 → ∀ᶠ (x : ι) in l, support (φ x) ⊆ t hcg : ∀ (ε : ℝ), ε > 0 → ∃ pa, (∀ᶠ (i : ι) in l, pa i) ∧ ∃ ε_1, ε_1 > 0 ∧ ∀ {i : ι}, pa i → ∀ {x : G}, dist x x₀ < ε_1 → dist (uncurry g (i, x)) z₀ < ε ε : ℝ hε : ε > 0 h2ε : 0 < ε / 3 p : ι → Prop hp : ∀ᶠ (i : ι) in l, p i δ : ℝ hδ : δ > 0 hgδ : ∀ {i : ι}, p i → ∀ {x : G}, dist x x₀ < δ → dist (g i x) z₀ < ε / 3 h2k : ∀ᶠ (x : ι) in l, dist (k x) x₀ < δ / 2 h2φ : ∀ᶠ (x : ι) in l, support (φ x) ⊆ ball 0 (δ / 2) i : ι hpi : p i hki : dist (k i) x₀ < δ / 2 hφi : support (φ i) ⊆ ball 0 (δ / 2) hnφi : ∀ (x : G), 0 ≤ φ i x hiφi : ∫ (x : G), φ i x ∂μ = 1 hmgi : AEStronglyMeasurable (g i) μ hgi : dist (g i (k i)) z₀ < ε / 3 x' : G hx' : x' ∈ ball (k i) (δ / 2) ⊢ dist x' x₀ < δ [PROOFSTEP] exact ((dist_triangle _ _ _).trans_lt (add_lt_add hx'.out hki)).trans_eq (add_halves δ) [GOAL] case h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : SeminormedAddCommGroup G inst✝⁶ : BorelSpace G inst✝⁵ : SecondCountableTopology G inst✝⁴ : IsAddLeftInvariant μ inst✝³ : SigmaFinite μ inst✝² : NormedSpace ℝ E inst✝¹ : NormedSpace ℝ E' inst✝ : CompleteSpace E' ι : Type u_1 g : ι → G → E' l : Filter ι x₀ : G z₀ : E' φ : ι → G → ℝ k : ι → G hnφ : ∀ᶠ (i : ι) in l, ∀ (x : G), 0 ≤ φ i x hiφ : ∀ᶠ (i : ι) in l, ∫ (x : G), φ i x ∂μ = 1 hmg : ∀ᶠ (i : ι) in l, AEStronglyMeasurable (g i) μ hk : Tendsto k l (𝓝 x₀) hφ : ∀ (t : Set G), t ∈ 𝓝 0 → ∀ᶠ (x : ι) in l, support (φ x) ⊆ t hcg : ∀ (ε : ℝ), ε > 0 → ∃ pa, (∀ᶠ (i : ι) in l, pa i) ∧ ∃ ε_1, ε_1 > 0 ∧ ∀ {i : ι}, pa i → ∀ {x : G}, dist x x₀ < ε_1 → dist (uncurry g (i, x)) z₀ < ε ε : ℝ hε : ε > 0 h2ε : 0 < ε / 3 p : ι → Prop hp : ∀ᶠ (i : ι) in l, p i δ : ℝ hδ : δ > 0 hgδ : ∀ {i : ι}, p i → ∀ {x : G}, dist x x₀ < δ → dist (g i x) z₀ < ε / 3 h2k : ∀ᶠ (x : ι) in l, dist (k x) x₀ < δ / 2 h2φ : ∀ᶠ (x : ι) in l, support (φ x) ⊆ ball 0 (δ / 2) i : ι hpi : p i hki : dist (k i) x₀ < δ / 2 hφi : support (φ i) ⊆ ball 0 (δ / 2) hnφi : ∀ (x : G), 0 ≤ φ i x hiφi : ∫ (x : G), φ i x ∂μ = 1 hmgi : AEStronglyMeasurable (g i) μ hgi : dist (g i (k i)) z₀ < ε / 3 h1 : ∀ (x' : G), x' ∈ ball (k i) (δ / 2) → dist (g i x') (g i (k i)) ≤ ε / 3 + ε / 3 ⊢ dist (φ i ⋆[lsmul ℝ ℝ, k i] g i) z₀ < ε [PROOFSTEP] have := dist_convolution_le (add_pos h2ε h2ε).le hφi hnφi hiφi hmgi h1 [GOAL] case h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : SeminormedAddCommGroup G inst✝⁶ : BorelSpace G inst✝⁵ : SecondCountableTopology G inst✝⁴ : IsAddLeftInvariant μ inst✝³ : SigmaFinite μ inst✝² : NormedSpace ℝ E inst✝¹ : NormedSpace ℝ E' inst✝ : CompleteSpace E' ι : Type u_1 g : ι → G → E' l : Filter ι x₀ : G z₀ : E' φ : ι → G → ℝ k : ι → G hnφ : ∀ᶠ (i : ι) in l, ∀ (x : G), 0 ≤ φ i x hiφ : ∀ᶠ (i : ι) in l, ∫ (x : G), φ i x ∂μ = 1 hmg : ∀ᶠ (i : ι) in l, AEStronglyMeasurable (g i) μ hk : Tendsto k l (𝓝 x₀) hφ : ∀ (t : Set G), t ∈ 𝓝 0 → ∀ᶠ (x : ι) in l, support (φ x) ⊆ t hcg : ∀ (ε : ℝ), ε > 0 → ∃ pa, (∀ᶠ (i : ι) in l, pa i) ∧ ∃ ε_1, ε_1 > 0 ∧ ∀ {i : ι}, pa i → ∀ {x : G}, dist x x₀ < ε_1 → dist (uncurry g (i, x)) z₀ < ε ε : ℝ hε : ε > 0 h2ε : 0 < ε / 3 p : ι → Prop hp : ∀ᶠ (i : ι) in l, p i δ : ℝ hδ : δ > 0 hgδ : ∀ {i : ι}, p i → ∀ {x : G}, dist x x₀ < δ → dist (g i x) z₀ < ε / 3 h2k : ∀ᶠ (x : ι) in l, dist (k x) x₀ < δ / 2 h2φ : ∀ᶠ (x : ι) in l, support (φ x) ⊆ ball 0 (δ / 2) i : ι hpi : p i hki : dist (k i) x₀ < δ / 2 hφi : support (φ i) ⊆ ball 0 (δ / 2) hnφi : ∀ (x : G), 0 ≤ φ i x hiφi : ∫ (x : G), φ i x ∂μ = 1 hmgi : AEStronglyMeasurable (g i) μ hgi : dist (g i (k i)) z₀ < ε / 3 h1 : ∀ (x' : G), x' ∈ ball (k i) (δ / 2) → dist (g i x') (g i (k i)) ≤ ε / 3 + ε / 3 this : dist (φ i ⋆[lsmul ℝ ℝ, k i] g i) (g i (k i)) ≤ ε / 3 + ε / 3 ⊢ dist (φ i ⋆[lsmul ℝ ℝ, k i] g i) z₀ < ε [PROOFSTEP] refine' ((dist_triangle _ _ _).trans_lt (add_lt_add_of_le_of_lt this hgi)).trans_eq _ [GOAL] case h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : SeminormedAddCommGroup G inst✝⁶ : BorelSpace G inst✝⁵ : SecondCountableTopology G inst✝⁴ : IsAddLeftInvariant μ inst✝³ : SigmaFinite μ inst✝² : NormedSpace ℝ E inst✝¹ : NormedSpace ℝ E' inst✝ : CompleteSpace E' ι : Type u_1 g : ι → G → E' l : Filter ι x₀ : G z₀ : E' φ : ι → G → ℝ k : ι → G hnφ : ∀ᶠ (i : ι) in l, ∀ (x : G), 0 ≤ φ i x hiφ : ∀ᶠ (i : ι) in l, ∫ (x : G), φ i x ∂μ = 1 hmg : ∀ᶠ (i : ι) in l, AEStronglyMeasurable (g i) μ hk : Tendsto k l (𝓝 x₀) hφ : ∀ (t : Set G), t ∈ 𝓝 0 → ∀ᶠ (x : ι) in l, support (φ x) ⊆ t hcg : ∀ (ε : ℝ), ε > 0 → ∃ pa, (∀ᶠ (i : ι) in l, pa i) ∧ ∃ ε_1, ε_1 > 0 ∧ ∀ {i : ι}, pa i → ∀ {x : G}, dist x x₀ < ε_1 → dist (uncurry g (i, x)) z₀ < ε ε : ℝ hε : ε > 0 h2ε : 0 < ε / 3 p : ι → Prop hp : ∀ᶠ (i : ι) in l, p i δ : ℝ hδ : δ > 0 hgδ : ∀ {i : ι}, p i → ∀ {x : G}, dist x x₀ < δ → dist (g i x) z₀ < ε / 3 h2k : ∀ᶠ (x : ι) in l, dist (k x) x₀ < δ / 2 h2φ : ∀ᶠ (x : ι) in l, support (φ x) ⊆ ball 0 (δ / 2) i : ι hpi : p i hki : dist (k i) x₀ < δ / 2 hφi : support (φ i) ⊆ ball 0 (δ / 2) hnφi : ∀ (x : G), 0 ≤ φ i x hiφi : ∫ (x : G), φ i x ∂μ = 1 hmgi : AEStronglyMeasurable (g i) μ hgi : dist (g i (k i)) z₀ < ε / 3 h1 : ∀ (x' : G), x' ∈ ball (k i) (δ / 2) → dist (g i x') (g i (k i)) ≤ ε / 3 + ε / 3 this : dist (φ i ⋆[lsmul ℝ ℝ, k i] g i) (g i (k i)) ≤ ε / 3 + ε / 3 ⊢ ε / 3 + ε / 3 + ε / 3 = ε [PROOFSTEP] field_simp [GOAL] case h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁹ : NormedAddCommGroup E inst✝¹⁸ : NormedAddCommGroup E' inst✝¹⁷ : NormedAddCommGroup E'' inst✝¹⁶ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁵ : NontriviallyNormedField 𝕜 inst✝¹⁴ : NormedSpace 𝕜 E inst✝¹³ : NormedSpace 𝕜 E' inst✝¹² : NormedSpace 𝕜 E'' inst✝¹¹ : NormedSpace 𝕜 F L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁰ : MeasurableSpace G μ ν : Measure G inst✝⁹ : NormedSpace ℝ F inst✝⁸ : CompleteSpace F inst✝⁷ : SeminormedAddCommGroup G inst✝⁶ : BorelSpace G inst✝⁵ : SecondCountableTopology G inst✝⁴ : IsAddLeftInvariant μ inst✝³ : SigmaFinite μ inst✝² : NormedSpace ℝ E inst✝¹ : NormedSpace ℝ E' inst✝ : CompleteSpace E' ι : Type u_1 g : ι → G → E' l : Filter ι x₀ : G z₀ : E' φ : ι → G → ℝ k : ι → G hnφ : ∀ᶠ (i : ι) in l, ∀ (x : G), 0 ≤ φ i x hiφ : ∀ᶠ (i : ι) in l, ∫ (x : G), φ i x ∂μ = 1 hmg : ∀ᶠ (i : ι) in l, AEStronglyMeasurable (g i) μ hk : Tendsto k l (𝓝 x₀) hφ : ∀ (t : Set G), t ∈ 𝓝 0 → ∀ᶠ (x : ι) in l, support (φ x) ⊆ t hcg : ∀ (ε : ℝ), ε > 0 → ∃ pa, (∀ᶠ (i : ι) in l, pa i) ∧ ∃ ε_1, ε_1 > 0 ∧ ∀ {i : ι}, pa i → ∀ {x : G}, dist x x₀ < ε_1 → dist (uncurry g (i, x)) z₀ < ε ε : ℝ hε : ε > 0 h2ε : 0 < ε / 3 p : ι → Prop hp : ∀ᶠ (i : ι) in l, p i δ : ℝ hδ : δ > 0 hgδ : ∀ {i : ι}, p i → ∀ {x : G}, dist x x₀ < δ → dist (g i x) z₀ < ε / 3 h2k : ∀ᶠ (x : ι) in l, dist (k x) x₀ < δ / 2 h2φ : ∀ᶠ (x : ι) in l, support (φ x) ⊆ ball 0 (δ / 2) i : ι hpi : p i hki : dist (k i) x₀ < δ / 2 hφi : support (φ i) ⊆ ball 0 (δ / 2) hnφi : ∀ (x : G), 0 ≤ φ i x hiφi : ∫ (x : G), φ i x ∂μ = 1 hmgi : AEStronglyMeasurable (g i) μ hgi : dist (g i (k i)) z₀ < ε / 3 h1 : ∀ (x' : G), x' ∈ ball (k i) (δ / 2) → dist (g i x') (g i (k i)) ≤ ε / 3 + ε / 3 this : dist (φ i ⋆[lsmul ℝ ℝ, k i] g i) (g i (k i)) ≤ ε / 3 + ε / 3 ⊢ ε + ε + ε = ε * 3 [PROOFSTEP] ring_nf [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁹ : NormedAddCommGroup E inst✝²⁸ : NormedAddCommGroup E' inst✝²⁷ : NormedAddCommGroup E'' inst✝²⁶ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²⁵ : IsROrC 𝕜 inst✝²⁴ : NormedSpace 𝕜 E inst✝²³ : NormedSpace 𝕜 E' inst✝²² : NormedSpace 𝕜 E'' inst✝²¹ : NormedSpace ℝ F inst✝²⁰ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁹ : CompleteSpace F inst✝¹⁸ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁷ : NormedAddCommGroup F' inst✝¹⁶ : NormedSpace ℝ F' inst✝¹⁵ : NormedSpace 𝕜 F' inst✝¹⁴ : CompleteSpace F' inst✝¹³ : NormedAddCommGroup F'' inst✝¹² : NormedSpace ℝ F'' inst✝¹¹ : NormedSpace 𝕜 F'' inst✝¹⁰ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁹ : AddGroup G inst✝⁸ : SigmaFinite μ inst✝⁷ : SigmaFinite ν inst✝⁶ : IsAddRightInvariant μ inst✝⁵ : MeasurableAdd₂ G inst✝⁴ : MeasurableNeg G inst✝³ : NormedSpace ℝ E inst✝² : NormedSpace ℝ E' inst✝¹ : CompleteSpace E inst✝ : CompleteSpace E' hf : Integrable f hg : Integrable g ⊢ ∫ (x : G), f ⋆[L, x] g ∂μ = ↑(↑L (∫ (x : G), f x ∂ν)) (∫ (x : G), g x ∂μ) [PROOFSTEP] refine' (integral_integral_swap (by apply hf.convolution_integrand L hg)).trans _ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁹ : NormedAddCommGroup E inst✝²⁸ : NormedAddCommGroup E' inst✝²⁷ : NormedAddCommGroup E'' inst✝²⁶ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²⁵ : IsROrC 𝕜 inst✝²⁴ : NormedSpace 𝕜 E inst✝²³ : NormedSpace 𝕜 E' inst✝²² : NormedSpace 𝕜 E'' inst✝²¹ : NormedSpace ℝ F inst✝²⁰ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁹ : CompleteSpace F inst✝¹⁸ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁷ : NormedAddCommGroup F' inst✝¹⁶ : NormedSpace ℝ F' inst✝¹⁵ : NormedSpace 𝕜 F' inst✝¹⁴ : CompleteSpace F' inst✝¹³ : NormedAddCommGroup F'' inst✝¹² : NormedSpace ℝ F'' inst✝¹¹ : NormedSpace 𝕜 F'' inst✝¹⁰ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁹ : AddGroup G inst✝⁸ : SigmaFinite μ inst✝⁷ : SigmaFinite ν inst✝⁶ : IsAddRightInvariant μ inst✝⁵ : MeasurableAdd₂ G inst✝⁴ : MeasurableNeg G inst✝³ : NormedSpace ℝ E inst✝² : NormedSpace ℝ E' inst✝¹ : CompleteSpace E inst✝ : CompleteSpace E' hf : Integrable f hg : Integrable g ⊢ Integrable (uncurry fun x t => ↑(↑L (f t)) (g (x - t))) [PROOFSTEP] apply hf.convolution_integrand L hg [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁹ : NormedAddCommGroup E inst✝²⁸ : NormedAddCommGroup E' inst✝²⁷ : NormedAddCommGroup E'' inst✝²⁶ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²⁵ : IsROrC 𝕜 inst✝²⁴ : NormedSpace 𝕜 E inst✝²³ : NormedSpace 𝕜 E' inst✝²² : NormedSpace 𝕜 E'' inst✝²¹ : NormedSpace ℝ F inst✝²⁰ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁹ : CompleteSpace F inst✝¹⁸ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁷ : NormedAddCommGroup F' inst✝¹⁶ : NormedSpace ℝ F' inst✝¹⁵ : NormedSpace 𝕜 F' inst✝¹⁴ : CompleteSpace F' inst✝¹³ : NormedAddCommGroup F'' inst✝¹² : NormedSpace ℝ F'' inst✝¹¹ : NormedSpace 𝕜 F'' inst✝¹⁰ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁹ : AddGroup G inst✝⁸ : SigmaFinite μ inst✝⁷ : SigmaFinite ν inst✝⁶ : IsAddRightInvariant μ inst✝⁵ : MeasurableAdd₂ G inst✝⁴ : MeasurableNeg G inst✝³ : NormedSpace ℝ E inst✝² : NormedSpace ℝ E' inst✝¹ : CompleteSpace E inst✝ : CompleteSpace E' hf : Integrable f hg : Integrable g ⊢ ∫ (y : G), ∫ (x : G), ↑(↑L (f y)) (g (x - y)) ∂μ ∂ν = ↑(↑L (∫ (x : G), f x ∂ν)) (∫ (x : G), g x ∂μ) [PROOFSTEP] simp_rw [integral_comp_comm _ (hg.comp_sub_right _), integral_sub_right_eq_self] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁹ : NormedAddCommGroup E inst✝²⁸ : NormedAddCommGroup E' inst✝²⁷ : NormedAddCommGroup E'' inst✝²⁶ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²⁵ : IsROrC 𝕜 inst✝²⁴ : NormedSpace 𝕜 E inst✝²³ : NormedSpace 𝕜 E' inst✝²² : NormedSpace 𝕜 E'' inst✝²¹ : NormedSpace ℝ F inst✝²⁰ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁹ : CompleteSpace F inst✝¹⁸ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁷ : NormedAddCommGroup F' inst✝¹⁶ : NormedSpace ℝ F' inst✝¹⁵ : NormedSpace 𝕜 F' inst✝¹⁴ : CompleteSpace F' inst✝¹³ : NormedAddCommGroup F'' inst✝¹² : NormedSpace ℝ F'' inst✝¹¹ : NormedSpace 𝕜 F'' inst✝¹⁰ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁹ : AddGroup G inst✝⁸ : SigmaFinite μ inst✝⁷ : SigmaFinite ν inst✝⁶ : IsAddRightInvariant μ inst✝⁵ : MeasurableAdd₂ G inst✝⁴ : MeasurableNeg G inst✝³ : NormedSpace ℝ E inst✝² : NormedSpace ℝ E' inst✝¹ : CompleteSpace E inst✝ : CompleteSpace E' hf : Integrable f hg : Integrable g ⊢ ∫ (y : G), ↑(↑L (f y)) (∫ (x : G), g x ∂μ) ∂ν = ↑(↑L (∫ (x : G), f x ∂ν)) (∫ (x : G), g x ∂μ) [PROOFSTEP] exact (L.flip (∫ x, g x ∂μ)).integral_comp_comm hf [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt g k x L₄ hi : Integrable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g (x - y))) (k (x₀ - x)))) ⊢ ∫ (t : G), ∫ (s : G), ↑(↑L₂ (↑(↑L (f s)) (g (t - s)))) (k (x₀ - t)) ∂ν ∂μ = ∫ (t : G), ∫ (s : G), ↑(↑L₃ (f s)) (↑(↑L₄ (g (t - s))) (k (x₀ - t))) ∂ν ∂μ [PROOFSTEP] simp_rw [hL] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt g k x L₄ hi : Integrable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g (x - y))) (k (x₀ - x)))) ⊢ ∫ (t : G), ∫ (s : G), ↑(↑L₃ (f s)) (↑(↑L₄ (g (t - s))) (k (x₀ - t))) ∂ν ∂μ = ∫ (s : G), ∫ (t : G), ↑(↑L₃ (f s)) (↑(↑L₄ (g (t - s))) (k (x₀ - t))) ∂μ ∂ν [PROOFSTEP] rw [integral_integral_swap hi] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt g k x L₄ hi : Integrable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g (x - y))) (k (x₀ - x)))) ⊢ ∫ (s : G), ∫ (t : G), ↑(↑L₃ (f s)) (↑(↑L₄ (g (t - s))) (k (x₀ - t))) ∂μ ∂ν = ∫ (s : G), ∫ (u : G), ↑(↑L₃ (f s)) (↑(↑L₄ (g u)) (k (x₀ - s - u))) ∂μ ∂ν [PROOFSTEP] congr [GOAL] case e_f 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt g k x L₄ hi : Integrable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g (x - y))) (k (x₀ - x)))) ⊢ (fun s => ∫ (t : G), ↑(↑L₃ (f s)) (↑(↑L₄ (g (t - s))) (k (x₀ - t))) ∂μ) = fun s => ∫ (u : G), ↑(↑L₃ (f s)) (↑(↑L₄ (g u)) (k (x₀ - s - u))) ∂μ [PROOFSTEP] ext t [GOAL] case e_f.h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt g k x L₄ hi : Integrable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g (x - y))) (k (x₀ - x)))) t : G ⊢ ∫ (t_1 : G), ↑(↑L₃ (f t)) (↑(↑L₄ (g (t_1 - t))) (k (x₀ - t_1))) ∂μ = ∫ (u : G), ↑(↑L₃ (f t)) (↑(↑L₄ (g u)) (k (x₀ - t - u))) ∂μ [PROOFSTEP] rw [eq_comm, ← integral_sub_right_eq_self _ t] [GOAL] case e_f.h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt g k x L₄ hi : Integrable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g (x - y))) (k (x₀ - x)))) t : G ⊢ ∫ (x : G), ↑(↑L₃ (f t)) (↑(↑L₄ (g (x - t))) (k (x₀ - t - (x - t)))) ∂μ = ∫ (t_1 : G), ↑(↑L₃ (f t)) (↑(↑L₄ (g (t_1 - t))) (k (x₀ - t_1))) ∂μ [PROOFSTEP] simp_rw [sub_sub_sub_cancel_right] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt g k x L₄ hi : Integrable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g (x - y))) (k (x₀ - x)))) ⊢ ∫ (s : G), ∫ (u : G), ↑(↑L₃ (f s)) (↑(↑L₄ (g u)) (k (x₀ - s - u))) ∂μ ∂ν = ∫ (s : G), ↑(↑L₃ (f s)) (∫ (u : G), ↑(↑L₄ (g u)) (k (x₀ - s - u)) ∂μ) ∂ν [PROOFSTEP] refine' integral_congr_ae _ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt g k x L₄ hi : Integrable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g (x - y))) (k (x₀ - x)))) ⊢ (fun s => ∫ (u : G), ↑(↑L₃ (f s)) (↑(↑L₄ (g u)) (k (x₀ - s - u))) ∂μ) =ᶠ[ae ν] fun s => ↑(↑L₃ (f s)) (∫ (u : G), ↑(↑L₄ (g u)) (k (x₀ - s - u)) ∂μ) [PROOFSTEP] refine' ((quasiMeasurePreserving_sub_left_of_right_invariant ν x₀).ae hgk).mono fun t ht => _ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt g k x L₄ hi : Integrable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g (x - y))) (k (x₀ - x)))) t : G ht : ConvolutionExistsAt g k (x₀ - t) L₄ ⊢ (fun s => ∫ (u : G), ↑(↑L₃ (f s)) (↑(↑L₄ (g u)) (k (x₀ - s - u))) ∂μ) t = (fun s => ↑(↑L₃ (f s)) (∫ (u : G), ↑(↑L₄ (g u)) (k (x₀ - s - u)) ∂μ)) t [PROOFSTEP] exact (L₃ (f t)).integral_comp_comm ht [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hf : AEStronglyMeasurable f ν hg : AEStronglyMeasurable g μ hk : AEStronglyMeasurable k μ hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) x (mul ℝ ℝ) hfgk : ConvolutionExistsAt (fun x => ‖f x‖) (convolution (fun x => ‖g x‖) (fun x => ‖k x‖) (mul ℝ ℝ)) x₀ (mul ℝ ℝ) ⊢ convolution f g L ⋆[L₂, x₀] k = f ⋆[L₃, x₀] convolution g k L₄ [PROOFSTEP] refine' convolution_assoc' L L₂ L₃ L₄ hL hfg (hgk.mono fun x hx => hx.ofNorm L₄ hg hk) _ -- the following is similar to `integrable.convolution_integrand` [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hf : AEStronglyMeasurable f ν hg : AEStronglyMeasurable g μ hk : AEStronglyMeasurable k μ hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) x (mul ℝ ℝ) hfgk : ConvolutionExistsAt (fun x => ‖f x‖) (convolution (fun x => ‖g x‖) (fun x => ‖k x‖) (mul ℝ ℝ)) x₀ (mul ℝ ℝ) ⊢ Integrable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g (x - y))) (k (x₀ - x)))) [PROOFSTEP] have h_meas : AEStronglyMeasurable (uncurry fun x y => L₃ (f y) (L₄ (g x) (k (x₀ - y - x)))) (μ.prod ν) := by refine' L₃.aestronglyMeasurable_comp₂ hf.snd _ refine' L₄.aestronglyMeasurable_comp₂ hg.fst _ refine' (hk.mono' _).comp_measurable ((measurable_const.sub measurable_snd).sub measurable_fst) refine' QuasiMeasurePreserving.absolutelyContinuous _ refine' QuasiMeasurePreserving.prod_of_left ((measurable_const.sub measurable_snd).sub measurable_fst) (eventually_of_forall fun y => _) dsimp only exact quasiMeasurePreserving_sub_left_of_right_invariant μ _ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hf : AEStronglyMeasurable f ν hg : AEStronglyMeasurable g μ hk : AEStronglyMeasurable k μ hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) x (mul ℝ ℝ) hfgk : ConvolutionExistsAt (fun x => ‖f x‖) (convolution (fun x => ‖g x‖) (fun x => ‖k x‖) (mul ℝ ℝ)) x₀ (mul ℝ ℝ) ⊢ AEStronglyMeasurable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) (Measure.prod μ ν) [PROOFSTEP] refine' L₃.aestronglyMeasurable_comp₂ hf.snd _ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hf : AEStronglyMeasurable f ν hg : AEStronglyMeasurable g μ hk : AEStronglyMeasurable k μ hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) x (mul ℝ ℝ) hfgk : ConvolutionExistsAt (fun x => ‖f x‖) (convolution (fun x => ‖g x‖) (fun x => ‖k x‖) (mul ℝ ℝ)) x₀ (mul ℝ ℝ) ⊢ AEStronglyMeasurable (fun x => ↑(↑L₄ (g x.fst)) (k (x₀ - x.snd - x.fst))) (Measure.prod μ ν) [PROOFSTEP] refine' L₄.aestronglyMeasurable_comp₂ hg.fst _ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hf : AEStronglyMeasurable f ν hg : AEStronglyMeasurable g μ hk : AEStronglyMeasurable k μ hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) x (mul ℝ ℝ) hfgk : ConvolutionExistsAt (fun x => ‖f x‖) (convolution (fun x => ‖g x‖) (fun x => ‖k x‖) (mul ℝ ℝ)) x₀ (mul ℝ ℝ) ⊢ AEStronglyMeasurable (fun x => k (x₀ - x.snd - x.fst)) (Measure.prod μ ν) [PROOFSTEP] refine' (hk.mono' _).comp_measurable ((measurable_const.sub measurable_snd).sub measurable_fst) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hf : AEStronglyMeasurable f ν hg : AEStronglyMeasurable g μ hk : AEStronglyMeasurable k μ hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) x (mul ℝ ℝ) hfgk : ConvolutionExistsAt (fun x => ‖f x‖) (convolution (fun x => ‖g x‖) (fun x => ‖k x‖) (mul ℝ ℝ)) x₀ (mul ℝ ℝ) ⊢ Measure.map (fun x => x₀ - x.snd - x.fst) (Measure.prod μ ν) ≪ μ [PROOFSTEP] refine' QuasiMeasurePreserving.absolutelyContinuous _ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hf : AEStronglyMeasurable f ν hg : AEStronglyMeasurable g μ hk : AEStronglyMeasurable k μ hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) x (mul ℝ ℝ) hfgk : ConvolutionExistsAt (fun x => ‖f x‖) (convolution (fun x => ‖g x‖) (fun x => ‖k x‖) (mul ℝ ℝ)) x₀ (mul ℝ ℝ) ⊢ QuasiMeasurePreserving fun x => x₀ - x.snd - x.fst [PROOFSTEP] refine' QuasiMeasurePreserving.prod_of_left ((measurable_const.sub measurable_snd).sub measurable_fst) (eventually_of_forall fun y => _) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y✝ y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hf : AEStronglyMeasurable f ν hg : AEStronglyMeasurable g μ hk : AEStronglyMeasurable k μ hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) x (mul ℝ ℝ) hfgk : ConvolutionExistsAt (fun x => ‖f x‖) (convolution (fun x => ‖g x‖) (fun x => ‖k x‖) (mul ℝ ℝ)) x₀ (mul ℝ ℝ) y : G ⊢ QuasiMeasurePreserving fun x => x₀ - (x, y).snd - (x, y).fst [PROOFSTEP] dsimp only [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y✝ y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hf : AEStronglyMeasurable f ν hg : AEStronglyMeasurable g μ hk : AEStronglyMeasurable k μ hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) x (mul ℝ ℝ) hfgk : ConvolutionExistsAt (fun x => ‖f x‖) (convolution (fun x => ‖g x‖) (fun x => ‖k x‖) (mul ℝ ℝ)) x₀ (mul ℝ ℝ) y : G ⊢ QuasiMeasurePreserving fun x => x₀ - y - x [PROOFSTEP] exact quasiMeasurePreserving_sub_left_of_right_invariant μ _ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hf : AEStronglyMeasurable f ν hg : AEStronglyMeasurable g μ hk : AEStronglyMeasurable k μ hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) x (mul ℝ ℝ) hfgk : ConvolutionExistsAt (fun x => ‖f x‖) (convolution (fun x => ‖g x‖) (fun x => ‖k x‖) (mul ℝ ℝ)) x₀ (mul ℝ ℝ) h_meas : AEStronglyMeasurable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) (Measure.prod μ ν) ⊢ Integrable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g (x - y))) (k (x₀ - x)))) [PROOFSTEP] have h2_meas : AEStronglyMeasurable (fun y => ∫ x, ‖L₃ (f y) (L₄ (g x) (k (x₀ - y - x)))‖ ∂μ) ν := h_meas.prod_swap.norm.integral_prod_right' [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hf : AEStronglyMeasurable f ν hg : AEStronglyMeasurable g μ hk : AEStronglyMeasurable k μ hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) x (mul ℝ ℝ) hfgk : ConvolutionExistsAt (fun x => ‖f x‖) (convolution (fun x => ‖g x‖) (fun x => ‖k x‖) (mul ℝ ℝ)) x₀ (mul ℝ ℝ) h_meas : AEStronglyMeasurable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) (Measure.prod μ ν) h2_meas : AEStronglyMeasurable (fun y => ∫ (x : G), ‖↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))‖ ∂μ) ν ⊢ Integrable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g (x - y))) (k (x₀ - x)))) [PROOFSTEP] have h3 : map (fun z : G × G => (z.1 - z.2, z.2)) (μ.prod ν) = μ.prod ν := (measurePreserving_sub_prod μ ν).map_eq [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hf : AEStronglyMeasurable f ν hg : AEStronglyMeasurable g μ hk : AEStronglyMeasurable k μ hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) x (mul ℝ ℝ) hfgk : ConvolutionExistsAt (fun x => ‖f x‖) (convolution (fun x => ‖g x‖) (fun x => ‖k x‖) (mul ℝ ℝ)) x₀ (mul ℝ ℝ) h_meas : AEStronglyMeasurable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) (Measure.prod μ ν) h2_meas : AEStronglyMeasurable (fun y => ∫ (x : G), ‖↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))‖ ∂μ) ν h3 : Measure.map (fun z => (z.fst - z.snd, z.snd)) (Measure.prod μ ν) = Measure.prod μ ν ⊢ Integrable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g (x - y))) (k (x₀ - x)))) [PROOFSTEP] suffices Integrable (uncurry fun x y => L₃ (f y) (L₄ (g x) (k (x₀ - y - x)))) (μ.prod ν) by rw [← h3] at this convert this.comp_measurable (measurable_sub.prod_mk measurable_snd) ext ⟨x, y⟩ simp_rw [uncurry, Function.comp_apply, sub_sub_sub_cancel_right] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hf : AEStronglyMeasurable f ν hg : AEStronglyMeasurable g μ hk : AEStronglyMeasurable k μ hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) x (mul ℝ ℝ) hfgk : ConvolutionExistsAt (fun x => ‖f x‖) (convolution (fun x => ‖g x‖) (fun x => ‖k x‖) (mul ℝ ℝ)) x₀ (mul ℝ ℝ) h_meas : AEStronglyMeasurable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) (Measure.prod μ ν) h2_meas : AEStronglyMeasurable (fun y => ∫ (x : G), ‖↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))‖ ∂μ) ν h3 : Measure.map (fun z => (z.fst - z.snd, z.snd)) (Measure.prod μ ν) = Measure.prod μ ν this : Integrable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) ⊢ Integrable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g (x - y))) (k (x₀ - x)))) [PROOFSTEP] rw [← h3] at this [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hf : AEStronglyMeasurable f ν hg : AEStronglyMeasurable g μ hk : AEStronglyMeasurable k μ hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) x (mul ℝ ℝ) hfgk : ConvolutionExistsAt (fun x => ‖f x‖) (convolution (fun x => ‖g x‖) (fun x => ‖k x‖) (mul ℝ ℝ)) x₀ (mul ℝ ℝ) h_meas : AEStronglyMeasurable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) (Measure.prod μ ν) h2_meas : AEStronglyMeasurable (fun y => ∫ (x : G), ‖↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))‖ ∂μ) ν h3 : Measure.map (fun z => (z.fst - z.snd, z.snd)) (Measure.prod μ ν) = Measure.prod μ ν this : Integrable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) ⊢ Integrable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g (x - y))) (k (x₀ - x)))) [PROOFSTEP] convert this.comp_measurable (measurable_sub.prod_mk measurable_snd) [GOAL] case h.e'_5 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hf : AEStronglyMeasurable f ν hg : AEStronglyMeasurable g μ hk : AEStronglyMeasurable k μ hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) x (mul ℝ ℝ) hfgk : ConvolutionExistsAt (fun x => ‖f x‖) (convolution (fun x => ‖g x‖) (fun x => ‖k x‖) (mul ℝ ℝ)) x₀ (mul ℝ ℝ) h_meas : AEStronglyMeasurable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) (Measure.prod μ ν) h2_meas : AEStronglyMeasurable (fun y => ∫ (x : G), ‖↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))‖ ∂μ) ν h3 : Measure.map (fun z => (z.fst - z.snd, z.snd)) (Measure.prod μ ν) = Measure.prod μ ν this : Integrable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) ⊢ (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g (x - y))) (k (x₀ - x)))) = (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) ∘ fun z => (z.fst - z.snd, z.snd) [PROOFSTEP] ext ⟨x, y⟩ [GOAL] case h.e'_5.h.mk 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y✝ y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hf : AEStronglyMeasurable f ν hg : AEStronglyMeasurable g μ hk : AEStronglyMeasurable k μ hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) x (mul ℝ ℝ) hfgk : ConvolutionExistsAt (fun x => ‖f x‖) (convolution (fun x => ‖g x‖) (fun x => ‖k x‖) (mul ℝ ℝ)) x₀ (mul ℝ ℝ) h_meas : AEStronglyMeasurable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) (Measure.prod μ ν) h2_meas : AEStronglyMeasurable (fun y => ∫ (x : G), ‖↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))‖ ∂μ) ν h3 : Measure.map (fun z => (z.fst - z.snd, z.snd)) (Measure.prod μ ν) = Measure.prod μ ν this : Integrable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) x y : G ⊢ uncurry (fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g (x - y))) (k (x₀ - x)))) (x, y) = ((uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) ∘ fun z => (z.fst - z.snd, z.snd)) (x, y) [PROOFSTEP] simp_rw [uncurry, Function.comp_apply, sub_sub_sub_cancel_right] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hf : AEStronglyMeasurable f ν hg : AEStronglyMeasurable g μ hk : AEStronglyMeasurable k μ hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) x (mul ℝ ℝ) hfgk : ConvolutionExistsAt (fun x => ‖f x‖) (convolution (fun x => ‖g x‖) (fun x => ‖k x‖) (mul ℝ ℝ)) x₀ (mul ℝ ℝ) h_meas : AEStronglyMeasurable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) (Measure.prod μ ν) h2_meas : AEStronglyMeasurable (fun y => ∫ (x : G), ‖↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))‖ ∂μ) ν h3 : Measure.map (fun z => (z.fst - z.snd, z.snd)) (Measure.prod μ ν) = Measure.prod μ ν ⊢ Integrable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) [PROOFSTEP] simp_rw [integrable_prod_iff' h_meas] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hf : AEStronglyMeasurable f ν hg : AEStronglyMeasurable g μ hk : AEStronglyMeasurable k μ hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) x (mul ℝ ℝ) hfgk : ConvolutionExistsAt (fun x => ‖f x‖) (convolution (fun x => ‖g x‖) (fun x => ‖k x‖) (mul ℝ ℝ)) x₀ (mul ℝ ℝ) h_meas : AEStronglyMeasurable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) (Measure.prod μ ν) h2_meas : AEStronglyMeasurable (fun y => ∫ (x : G), ‖↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))‖ ∂μ) ν h3 : Measure.map (fun z => (z.fst - z.snd, z.snd)) (Measure.prod μ ν) = Measure.prod μ ν ⊢ (∀ᵐ (y : G) ∂ν, Integrable fun x => uncurry (fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) (x, y)) ∧ Integrable fun y => ∫ (x : G), ‖uncurry (fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) (x, y)‖ ∂μ [PROOFSTEP] refine' ⟨((quasiMeasurePreserving_sub_left_of_right_invariant ν x₀).ae hgk).mono fun t ht => (L₃ (f t)).integrable_comp <| ht.ofNorm L₄ hg hk, _⟩ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hf : AEStronglyMeasurable f ν hg : AEStronglyMeasurable g μ hk : AEStronglyMeasurable k μ hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) x (mul ℝ ℝ) hfgk : ConvolutionExistsAt (fun x => ‖f x‖) (convolution (fun x => ‖g x‖) (fun x => ‖k x‖) (mul ℝ ℝ)) x₀ (mul ℝ ℝ) h_meas : AEStronglyMeasurable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) (Measure.prod μ ν) h2_meas : AEStronglyMeasurable (fun y => ∫ (x : G), ‖↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))‖ ∂μ) ν h3 : Measure.map (fun z => (z.fst - z.snd, z.snd)) (Measure.prod μ ν) = Measure.prod μ ν ⊢ Integrable fun y => ∫ (x : G), ‖uncurry (fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) (x, y)‖ ∂μ [PROOFSTEP] refine' (hfgk.const_mul (‖L₃‖ * ‖L₄‖)).mono' h2_meas (((quasiMeasurePreserving_sub_left_of_right_invariant ν x₀).ae hgk).mono fun t ht => _) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hf : AEStronglyMeasurable f ν hg : AEStronglyMeasurable g μ hk : AEStronglyMeasurable k μ hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) x (mul ℝ ℝ) hfgk : ConvolutionExistsAt (fun x => ‖f x‖) (convolution (fun x => ‖g x‖) (fun x => ‖k x‖) (mul ℝ ℝ)) x₀ (mul ℝ ℝ) h_meas : AEStronglyMeasurable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) (Measure.prod μ ν) h2_meas : AEStronglyMeasurable (fun y => ∫ (x : G), ‖↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))‖ ∂μ) ν h3 : Measure.map (fun z => (z.fst - z.snd, z.snd)) (Measure.prod μ ν) = Measure.prod μ ν t : G ht : ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) (x₀ - t) (mul ℝ ℝ) ⊢ ‖∫ (x : G), ‖uncurry (fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) (x, t)‖ ∂μ‖ ≤ ‖L₃‖ * ‖L₄‖ * ↑(↑(mul ℝ ℝ) ((fun x => ‖f x‖) t)) ((fun x => ‖g x‖) ⋆[mul ℝ ℝ, (x₀ - t)] fun x => ‖k x‖) [PROOFSTEP] simp_rw [convolution_def, mul_apply', mul_mul_mul_comm ‖L₃‖ ‖L₄‖, ← integral_mul_left] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hf : AEStronglyMeasurable f ν hg : AEStronglyMeasurable g μ hk : AEStronglyMeasurable k μ hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) x (mul ℝ ℝ) hfgk : ConvolutionExistsAt (fun x => ‖f x‖) (convolution (fun x => ‖g x‖) (fun x => ‖k x‖) (mul ℝ ℝ)) x₀ (mul ℝ ℝ) h_meas : AEStronglyMeasurable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) (Measure.prod μ ν) h2_meas : AEStronglyMeasurable (fun y => ∫ (x : G), ‖↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))‖ ∂μ) ν h3 : Measure.map (fun z => (z.fst - z.snd, z.snd)) (Measure.prod μ ν) = Measure.prod μ ν t : G ht : ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) (x₀ - t) (mul ℝ ℝ) ⊢ ‖∫ (x : G), ‖uncurry (fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) (x, t)‖ ∂μ‖ ≤ ∫ (a : G), ‖L₃‖ * ‖f t‖ * (‖L₄‖ * (‖g a‖ * ‖k (x₀ - t - a)‖)) ∂μ [PROOFSTEP] rw [Real.norm_of_nonneg] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hf : AEStronglyMeasurable f ν hg : AEStronglyMeasurable g μ hk : AEStronglyMeasurable k μ hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) x (mul ℝ ℝ) hfgk : ConvolutionExistsAt (fun x => ‖f x‖) (convolution (fun x => ‖g x‖) (fun x => ‖k x‖) (mul ℝ ℝ)) x₀ (mul ℝ ℝ) h_meas : AEStronglyMeasurable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) (Measure.prod μ ν) h2_meas : AEStronglyMeasurable (fun y => ∫ (x : G), ‖↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))‖ ∂μ) ν h3 : Measure.map (fun z => (z.fst - z.snd, z.snd)) (Measure.prod μ ν) = Measure.prod μ ν t : G ht : ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) (x₀ - t) (mul ℝ ℝ) ⊢ ∫ (x : G), ‖uncurry (fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) (x, t)‖ ∂μ ≤ ∫ (a : G), ‖L₃‖ * ‖f t‖ * (‖L₄‖ * (‖g a‖ * ‖k (x₀ - t - a)‖)) ∂μ [PROOFSTEP] refine' integral_mono_of_nonneg (eventually_of_forall fun t => norm_nonneg _) ((ht.const_mul _).const_mul _) (eventually_of_forall fun s => _) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hf : AEStronglyMeasurable f ν hg : AEStronglyMeasurable g μ hk : AEStronglyMeasurable k μ hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) x (mul ℝ ℝ) hfgk : ConvolutionExistsAt (fun x => ‖f x‖) (convolution (fun x => ‖g x‖) (fun x => ‖k x‖) (mul ℝ ℝ)) x₀ (mul ℝ ℝ) h_meas : AEStronglyMeasurable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) (Measure.prod μ ν) h2_meas : AEStronglyMeasurable (fun y => ∫ (x : G), ‖↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))‖ ∂μ) ν h3 : Measure.map (fun z => (z.fst - z.snd, z.snd)) (Measure.prod μ ν) = Measure.prod μ ν t : G ht : ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) (x₀ - t) (mul ℝ ℝ) s : G ⊢ (fun x => ‖uncurry (fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) (x, t)‖) s ≤ (fun a => ‖L₃‖ * ‖f t‖ * (‖L₄‖ * (‖g a‖ * ‖k (x₀ - t - a)‖))) s [PROOFSTEP] simp only [← mul_assoc ‖L₄‖] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hf : AEStronglyMeasurable f ν hg : AEStronglyMeasurable g μ hk : AEStronglyMeasurable k μ hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) x (mul ℝ ℝ) hfgk : ConvolutionExistsAt (fun x => ‖f x‖) (convolution (fun x => ‖g x‖) (fun x => ‖k x‖) (mul ℝ ℝ)) x₀ (mul ℝ ℝ) h_meas : AEStronglyMeasurable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) (Measure.prod μ ν) h2_meas : AEStronglyMeasurable (fun y => ∫ (x : G), ‖↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))‖ ∂μ) ν h3 : Measure.map (fun z => (z.fst - z.snd, z.snd)) (Measure.prod μ ν) = Measure.prod μ ν t : G ht : ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) (x₀ - t) (mul ℝ ℝ) s : G ⊢ ‖uncurry (fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) (s, t)‖ ≤ ‖L₃‖ * ‖f t‖ * (‖L₄‖ * ‖g s‖ * ‖k (x₀ - t - s)‖) [PROOFSTEP] apply_rules [ContinuousLinearMap.le_of_op_norm₂_le_of_le, le_rfl] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝²⁶ : NormedAddCommGroup E inst✝²⁵ : NormedAddCommGroup E' inst✝²⁴ : NormedAddCommGroup E'' inst✝²³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝²² : IsROrC 𝕜 inst✝²¹ : NormedSpace 𝕜 E inst✝²⁰ : NormedSpace 𝕜 E' inst✝¹⁹ : NormedSpace 𝕜 E'' inst✝¹⁸ : NormedSpace ℝ F inst✝¹⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝¹⁶ : CompleteSpace F inst✝¹⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹⁴ : NormedAddCommGroup F' inst✝¹³ : NormedSpace ℝ F' inst✝¹² : NormedSpace 𝕜 F' inst✝¹¹ : CompleteSpace F' inst✝¹⁰ : NormedAddCommGroup F'' inst✝⁹ : NormedSpace ℝ F'' inst✝⁸ : NormedSpace 𝕜 F'' inst✝⁷ : CompleteSpace F'' k : G → E'' L₂ : F →L[𝕜] E'' →L[𝕜] F' L₃ : E →L[𝕜] F'' →L[𝕜] F' L₄ : E' →L[𝕜] E'' →L[𝕜] F'' inst✝⁶ : AddGroup G inst✝⁵ : SigmaFinite μ inst✝⁴ : SigmaFinite ν inst✝³ : IsAddRightInvariant μ inst✝² : MeasurableAdd₂ G inst✝¹ : IsAddRightInvariant ν inst✝ : MeasurableNeg G hL : ∀ (x : E) (y : E') (z : E''), ↑(↑L₂ (↑(↑L x) y)) z = ↑(↑L₃ x) (↑(↑L₄ y) z) x₀ : G hf : AEStronglyMeasurable f ν hg : AEStronglyMeasurable g μ hk : AEStronglyMeasurable k μ hfg : ∀ᵐ (y : G) ∂μ, ConvolutionExistsAt f g y L hgk : ∀ᵐ (x : G) ∂ν, ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) x (mul ℝ ℝ) hfgk : ConvolutionExistsAt (fun x => ‖f x‖) (convolution (fun x => ‖g x‖) (fun x => ‖k x‖) (mul ℝ ℝ)) x₀ (mul ℝ ℝ) h_meas : AEStronglyMeasurable (uncurry fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) (Measure.prod μ ν) h2_meas : AEStronglyMeasurable (fun y => ∫ (x : G), ‖↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))‖ ∂μ) ν h3 : Measure.map (fun z => (z.fst - z.snd, z.snd)) (Measure.prod μ ν) = Measure.prod μ ν t : G ht : ConvolutionExistsAt (fun x => ‖g x‖) (fun x => ‖k x‖) (x₀ - t) (mul ℝ ℝ) ⊢ 0 ≤ ∫ (x : G), ‖uncurry (fun x y => ↑(↑L₃ (f y)) (↑(↑L₄ (g x)) (k (x₀ - y - x)))) (x, t)‖ ∂μ [PROOFSTEP] exact integral_nonneg fun x => norm_nonneg _ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝⁹ : IsROrC 𝕜 inst✝⁸ : NormedSpace 𝕜 E inst✝⁷ : NormedSpace 𝕜 E' inst✝⁶ : NormedSpace 𝕜 E'' inst✝⁵ : NormedSpace ℝ F inst✝⁴ : NormedSpace 𝕜 F n : ℕ∞ inst✝³ : CompleteSpace F inst✝² : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹ : NormedAddCommGroup G inst✝ : BorelSpace G g : G → E'' →L[𝕜] E' hf : LocallyIntegrable f hcg : HasCompactSupport g hg : Continuous g x₀ : G x : E'' ⊢ ↑(f ⋆[precompR E'' L, x₀] g) x = f ⋆[L, x₀] fun a => ↑(g a) x [PROOFSTEP] have := hcg.convolutionExists_right (L.precompR E'' : _) hf hg x₀ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝⁹ : IsROrC 𝕜 inst✝⁸ : NormedSpace 𝕜 E inst✝⁷ : NormedSpace 𝕜 E' inst✝⁶ : NormedSpace 𝕜 E'' inst✝⁵ : NormedSpace ℝ F inst✝⁴ : NormedSpace 𝕜 F n : ℕ∞ inst✝³ : CompleteSpace F inst✝² : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹ : NormedAddCommGroup G inst✝ : BorelSpace G g : G → E'' →L[𝕜] E' hf : LocallyIntegrable f hcg : HasCompactSupport g hg : Continuous g x₀ : G x : E'' this : ConvolutionExistsAt f g x₀ (precompR E'' L) ⊢ ↑(f ⋆[precompR E'' L, x₀] g) x = f ⋆[L, x₀] fun a => ↑(g a) x [PROOFSTEP] simp_rw [convolution_def, ContinuousLinearMap.integral_apply this] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝⁹ : IsROrC 𝕜 inst✝⁸ : NormedSpace 𝕜 E inst✝⁷ : NormedSpace 𝕜 E' inst✝⁶ : NormedSpace 𝕜 E'' inst✝⁵ : NormedSpace ℝ F inst✝⁴ : NormedSpace 𝕜 F n : ℕ∞ inst✝³ : CompleteSpace F inst✝² : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹ : NormedAddCommGroup G inst✝ : BorelSpace G g : G → E'' →L[𝕜] E' hf : LocallyIntegrable f hcg : HasCompactSupport g hg : Continuous g x₀ : G x : E'' this : ConvolutionExistsAt f g x₀ (precompR E'' L) ⊢ ∫ (a : G), ↑(↑(↑(precompR E'' L) (f a)) (g (x₀ - a))) x ∂μ = ∫ (t : G), ↑(↑L (f t)) (↑(g (x₀ - t)) x) ∂μ [PROOFSTEP] rfl [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : SigmaFinite μ inst✝ : IsAddLeftInvariant μ hcg : HasCompactSupport g hf : LocallyIntegrable f hg : ContDiff 𝕜 1 g x₀ : G ⊢ HasFDerivAt (convolution f g L) (f ⋆[precompR G L, x₀] fderiv 𝕜 g) x₀ [PROOFSTEP] rcases hcg.eq_zero_or_finiteDimensional 𝕜 hg.continuous with (rfl | fin_dim) [GOAL] case inl 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : SigmaFinite μ inst✝ : IsAddLeftInvariant μ hf : LocallyIntegrable f x₀ : G hcg : HasCompactSupport 0 hg : ContDiff 𝕜 1 0 ⊢ HasFDerivAt (convolution f 0 L) (f ⋆[precompR G L, x₀] fderiv 𝕜 0) x₀ [PROOFSTEP] have : fderiv 𝕜 (0 : G → E') = 0 := fderiv_const (0 : E') [GOAL] case inl 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : SigmaFinite μ inst✝ : IsAddLeftInvariant μ hf : LocallyIntegrable f x₀ : G hcg : HasCompactSupport 0 hg : ContDiff 𝕜 1 0 this : fderiv 𝕜 0 = 0 ⊢ HasFDerivAt (convolution f 0 L) (f ⋆[precompR G L, x₀] fderiv 𝕜 0) x₀ [PROOFSTEP] simp only [this, convolution_zero, Pi.zero_apply] [GOAL] case inl 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : SigmaFinite μ inst✝ : IsAddLeftInvariant μ hf : LocallyIntegrable f x₀ : G hcg : HasCompactSupport 0 hg : ContDiff 𝕜 1 0 this : fderiv 𝕜 0 = 0 ⊢ HasFDerivAt 0 0 x₀ [PROOFSTEP] exact hasFDerivAt_const (0 : F) x₀ [GOAL] case inr 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : SigmaFinite μ inst✝ : IsAddLeftInvariant μ hcg : HasCompactSupport g hf : LocallyIntegrable f hg : ContDiff 𝕜 1 g x₀ : G fin_dim : FiniteDimensional 𝕜 G ⊢ HasFDerivAt (convolution f g L) (f ⋆[precompR G L, x₀] fderiv 𝕜 g) x₀ [PROOFSTEP] have : ProperSpace G := FiniteDimensional.proper_isROrC 𝕜 G [GOAL] case inr 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : SigmaFinite μ inst✝ : IsAddLeftInvariant μ hcg : HasCompactSupport g hf : LocallyIntegrable f hg : ContDiff 𝕜 1 g x₀ : G fin_dim : FiniteDimensional 𝕜 G this : ProperSpace G ⊢ HasFDerivAt (convolution f g L) (f ⋆[precompR G L, x₀] fderiv 𝕜 g) x₀ [PROOFSTEP] set L' := L.precompR G [GOAL] case inr 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : SigmaFinite μ inst✝ : IsAddLeftInvariant μ hcg : HasCompactSupport g hf : LocallyIntegrable f hg : ContDiff 𝕜 1 g x₀ : G fin_dim : FiniteDimensional 𝕜 G this : ProperSpace G L' : E →L[𝕜] (G →L[𝕜] E') →L[𝕜] G →L[𝕜] F := precompR G L ⊢ HasFDerivAt (convolution f g L) (f ⋆[L', x₀] fderiv 𝕜 g) x₀ [PROOFSTEP] have h1 : ∀ᶠ x in 𝓝 x₀, AEStronglyMeasurable (fun t => L (f t) (g (x - t))) μ := eventually_of_forall (hf.aestronglyMeasurable.convolution_integrand_snd L hg.continuous.aestronglyMeasurable) [GOAL] case inr 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : SigmaFinite μ inst✝ : IsAddLeftInvariant μ hcg : HasCompactSupport g hf : LocallyIntegrable f hg : ContDiff 𝕜 1 g x₀ : G fin_dim : FiniteDimensional 𝕜 G this : ProperSpace G L' : E →L[𝕜] (G →L[𝕜] E') →L[𝕜] G →L[𝕜] F := precompR G L h1 : ∀ᶠ (x : G) in 𝓝 x₀, AEStronglyMeasurable (fun t => ↑(↑L (f t)) (g (x - t))) μ ⊢ HasFDerivAt (convolution f g L) (f ⋆[L', x₀] fderiv 𝕜 g) x₀ [PROOFSTEP] have h2 : ∀ x, AEStronglyMeasurable (fun t => L' (f t) (fderiv 𝕜 g (x - t))) μ := hf.aestronglyMeasurable.convolution_integrand_snd L' (hg.continuous_fderiv le_rfl).aestronglyMeasurable [GOAL] case inr 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : SigmaFinite μ inst✝ : IsAddLeftInvariant μ hcg : HasCompactSupport g hf : LocallyIntegrable f hg : ContDiff 𝕜 1 g x₀ : G fin_dim : FiniteDimensional 𝕜 G this : ProperSpace G L' : E →L[𝕜] (G →L[𝕜] E') →L[𝕜] G →L[𝕜] F := precompR G L h1 : ∀ᶠ (x : G) in 𝓝 x₀, AEStronglyMeasurable (fun t => ↑(↑L (f t)) (g (x - t))) μ h2 : ∀ (x : G), AEStronglyMeasurable (fun t => ↑(↑L' (f t)) (fderiv 𝕜 g (x - t))) μ ⊢ HasFDerivAt (convolution f g L) (f ⋆[L', x₀] fderiv 𝕜 g) x₀ [PROOFSTEP] have h3 : ∀ x t, HasFDerivAt (fun x => g (x - t)) (fderiv 𝕜 g (x - t)) x := fun x t ↦ by simpa using (hg.differentiable le_rfl).differentiableAt.hasFDerivAt.comp x ((hasFDerivAt_id x).sub (hasFDerivAt_const t x)) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : SigmaFinite μ inst✝ : IsAddLeftInvariant μ hcg : HasCompactSupport g hf : LocallyIntegrable f hg : ContDiff 𝕜 1 g x₀ : G fin_dim : FiniteDimensional 𝕜 G this : ProperSpace G L' : E →L[𝕜] (G →L[𝕜] E') →L[𝕜] G →L[𝕜] F := precompR G L h1 : ∀ᶠ (x : G) in 𝓝 x₀, AEStronglyMeasurable (fun t => ↑(↑L (f t)) (g (x - t))) μ h2 : ∀ (x : G), AEStronglyMeasurable (fun t => ↑(↑L' (f t)) (fderiv 𝕜 g (x - t))) μ x t : G ⊢ HasFDerivAt (fun x => g (x - t)) (fderiv 𝕜 g (x - t)) x [PROOFSTEP] simpa using (hg.differentiable le_rfl).differentiableAt.hasFDerivAt.comp x ((hasFDerivAt_id x).sub (hasFDerivAt_const t x)) [GOAL] case inr 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : SigmaFinite μ inst✝ : IsAddLeftInvariant μ hcg : HasCompactSupport g hf : LocallyIntegrable f hg : ContDiff 𝕜 1 g x₀ : G fin_dim : FiniteDimensional 𝕜 G this : ProperSpace G L' : E →L[𝕜] (G →L[𝕜] E') →L[𝕜] G →L[𝕜] F := precompR G L h1 : ∀ᶠ (x : G) in 𝓝 x₀, AEStronglyMeasurable (fun t => ↑(↑L (f t)) (g (x - t))) μ h2 : ∀ (x : G), AEStronglyMeasurable (fun t => ↑(↑L' (f t)) (fderiv 𝕜 g (x - t))) μ h3 : ∀ (x t : G), HasFDerivAt (fun x => g (x - t)) (fderiv 𝕜 g (x - t)) x ⊢ HasFDerivAt (convolution f g L) (f ⋆[L', x₀] fderiv 𝕜 g) x₀ [PROOFSTEP] let K' := -tsupport (fderiv 𝕜 g) + closedBall x₀ 1 [GOAL] case inr 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : SigmaFinite μ inst✝ : IsAddLeftInvariant μ hcg : HasCompactSupport g hf : LocallyIntegrable f hg : ContDiff 𝕜 1 g x₀ : G fin_dim : FiniteDimensional 𝕜 G this : ProperSpace G L' : E →L[𝕜] (G →L[𝕜] E') →L[𝕜] G →L[𝕜] F := precompR G L h1 : ∀ᶠ (x : G) in 𝓝 x₀, AEStronglyMeasurable (fun t => ↑(↑L (f t)) (g (x - t))) μ h2 : ∀ (x : G), AEStronglyMeasurable (fun t => ↑(↑L' (f t)) (fderiv 𝕜 g (x - t))) μ h3 : ∀ (x t : G), HasFDerivAt (fun x => g (x - t)) (fderiv 𝕜 g (x - t)) x K' : Set G := -tsupport (fderiv 𝕜 g) + closedBall x₀ 1 ⊢ HasFDerivAt (convolution f g L) (f ⋆[L', x₀] fderiv 𝕜 g) x₀ [PROOFSTEP] have hK' : IsCompact K' := (hcg.fderiv 𝕜).neg.add (isCompact_closedBall x₀ 1) -- porting note: was -- `refine' hasFDerivAt_integral_of_dominated_of_fderiv_le zero_lt_one h1 _ (h2 x₀) _ _ _` -- but it failed; surprisingly, `apply` works [GOAL] case inr 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : SigmaFinite μ inst✝ : IsAddLeftInvariant μ hcg : HasCompactSupport g hf : LocallyIntegrable f hg : ContDiff 𝕜 1 g x₀ : G fin_dim : FiniteDimensional 𝕜 G this : ProperSpace G L' : E →L[𝕜] (G →L[𝕜] E') →L[𝕜] G →L[𝕜] F := precompR G L h1 : ∀ᶠ (x : G) in 𝓝 x₀, AEStronglyMeasurable (fun t => ↑(↑L (f t)) (g (x - t))) μ h2 : ∀ (x : G), AEStronglyMeasurable (fun t => ↑(↑L' (f t)) (fderiv 𝕜 g (x - t))) μ h3 : ∀ (x t : G), HasFDerivAt (fun x => g (x - t)) (fderiv 𝕜 g (x - t)) x K' : Set G := -tsupport (fderiv 𝕜 g) + closedBall x₀ 1 hK' : IsCompact K' ⊢ HasFDerivAt (convolution f g L) (f ⋆[L', x₀] fderiv 𝕜 g) x₀ [PROOFSTEP] apply hasFDerivAt_integral_of_dominated_of_fderiv_le zero_lt_one h1 _ (h2 x₀) [GOAL] case inr.h_bound 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : SigmaFinite μ inst✝ : IsAddLeftInvariant μ hcg : HasCompactSupport g hf : LocallyIntegrable f hg : ContDiff 𝕜 1 g x₀ : G fin_dim : FiniteDimensional 𝕜 G this : ProperSpace G L' : E →L[𝕜] (G →L[𝕜] E') →L[𝕜] G →L[𝕜] F := precompR G L h1 : ∀ᶠ (x : G) in 𝓝 x₀, AEStronglyMeasurable (fun t => ↑(↑L (f t)) (g (x - t))) μ h2 : ∀ (x : G), AEStronglyMeasurable (fun t => ↑(↑L' (f t)) (fderiv 𝕜 g (x - t))) μ h3 : ∀ (x t : G), HasFDerivAt (fun x => g (x - t)) (fderiv 𝕜 g (x - t)) x K' : Set G := -tsupport (fderiv 𝕜 g) + closedBall x₀ 1 hK' : IsCompact K' ⊢ ∀ᵐ (a : G) ∂μ, ∀ (x : G), x ∈ ball x₀ 1 → ‖↑(↑L' (f a)) (fderiv 𝕜 g (x - a))‖ ≤ ?m.2141475 a [PROOFSTEP] refine' eventually_of_forall fun t x hx => (hcg.fderiv 𝕜).convolution_integrand_bound_right L' (hg.continuous_fderiv le_rfl) (ball_subset_closedBall hx) [GOAL] case inr.bound_integrable 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : SigmaFinite μ inst✝ : IsAddLeftInvariant μ hcg : HasCompactSupport g hf : LocallyIntegrable f hg : ContDiff 𝕜 1 g x₀ : G fin_dim : FiniteDimensional 𝕜 G this : ProperSpace G L' : E →L[𝕜] (G →L[𝕜] E') →L[𝕜] G →L[𝕜] F := precompR G L h1 : ∀ᶠ (x : G) in 𝓝 x₀, AEStronglyMeasurable (fun t => ↑(↑L (f t)) (g (x - t))) μ h2 : ∀ (x : G), AEStronglyMeasurable (fun t => ↑(↑L' (f t)) (fderiv 𝕜 g (x - t))) μ h3 : ∀ (x t : G), HasFDerivAt (fun x => g (x - t)) (fderiv 𝕜 g (x - t)) x K' : Set G := -tsupport (fderiv 𝕜 g) + closedBall x₀ 1 hK' : IsCompact K' ⊢ Integrable fun t => indicator (-tsupport (fderiv 𝕜 g) + closedBall x₀ 1) (fun t => ‖L'‖ * ‖f t‖ * ⨆ (i : G), ‖fderiv 𝕜 g i‖) t [PROOFSTEP] rw [integrable_indicator_iff hK'.measurableSet] [GOAL] case inr.bound_integrable 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : SigmaFinite μ inst✝ : IsAddLeftInvariant μ hcg : HasCompactSupport g hf : LocallyIntegrable f hg : ContDiff 𝕜 1 g x₀ : G fin_dim : FiniteDimensional 𝕜 G this : ProperSpace G L' : E →L[𝕜] (G →L[𝕜] E') →L[𝕜] G →L[𝕜] F := precompR G L h1 : ∀ᶠ (x : G) in 𝓝 x₀, AEStronglyMeasurable (fun t => ↑(↑L (f t)) (g (x - t))) μ h2 : ∀ (x : G), AEStronglyMeasurable (fun t => ↑(↑L' (f t)) (fderiv 𝕜 g (x - t))) μ h3 : ∀ (x t : G), HasFDerivAt (fun x => g (x - t)) (fderiv 𝕜 g (x - t)) x K' : Set G := -tsupport (fderiv 𝕜 g) + closedBall x₀ 1 hK' : IsCompact K' ⊢ IntegrableOn (fun t => ‖L'‖ * ‖f t‖ * ⨆ (i : G), ‖fderiv 𝕜 g i‖) K' [PROOFSTEP] exact ((hf.integrableOn_isCompact hK').norm.const_mul _).mul_const _ [GOAL] case inr.h_diff 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : SigmaFinite μ inst✝ : IsAddLeftInvariant μ hcg : HasCompactSupport g hf : LocallyIntegrable f hg : ContDiff 𝕜 1 g x₀ : G fin_dim : FiniteDimensional 𝕜 G this : ProperSpace G L' : E →L[𝕜] (G →L[𝕜] E') →L[𝕜] G →L[𝕜] F := precompR G L h1 : ∀ᶠ (x : G) in 𝓝 x₀, AEStronglyMeasurable (fun t => ↑(↑L (f t)) (g (x - t))) μ h2 : ∀ (x : G), AEStronglyMeasurable (fun t => ↑(↑L' (f t)) (fderiv 𝕜 g (x - t))) μ h3 : ∀ (x t : G), HasFDerivAt (fun x => g (x - t)) (fderiv 𝕜 g (x - t)) x K' : Set G := -tsupport (fderiv 𝕜 g) + closedBall x₀ 1 hK' : IsCompact K' ⊢ ∀ᵐ (a : G) ∂μ, ∀ (x : G), x ∈ ball x₀ 1 → HasFDerivAt (fun x => ↑(↑L (f a)) (g (x - a))) (↑(↑L' (f a)) (fderiv 𝕜 g (x - a))) x [PROOFSTEP] exact eventually_of_forall fun t x _ => (L _).hasFDerivAt.comp x (h3 x t) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F n : ℕ∞ inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : SigmaFinite μ inst✝ : IsAddLeftInvariant μ hcg : HasCompactSupport g hf : LocallyIntegrable f hg : ContDiff 𝕜 1 g x₀ : G fin_dim : FiniteDimensional 𝕜 G this : ProperSpace G L' : E →L[𝕜] (G →L[𝕜] E') →L[𝕜] G →L[𝕜] F := precompR G L h1 : ∀ᶠ (x : G) in 𝓝 x₀, AEStronglyMeasurable (fun t => ↑(↑L (f t)) (g (x - t))) μ h2 : ∀ (x : G), AEStronglyMeasurable (fun t => ↑(↑L' (f t)) (fderiv 𝕜 g (x - t))) μ h3 : ∀ (x t : G), HasFDerivAt (fun x => g (x - t)) (fderiv 𝕜 g (x - t)) x K' : Set G := -tsupport (fderiv 𝕜 g) + closedBall x₀ 1 hK' : IsCompact K' ⊢ Integrable fun t => ↑(↑L (f t)) (g (x₀ - t)) [PROOFSTEP] exact hcg.convolutionExists_right L hf hg.continuous x₀ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁷ : NormedAddCommGroup E inst✝¹⁶ : NormedAddCommGroup E' inst✝¹⁵ : NormedAddCommGroup E'' inst✝¹⁴ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹³ : IsROrC 𝕜 inst✝¹² : NormedSpace 𝕜 E inst✝¹¹ : NormedSpace 𝕜 E' inst✝¹⁰ : NormedSpace 𝕜 E'' inst✝⁹ : NormedSpace ℝ F inst✝⁸ : NormedSpace 𝕜 F n : ℕ∞ inst✝⁷ : CompleteSpace F inst✝⁶ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝⁵ : NormedAddCommGroup G inst✝⁴ : BorelSpace G inst✝³ : NormedSpace 𝕜 G inst✝² : SigmaFinite μ inst✝¹ : IsAddLeftInvariant μ inst✝ : IsNegInvariant μ hcf : HasCompactSupport f hf : ContDiff 𝕜 1 f hg : LocallyIntegrable g x₀ : G ⊢ HasFDerivAt (convolution f g L) (fderiv 𝕜 f ⋆[precompL G L, x₀] g) x₀ [PROOFSTEP] simp (config := { singlePass := true }) only [← convolution_flip] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁷ : NormedAddCommGroup E inst✝¹⁶ : NormedAddCommGroup E' inst✝¹⁵ : NormedAddCommGroup E'' inst✝¹⁴ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹³ : IsROrC 𝕜 inst✝¹² : NormedSpace 𝕜 E inst✝¹¹ : NormedSpace 𝕜 E' inst✝¹⁰ : NormedSpace 𝕜 E'' inst✝⁹ : NormedSpace ℝ F inst✝⁸ : NormedSpace 𝕜 F n : ℕ∞ inst✝⁷ : CompleteSpace F inst✝⁶ : MeasurableSpace G μ ν : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝⁵ : NormedAddCommGroup G inst✝⁴ : BorelSpace G inst✝³ : NormedSpace 𝕜 G inst✝² : SigmaFinite μ inst✝¹ : IsAddLeftInvariant μ inst✝ : IsNegInvariant μ hcf : HasCompactSupport f hf : ContDiff 𝕜 1 f hg : LocallyIntegrable g x₀ : G ⊢ HasFDerivAt (convolution g f (ContinuousLinearMap.flip L)) (g ⋆[ContinuousLinearMap.flip (precompL G L), x₀] fderiv 𝕜 f) x₀ [PROOFSTEP] exact hcf.hasFDerivAt_convolution_right L.flip hg hf x₀ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹¹ : NormedAddCommGroup E inst✝¹⁰ : NormedAddCommGroup E' inst✝⁹ : NormedAddCommGroup E'' inst✝⁸ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁷ : IsROrC 𝕜 inst✝⁶ : NormedSpace 𝕜 E inst✝⁵ : NormedSpace 𝕜 E' inst✝⁴ : NormedSpace ℝ F inst✝³ : NormedSpace 𝕜 F f₀ : 𝕜 → E g₀ : 𝕜 → E' n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F inst✝² : CompleteSpace F μ : Measure 𝕜 inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ hf : LocallyIntegrable f₀ hcg : HasCompactSupport g₀ hg : ContDiff 𝕜 1 g₀ x₀ : 𝕜 ⊢ HasDerivAt (convolution f₀ g₀ L) (f₀ ⋆[L, x₀] deriv g₀) x₀ [PROOFSTEP] convert (hcg.hasFDerivAt_convolution_right L hf hg x₀).hasDerivAt using 1 [GOAL] case h.e'_7 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹¹ : NormedAddCommGroup E inst✝¹⁰ : NormedAddCommGroup E' inst✝⁹ : NormedAddCommGroup E'' inst✝⁸ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁷ : IsROrC 𝕜 inst✝⁶ : NormedSpace 𝕜 E inst✝⁵ : NormedSpace 𝕜 E' inst✝⁴ : NormedSpace ℝ F inst✝³ : NormedSpace 𝕜 F f₀ : 𝕜 → E g₀ : 𝕜 → E' n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F inst✝² : CompleteSpace F μ : Measure 𝕜 inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ hf : LocallyIntegrable f₀ hcg : HasCompactSupport g₀ hg : ContDiff 𝕜 1 g₀ x₀ : 𝕜 ⊢ f₀ ⋆[L, x₀] deriv g₀ = ↑(f₀ ⋆[precompR 𝕜 L, x₀] fderiv 𝕜 g₀) 1 [PROOFSTEP] rw [convolution_precompR_apply L hf (hcg.fderiv 𝕜) (hg.continuous_fderiv le_rfl)] [GOAL] case h.e'_7 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹¹ : NormedAddCommGroup E inst✝¹⁰ : NormedAddCommGroup E' inst✝⁹ : NormedAddCommGroup E'' inst✝⁸ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁷ : IsROrC 𝕜 inst✝⁶ : NormedSpace 𝕜 E inst✝⁵ : NormedSpace 𝕜 E' inst✝⁴ : NormedSpace ℝ F inst✝³ : NormedSpace 𝕜 F f₀ : 𝕜 → E g₀ : 𝕜 → E' n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F inst✝² : CompleteSpace F μ : Measure 𝕜 inst✝¹ : IsAddLeftInvariant μ inst✝ : SigmaFinite μ hf : LocallyIntegrable f₀ hcg : HasCompactSupport g₀ hg : ContDiff 𝕜 1 g₀ x₀ : 𝕜 ⊢ f₀ ⋆[L, x₀] deriv g₀ = f₀ ⋆[L, x₀] fun a => ↑(fderiv 𝕜 g₀ a) 1 [PROOFSTEP] rfl [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : IsROrC 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace ℝ F inst✝⁴ : NormedSpace 𝕜 F f₀ : 𝕜 → E g₀ : 𝕜 → E' n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F inst✝³ : CompleteSpace F μ : Measure 𝕜 inst✝² : IsAddLeftInvariant μ inst✝¹ : SigmaFinite μ inst✝ : IsNegInvariant μ hcf : HasCompactSupport f₀ hf : ContDiff 𝕜 1 f₀ hg : LocallyIntegrable g₀ x₀ : 𝕜 ⊢ HasDerivAt (convolution f₀ g₀ L) (deriv f₀ ⋆[L, x₀] g₀) x₀ [PROOFSTEP] simp (config := { singlePass := true }) only [← convolution_flip] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹² : NormedAddCommGroup E inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup E'' inst✝⁹ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝⁸ : IsROrC 𝕜 inst✝⁷ : NormedSpace 𝕜 E inst✝⁶ : NormedSpace 𝕜 E' inst✝⁵ : NormedSpace ℝ F inst✝⁴ : NormedSpace 𝕜 F f₀ : 𝕜 → E g₀ : 𝕜 → E' n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F inst✝³ : CompleteSpace F μ : Measure 𝕜 inst✝² : IsAddLeftInvariant μ inst✝¹ : SigmaFinite μ inst✝ : IsNegInvariant μ hcf : HasCompactSupport f₀ hf : ContDiff 𝕜 1 f₀ hg : LocallyIntegrable g₀ x₀ : 𝕜 ⊢ HasDerivAt (convolution g₀ f₀ (ContinuousLinearMap.flip L)) (g₀ ⋆[ContinuousLinearMap.flip L, x₀] deriv f₀) x₀ [PROOFSTEP] exact hcf.hasDerivAt_convolution_right L.flip hg hf x₀ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s ⊢ HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f ⋆[precompR (P × G) L, q₀.snd] fun x => fderiv 𝕜 (↿g) (q₀.fst, x)) q₀ [PROOFSTEP] let g' := fderiv 𝕜 ↿g [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g ⊢ HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f ⋆[precompR (P × G) L, q₀.snd] fun x => fderiv 𝕜 (↿g) (q₀.fst, x)) q₀ [PROOFSTEP] have A : ∀ p ∈ s, Continuous (g p) := fun p hp ↦ by refine hg.continuousOn.comp_continuous (continuous_const.prod_mk continuous_id') fun x => ?_ simpa only [prod_mk_mem_set_prod_eq, mem_univ, and_true_iff] using hp [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g p : P hp : p ∈ s ⊢ Continuous (g p) [PROOFSTEP] refine hg.continuousOn.comp_continuous (continuous_const.prod_mk continuous_id') fun x => ?_ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g p : P hp : p ∈ s x : G ⊢ (p, x) ∈ s ×ˢ univ [PROOFSTEP] simpa only [prod_mk_mem_set_prod_eq, mem_univ, and_true_iff] using hp [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) ⊢ HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f ⋆[precompR (P × G) L, q₀.snd] fun x => fderiv 𝕜 (↿g) (q₀.fst, x)) q₀ [PROOFSTEP] have A' : ∀ q : P × G, q.1 ∈ s → s ×ˢ univ ∈ 𝓝 q := fun q hq ↦ by apply (hs.prod isOpen_univ).mem_nhds simpa only [mem_prod, mem_univ, and_true_iff] using hq [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) q : P × G hq : q.fst ∈ s ⊢ s ×ˢ univ ∈ 𝓝 q [PROOFSTEP] apply (hs.prod isOpen_univ).mem_nhds [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) q : P × G hq : q.fst ∈ s ⊢ q ∈ s ×ˢ univ [PROOFSTEP] simpa only [mem_prod, mem_univ, and_true_iff] using hq [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q ⊢ HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f ⋆[precompR (P × G) L, q₀.snd] fun x => fderiv 𝕜 (↿g) (q₀.fst, x)) q₀ [PROOFSTEP] have g'_zero : ∀ p x, p ∈ s → x ∉ k → g' (p, x) = 0 := by intro p x hp hx refine' (hasFDerivAt_zero_of_eventually_const 0 _).fderiv have M2 : kᶜ ∈ 𝓝 x := hk.isClosed.isOpen_compl.mem_nhds hx have M1 : s ∈ 𝓝 p := hs.mem_nhds hp rw [nhds_prod_eq] filter_upwards [prod_mem_prod M1 M2] rintro ⟨p, y⟩ ⟨hp, hy⟩ exact hgs p y hp hy [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q ⊢ ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 [PROOFSTEP] intro p x hp hx [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q p : P x : G hp : p ∈ s hx : ¬x ∈ k ⊢ g' (p, x) = 0 [PROOFSTEP] refine' (hasFDerivAt_zero_of_eventually_const 0 _).fderiv [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q p : P x : G hp : p ∈ s hx : ¬x ∈ k ⊢ ↿g =ᶠ[𝓝 (p, x)] fun x => 0 [PROOFSTEP] have M2 : kᶜ ∈ 𝓝 x := hk.isClosed.isOpen_compl.mem_nhds hx [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q p : P x : G hp : p ∈ s hx : ¬x ∈ k M2 : kᶜ ∈ 𝓝 x ⊢ ↿g =ᶠ[𝓝 (p, x)] fun x => 0 [PROOFSTEP] have M1 : s ∈ 𝓝 p := hs.mem_nhds hp [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q p : P x : G hp : p ∈ s hx : ¬x ∈ k M2 : kᶜ ∈ 𝓝 x M1 : s ∈ 𝓝 p ⊢ ↿g =ᶠ[𝓝 (p, x)] fun x => 0 [PROOFSTEP] rw [nhds_prod_eq] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q p : P x : G hp : p ∈ s hx : ¬x ∈ k M2 : kᶜ ∈ 𝓝 x M1 : s ∈ 𝓝 p ⊢ ↿g =ᶠ[𝓝 p ×ˢ 𝓝 x] fun x => 0 [PROOFSTEP] filter_upwards [prod_mem_prod M1 M2] [GOAL] case h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q p : P x : G hp : p ∈ s hx : ¬x ∈ k M2 : kᶜ ∈ 𝓝 x M1 : s ∈ 𝓝 p ⊢ ∀ (a : P × G), a ∈ s ×ˢ kᶜ → (↿g) a = 0 [PROOFSTEP] rintro ⟨p, y⟩ ⟨hp, hy⟩ [GOAL] case h.mk.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y✝ y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q p✝ : P x : G hp✝ : p✝ ∈ s hx : ¬x ∈ k M2 : kᶜ ∈ 𝓝 x M1 : s ∈ 𝓝 p✝ p : P y : G hp : (p, y).fst ∈ s hy : (p, y).snd ∈ kᶜ ⊢ (↿g) (p, y) = 0 [PROOFSTEP] exact hgs p y hp hy [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ⊢ HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f ⋆[precompR (P × G) L, q₀.snd] fun x => fderiv 𝕜 (↿g) (q₀.fst, x)) q₀ [PROOFSTEP] obtain ⟨ε, C, εpos, h₀ε, hε⟩ : ∃ ε C, 0 < ε ∧ ball q₀.1 ε ⊆ s ∧ ∀ p x, ‖p - q₀.1‖ < ε → ‖g' (p, x)‖ ≤ C := by have A : IsCompact ({q₀.1} ×ˢ k) := isCompact_singleton.prod hk obtain ⟨t, kt, t_open, ht⟩ : ∃ t, {q₀.1} ×ˢ k ⊆ t ∧ IsOpen t ∧ Bounded (g' '' t) := by have B : ContinuousOn g' (s ×ˢ univ) := hg.continuousOn_fderiv_of_open (hs.prod isOpen_univ) le_rfl apply exists_isOpen_bounded_image_of_isCompact_of_continuousOn A (hs.prod isOpen_univ) _ B simp only [prod_subset_prod_iff, hq₀, singleton_subset_iff, subset_univ, and_self_iff, true_or_iff] obtain ⟨ε, εpos, hε, h'ε⟩ : ∃ ε : ℝ, 0 < ε ∧ thickening ε ({ q₀.fst } ×ˢ k) ⊆ t ∧ ball q₀.1 ε ⊆ s := by obtain ⟨ε, εpos, hε⟩ : ∃ ε : ℝ, 0 < ε ∧ thickening ε (({ q₀.fst } : Set P) ×ˢ k) ⊆ t · exact A.exists_thickening_subset_open t_open kt obtain ⟨δ, δpos, hδ⟩ : ∃ δ : ℝ, 0 < δ ∧ ball q₀.1 δ ⊆ s · exact Metric.isOpen_iff.1 hs _ hq₀ refine' ⟨min ε δ, lt_min εpos δpos, _, _⟩ · exact Subset.trans (thickening_mono (min_le_left _ _) _) hε · exact Subset.trans (ball_subset_ball (min_le_right _ _)) hδ obtain ⟨C, Cpos, hC⟩ : ∃ C, 0 < C ∧ g' '' t ⊆ closedBall 0 C; exact ht.subset_ball_lt 0 0 refine' ⟨ε, C, εpos, h'ε, fun p x hp => _⟩ have hps : p ∈ s := h'ε (mem_ball_iff_norm.2 hp) by_cases hx : x ∈ k · have H : (p, x) ∈ t := by apply hε refine' mem_thickening_iff.2 ⟨(q₀.1, x), _, _⟩ · simp only [hx, singleton_prod, mem_image, Prod.mk.inj_iff, eq_self_iff_true, true_and_iff, exists_eq_right] · rw [← dist_eq_norm] at hp simpa only [Prod.dist_eq, εpos, dist_self, max_lt_iff, and_true_iff] using hp have : g' (p, x) ∈ closedBall (0 : P × G →L[𝕜] E') C := hC (mem_image_of_mem _ H) rwa [mem_closedBall_zero_iff] at this · have : g' (p, x) = 0 := g'_zero _ _ hps hx rw [this] simpa only [norm_zero] using Cpos.le [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ⊢ ∃ ε C, 0 < ε ∧ ball q₀.fst ε ⊆ s ∧ ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C [PROOFSTEP] have A : IsCompact ({q₀.1} ×ˢ k) := isCompact_singleton.prod hk [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) ⊢ ∃ ε C, 0 < ε ∧ ball q₀.fst ε ⊆ s ∧ ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C [PROOFSTEP] obtain ⟨t, kt, t_open, ht⟩ : ∃ t, {q₀.1} ×ˢ k ⊆ t ∧ IsOpen t ∧ Bounded (g' '' t) := by have B : ContinuousOn g' (s ×ˢ univ) := hg.continuousOn_fderiv_of_open (hs.prod isOpen_univ) le_rfl apply exists_isOpen_bounded_image_of_isCompact_of_continuousOn A (hs.prod isOpen_univ) _ B simp only [prod_subset_prod_iff, hq₀, singleton_subset_iff, subset_univ, and_self_iff, true_or_iff] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) ⊢ ∃ t, {q₀.fst} ×ˢ k ⊆ t ∧ IsOpen t ∧ Metric.Bounded (g' '' t) [PROOFSTEP] have B : ContinuousOn g' (s ×ˢ univ) := hg.continuousOn_fderiv_of_open (hs.prod isOpen_univ) le_rfl [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) B : ContinuousOn g' (s ×ˢ univ) ⊢ ∃ t, {q₀.fst} ×ˢ k ⊆ t ∧ IsOpen t ∧ Metric.Bounded (g' '' t) [PROOFSTEP] apply exists_isOpen_bounded_image_of_isCompact_of_continuousOn A (hs.prod isOpen_univ) _ B [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) B : ContinuousOn g' (s ×ˢ univ) ⊢ {q₀.fst} ×ˢ k ⊆ s ×ˢ univ [PROOFSTEP] simp only [prod_subset_prod_iff, hq₀, singleton_subset_iff, subset_univ, and_self_iff, true_or_iff] [GOAL] case intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (g' '' t) ⊢ ∃ ε C, 0 < ε ∧ ball q₀.fst ε ⊆ s ∧ ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C [PROOFSTEP] obtain ⟨ε, εpos, hε, h'ε⟩ : ∃ ε : ℝ, 0 < ε ∧ thickening ε ({ q₀.fst } ×ˢ k) ⊆ t ∧ ball q₀.1 ε ⊆ s := by obtain ⟨ε, εpos, hε⟩ : ∃ ε : ℝ, 0 < ε ∧ thickening ε (({ q₀.fst } : Set P) ×ˢ k) ⊆ t · exact A.exists_thickening_subset_open t_open kt obtain ⟨δ, δpos, hδ⟩ : ∃ δ : ℝ, 0 < δ ∧ ball q₀.1 δ ⊆ s · exact Metric.isOpen_iff.1 hs _ hq₀ refine' ⟨min ε δ, lt_min εpos δpos, _, _⟩ · exact Subset.trans (thickening_mono (min_le_left _ _) _) hε · exact Subset.trans (ball_subset_ball (min_le_right _ _)) hδ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (g' '' t) ⊢ ∃ ε, 0 < ε ∧ thickening ε ({q₀.fst} ×ˢ k) ⊆ t ∧ ball q₀.fst ε ⊆ s [PROOFSTEP] obtain ⟨ε, εpos, hε⟩ : ∃ ε : ℝ, 0 < ε ∧ thickening ε (({ q₀.fst } : Set P) ×ˢ k) ⊆ t [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (g' '' t) ⊢ ∃ ε, 0 < ε ∧ thickening ε ({q₀.fst} ×ˢ k) ⊆ t [PROOFSTEP] exact A.exists_thickening_subset_open t_open kt [GOAL] case intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (g' '' t) ε : ℝ εpos : 0 < ε hε : thickening ε ({q₀.fst} ×ˢ k) ⊆ t ⊢ ∃ ε, 0 < ε ∧ thickening ε ({q₀.fst} ×ˢ k) ⊆ t ∧ ball q₀.fst ε ⊆ s [PROOFSTEP] obtain ⟨δ, δpos, hδ⟩ : ∃ δ : ℝ, 0 < δ ∧ ball q₀.1 δ ⊆ s [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (g' '' t) ε : ℝ εpos : 0 < ε hε : thickening ε ({q₀.fst} ×ˢ k) ⊆ t ⊢ ∃ δ, 0 < δ ∧ ball q₀.fst δ ⊆ s [PROOFSTEP] exact Metric.isOpen_iff.1 hs _ hq₀ [GOAL] case intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (g' '' t) ε : ℝ εpos : 0 < ε hε : thickening ε ({q₀.fst} ×ˢ k) ⊆ t δ : ℝ δpos : 0 < δ hδ : ball q₀.fst δ ⊆ s ⊢ ∃ ε, 0 < ε ∧ thickening ε ({q₀.fst} ×ˢ k) ⊆ t ∧ ball q₀.fst ε ⊆ s [PROOFSTEP] refine' ⟨min ε δ, lt_min εpos δpos, _, _⟩ [GOAL] case intro.intro.intro.intro.refine'_1 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (g' '' t) ε : ℝ εpos : 0 < ε hε : thickening ε ({q₀.fst} ×ˢ k) ⊆ t δ : ℝ δpos : 0 < δ hδ : ball q₀.fst δ ⊆ s ⊢ thickening (min ε δ) ({q₀.fst} ×ˢ k) ⊆ t [PROOFSTEP] exact Subset.trans (thickening_mono (min_le_left _ _) _) hε [GOAL] case intro.intro.intro.intro.refine'_2 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (g' '' t) ε : ℝ εpos : 0 < ε hε : thickening ε ({q₀.fst} ×ˢ k) ⊆ t δ : ℝ δpos : 0 < δ hδ : ball q₀.fst δ ⊆ s ⊢ ball q₀.fst (min ε δ) ⊆ s [PROOFSTEP] exact Subset.trans (ball_subset_ball (min_le_right _ _)) hδ [GOAL] case intro.intro.intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (g' '' t) ε : ℝ εpos : 0 < ε hε : thickening ε ({q₀.fst} ×ˢ k) ⊆ t h'ε : ball q₀.fst ε ⊆ s ⊢ ∃ ε C, 0 < ε ∧ ball q₀.fst ε ⊆ s ∧ ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C [PROOFSTEP] obtain ⟨C, Cpos, hC⟩ : ∃ C, 0 < C ∧ g' '' t ⊆ closedBall 0 C [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (g' '' t) ε : ℝ εpos : 0 < ε hε : thickening ε ({q₀.fst} ×ˢ k) ⊆ t h'ε : ball q₀.fst ε ⊆ s ⊢ ∃ C, 0 < C ∧ g' '' t ⊆ closedBall 0 C case intro.intro.intro.intro.intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (g' '' t) ε : ℝ εpos : 0 < ε hε : thickening ε ({q₀.fst} ×ˢ k) ⊆ t h'ε : ball q₀.fst ε ⊆ s C : ℝ Cpos : 0 < C hC : g' '' t ⊆ closedBall 0 C ⊢ ∃ ε C, 0 < ε ∧ ball q₀.fst ε ⊆ s ∧ ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C [PROOFSTEP] exact ht.subset_ball_lt 0 0 [GOAL] case intro.intro.intro.intro.intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (g' '' t) ε : ℝ εpos : 0 < ε hε : thickening ε ({q₀.fst} ×ˢ k) ⊆ t h'ε : ball q₀.fst ε ⊆ s C : ℝ Cpos : 0 < C hC : g' '' t ⊆ closedBall 0 C ⊢ ∃ ε C, 0 < ε ∧ ball q₀.fst ε ⊆ s ∧ ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C [PROOFSTEP] refine' ⟨ε, C, εpos, h'ε, fun p x hp => _⟩ [GOAL] case intro.intro.intro.intro.intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (g' '' t) ε : ℝ εpos : 0 < ε hε : thickening ε ({q₀.fst} ×ˢ k) ⊆ t h'ε : ball q₀.fst ε ⊆ s C : ℝ Cpos : 0 < C hC : g' '' t ⊆ closedBall 0 C p : P x : G hp : ‖p - q₀.fst‖ < ε ⊢ ‖g' (p, x)‖ ≤ C [PROOFSTEP] have hps : p ∈ s := h'ε (mem_ball_iff_norm.2 hp) [GOAL] case intro.intro.intro.intro.intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (g' '' t) ε : ℝ εpos : 0 < ε hε : thickening ε ({q₀.fst} ×ˢ k) ⊆ t h'ε : ball q₀.fst ε ⊆ s C : ℝ Cpos : 0 < C hC : g' '' t ⊆ closedBall 0 C p : P x : G hp : ‖p - q₀.fst‖ < ε hps : p ∈ s ⊢ ‖g' (p, x)‖ ≤ C [PROOFSTEP] by_cases hx : x ∈ k [GOAL] case pos 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (g' '' t) ε : ℝ εpos : 0 < ε hε : thickening ε ({q₀.fst} ×ˢ k) ⊆ t h'ε : ball q₀.fst ε ⊆ s C : ℝ Cpos : 0 < C hC : g' '' t ⊆ closedBall 0 C p : P x : G hp : ‖p - q₀.fst‖ < ε hps : p ∈ s hx : x ∈ k ⊢ ‖g' (p, x)‖ ≤ C [PROOFSTEP] have H : (p, x) ∈ t := by apply hε refine' mem_thickening_iff.2 ⟨(q₀.1, x), _, _⟩ · simp only [hx, singleton_prod, mem_image, Prod.mk.inj_iff, eq_self_iff_true, true_and_iff, exists_eq_right] · rw [← dist_eq_norm] at hp simpa only [Prod.dist_eq, εpos, dist_self, max_lt_iff, and_true_iff] using hp [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (g' '' t) ε : ℝ εpos : 0 < ε hε : thickening ε ({q₀.fst} ×ˢ k) ⊆ t h'ε : ball q₀.fst ε ⊆ s C : ℝ Cpos : 0 < C hC : g' '' t ⊆ closedBall 0 C p : P x : G hp : ‖p - q₀.fst‖ < ε hps : p ∈ s hx : x ∈ k ⊢ (p, x) ∈ t [PROOFSTEP] apply hε [GOAL] case a 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (g' '' t) ε : ℝ εpos : 0 < ε hε : thickening ε ({q₀.fst} ×ˢ k) ⊆ t h'ε : ball q₀.fst ε ⊆ s C : ℝ Cpos : 0 < C hC : g' '' t ⊆ closedBall 0 C p : P x : G hp : ‖p - q₀.fst‖ < ε hps : p ∈ s hx : x ∈ k ⊢ (p, x) ∈ thickening ε ({q₀.fst} ×ˢ k) [PROOFSTEP] refine' mem_thickening_iff.2 ⟨(q₀.1, x), _, _⟩ [GOAL] case a.refine'_1 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (g' '' t) ε : ℝ εpos : 0 < ε hε : thickening ε ({q₀.fst} ×ˢ k) ⊆ t h'ε : ball q₀.fst ε ⊆ s C : ℝ Cpos : 0 < C hC : g' '' t ⊆ closedBall 0 C p : P x : G hp : ‖p - q₀.fst‖ < ε hps : p ∈ s hx : x ∈ k ⊢ (q₀.fst, x) ∈ {q₀.fst} ×ˢ k [PROOFSTEP] simp only [hx, singleton_prod, mem_image, Prod.mk.inj_iff, eq_self_iff_true, true_and_iff, exists_eq_right] [GOAL] case a.refine'_2 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (g' '' t) ε : ℝ εpos : 0 < ε hε : thickening ε ({q₀.fst} ×ˢ k) ⊆ t h'ε : ball q₀.fst ε ⊆ s C : ℝ Cpos : 0 < C hC : g' '' t ⊆ closedBall 0 C p : P x : G hp : ‖p - q₀.fst‖ < ε hps : p ∈ s hx : x ∈ k ⊢ dist (p, x) (q₀.fst, x) < ε [PROOFSTEP] rw [← dist_eq_norm] at hp [GOAL] case a.refine'_2 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (g' '' t) ε : ℝ εpos : 0 < ε hε : thickening ε ({q₀.fst} ×ˢ k) ⊆ t h'ε : ball q₀.fst ε ⊆ s C : ℝ Cpos : 0 < C hC : g' '' t ⊆ closedBall 0 C p : P x : G hp : dist p q₀.fst < ε hps : p ∈ s hx : x ∈ k ⊢ dist (p, x) (q₀.fst, x) < ε [PROOFSTEP] simpa only [Prod.dist_eq, εpos, dist_self, max_lt_iff, and_true_iff] using hp [GOAL] case pos 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (g' '' t) ε : ℝ εpos : 0 < ε hε : thickening ε ({q₀.fst} ×ˢ k) ⊆ t h'ε : ball q₀.fst ε ⊆ s C : ℝ Cpos : 0 < C hC : g' '' t ⊆ closedBall 0 C p : P x : G hp : ‖p - q₀.fst‖ < ε hps : p ∈ s hx : x ∈ k H : (p, x) ∈ t ⊢ ‖g' (p, x)‖ ≤ C [PROOFSTEP] have : g' (p, x) ∈ closedBall (0 : P × G →L[𝕜] E') C := hC (mem_image_of_mem _ H) [GOAL] case pos 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (g' '' t) ε : ℝ εpos : 0 < ε hε : thickening ε ({q₀.fst} ×ˢ k) ⊆ t h'ε : ball q₀.fst ε ⊆ s C : ℝ Cpos : 0 < C hC : g' '' t ⊆ closedBall 0 C p : P x : G hp : ‖p - q₀.fst‖ < ε hps : p ∈ s hx : x ∈ k H : (p, x) ∈ t this : g' (p, x) ∈ closedBall 0 C ⊢ ‖g' (p, x)‖ ≤ C [PROOFSTEP] rwa [mem_closedBall_zero_iff] at this [GOAL] case neg 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (g' '' t) ε : ℝ εpos : 0 < ε hε : thickening ε ({q₀.fst} ×ˢ k) ⊆ t h'ε : ball q₀.fst ε ⊆ s C : ℝ Cpos : 0 < C hC : g' '' t ⊆ closedBall 0 C p : P x : G hp : ‖p - q₀.fst‖ < ε hps : p ∈ s hx : ¬x ∈ k ⊢ ‖g' (p, x)‖ ≤ C [PROOFSTEP] have : g' (p, x) = 0 := g'_zero _ _ hps hx [GOAL] case neg 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (g' '' t) ε : ℝ εpos : 0 < ε hε : thickening ε ({q₀.fst} ×ˢ k) ⊆ t h'ε : ball q₀.fst ε ⊆ s C : ℝ Cpos : 0 < C hC : g' '' t ⊆ closedBall 0 C p : P x : G hp : ‖p - q₀.fst‖ < ε hps : p ∈ s hx : ¬x ∈ k this : g' (p, x) = 0 ⊢ ‖g' (p, x)‖ ≤ C [PROOFSTEP] rw [this] [GOAL] case neg 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A✝ : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 A : IsCompact ({q₀.fst} ×ˢ k) t : Set (P × G) kt : {q₀.fst} ×ˢ k ⊆ t t_open : IsOpen t ht : Metric.Bounded (g' '' t) ε : ℝ εpos : 0 < ε hε : thickening ε ({q₀.fst} ×ˢ k) ⊆ t h'ε : ball q₀.fst ε ⊆ s C : ℝ Cpos : 0 < C hC : g' '' t ⊆ closedBall 0 C p : P x : G hp : ‖p - q₀.fst‖ < ε hps : p ∈ s hx : ¬x ∈ k this : g' (p, x) = 0 ⊢ ‖0‖ ≤ C [PROOFSTEP] simpa only [norm_zero] using Cpos.le [GOAL] case intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C ⊢ HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f ⋆[precompR (P × G) L, q₀.snd] fun x => fderiv 𝕜 (↿g) (q₀.fst, x)) q₀ [PROOFSTEP] have I1 : ∀ᶠ x : P × G in 𝓝 q₀, AEStronglyMeasurable (fun a : G => L (f a) (g x.1 (x.2 - a))) μ := by filter_upwards [A' q₀ hq₀] rintro ⟨p, x⟩ ⟨hp, -⟩ refine' (HasCompactSupport.convolutionExists_right L _ hf (A _ hp) _).1 apply isCompact_of_isClosed_subset hk (isClosed_tsupport _) exact closure_minimal (support_subset_iff'.2 fun z hz => hgs _ _ hp hz) hk.isClosed [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C ⊢ ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ [PROOFSTEP] filter_upwards [A' q₀ hq₀] [GOAL] case h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C ⊢ ∀ (a : P × G), a ∈ s ×ˢ univ → AEStronglyMeasurable (fun a_2 => ↑(↑L (f a_2)) (g a.fst (a.snd - a_2))) μ [PROOFSTEP] rintro ⟨p, x⟩ ⟨hp, -⟩ [GOAL] case h.mk.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C p : P x : G hp : (p, x).fst ∈ s ⊢ AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g (p, x).fst ((p, x).snd - a))) μ [PROOFSTEP] refine' (HasCompactSupport.convolutionExists_right L _ hf (A _ hp) _).1 [GOAL] case h.mk.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C p : P x : G hp : (p, x).fst ∈ s ⊢ HasCompactSupport (g (p, x).fst) [PROOFSTEP] apply isCompact_of_isClosed_subset hk (isClosed_tsupport _) [GOAL] case h.mk.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C p : P x : G hp : (p, x).fst ∈ s ⊢ tsupport (g (p, x).fst) ⊆ k [PROOFSTEP] exact closure_minimal (support_subset_iff'.2 fun z hz => hgs _ _ hp hz) hk.isClosed [GOAL] case intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ ⊢ HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f ⋆[precompR (P × G) L, q₀.snd] fun x => fderiv 𝕜 (↿g) (q₀.fst, x)) q₀ [PROOFSTEP] have I2 : Integrable (fun a : G => L (f a) (g q₀.1 (q₀.2 - a))) μ := by have M : HasCompactSupport (g q₀.1) := HasCompactSupport.intro hk fun x hx => hgs q₀.1 x hq₀ hx apply M.convolutionExists_right L hf (A q₀.1 hq₀) q₀.2 [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ ⊢ Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) [PROOFSTEP] have M : HasCompactSupport (g q₀.1) := HasCompactSupport.intro hk fun x hx => hgs q₀.1 x hq₀ hx [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ M : HasCompactSupport (g q₀.fst) ⊢ Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) [PROOFSTEP] apply M.convolutionExists_right L hf (A q₀.1 hq₀) q₀.2 [GOAL] case intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) ⊢ HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f ⋆[precompR (P × G) L, q₀.snd] fun x => fderiv 𝕜 (↿g) (q₀.fst, x)) q₀ [PROOFSTEP] have I3 : AEStronglyMeasurable (fun a : G => (L (f a)).comp (g' (q₀.fst, q₀.snd - a))) μ := by have T : HasCompactSupport fun y => g' (q₀.1, y) := HasCompactSupport.intro hk fun x hx => g'_zero q₀.1 x hq₀ hx apply (HasCompactSupport.convolutionExists_right (L.precompR (P × G) : _) T hf _ q₀.2).1 have : ContinuousOn g' (s ×ˢ univ) := hg.continuousOn_fderiv_of_open (hs.prod isOpen_univ) le_rfl apply this.comp_continuous (continuous_const.prod_mk continuous_id') intro x simpa only [prod_mk_mem_set_prod_eq, mem_univ, and_true_iff] using hq₀ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) ⊢ AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ [PROOFSTEP] have T : HasCompactSupport fun y => g' (q₀.1, y) := HasCompactSupport.intro hk fun x hx => g'_zero q₀.1 x hq₀ hx [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) T : HasCompactSupport fun y => g' (q₀.fst, y) ⊢ AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ [PROOFSTEP] apply (HasCompactSupport.convolutionExists_right (L.precompR (P × G) : _) T hf _ q₀.2).1 [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) T : HasCompactSupport fun y => g' (q₀.fst, y) ⊢ Continuous fun y => g' (q₀.fst, y) [PROOFSTEP] have : ContinuousOn g' (s ×ˢ univ) := hg.continuousOn_fderiv_of_open (hs.prod isOpen_univ) le_rfl [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) T : HasCompactSupport fun y => g' (q₀.fst, y) this : ContinuousOn g' (s ×ˢ univ) ⊢ Continuous fun y => g' (q₀.fst, y) [PROOFSTEP] apply this.comp_continuous (continuous_const.prod_mk continuous_id') [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) T : HasCompactSupport fun y => g' (q₀.fst, y) this : ContinuousOn g' (s ×ˢ univ) ⊢ ∀ (x : G), (q₀.fst, x) ∈ s ×ˢ univ [PROOFSTEP] intro x [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) T : HasCompactSupport fun y => g' (q₀.fst, y) this : ContinuousOn g' (s ×ˢ univ) x : G ⊢ (q₀.fst, x) ∈ s ×ˢ univ [PROOFSTEP] simpa only [prod_mk_mem_set_prod_eq, mem_univ, and_true_iff] using hq₀ [GOAL] case intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ ⊢ HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f ⋆[precompR (P × G) L, q₀.snd] fun x => fderiv 𝕜 (↿g) (q₀.fst, x)) q₀ [PROOFSTEP] set K' := (-k + {q₀.2} : Set G) with K'_def [GOAL] case intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} ⊢ HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f ⋆[precompR (P × G) L, q₀.snd] fun x => fderiv 𝕜 (↿g) (q₀.fst, x)) q₀ [PROOFSTEP] have hK' : IsCompact K' := hk.neg.add isCompact_singleton [GOAL] case intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' ⊢ HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f ⋆[precompR (P × G) L, q₀.snd] fun x => fderiv 𝕜 (↿g) (q₀.fst, x)) q₀ [PROOFSTEP] obtain ⟨U, U_open, K'U, hU⟩ : ∃ U, IsOpen U ∧ K' ⊆ U ∧ IntegrableOn f U μ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' ⊢ ∃ U, IsOpen U ∧ K' ⊆ U ∧ IntegrableOn f U case intro.intro.intro.intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U ⊢ HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f ⋆[precompR (P × G) L, q₀.snd] fun x => fderiv 𝕜 (↿g) (q₀.fst, x)) q₀ [PROOFSTEP] exact hf.integrableOn_nhds_isCompact hK' [GOAL] case intro.intro.intro.intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U ⊢ HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f ⋆[precompR (P × G) L, q₀.snd] fun x => fderiv 𝕜 (↿g) (q₀.fst, x)) q₀ [PROOFSTEP] obtain ⟨δ, δpos, δε, hδ⟩ : ∃ δ, (0 : ℝ) < δ ∧ δ ≤ ε ∧ K' + ball 0 δ ⊆ U := by obtain ⟨V, V_mem, hV⟩ : ∃ V ∈ 𝓝 (0 : G), K' + V ⊆ U := compact_open_separated_add_right hK' U_open K'U rcases Metric.mem_nhds_iff.1 V_mem with ⟨δ, δpos, hδ⟩ refine' ⟨min δ ε, lt_min δpos εpos, min_le_right δ ε, _⟩ exact (add_subset_add_left ((ball_subset_ball (min_le_left _ _)).trans hδ)).trans hV [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U ⊢ ∃ δ, 0 < δ ∧ δ ≤ ε ∧ K' + ball 0 δ ⊆ U [PROOFSTEP] obtain ⟨V, V_mem, hV⟩ : ∃ V ∈ 𝓝 (0 : G), K' + V ⊆ U := compact_open_separated_add_right hK' U_open K'U [GOAL] case intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U V : Set G V_mem : V ∈ 𝓝 0 hV : K' + V ⊆ U ⊢ ∃ δ, 0 < δ ∧ δ ≤ ε ∧ K' + ball 0 δ ⊆ U [PROOFSTEP] rcases Metric.mem_nhds_iff.1 V_mem with ⟨δ, δpos, hδ⟩ [GOAL] case intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U V : Set G V_mem : V ∈ 𝓝 0 hV : K' + V ⊆ U δ : ℝ δpos : δ > 0 hδ : ball 0 δ ⊆ V ⊢ ∃ δ, 0 < δ ∧ δ ≤ ε ∧ K' + ball 0 δ ⊆ U [PROOFSTEP] refine' ⟨min δ ε, lt_min δpos εpos, min_le_right δ ε, _⟩ [GOAL] case intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U V : Set G V_mem : V ∈ 𝓝 0 hV : K' + V ⊆ U δ : ℝ δpos : δ > 0 hδ : ball 0 δ ⊆ V ⊢ K' + ball 0 (min δ ε) ⊆ U [PROOFSTEP] exact (add_subset_add_left ((ball_subset_ball (min_le_left _ _)).trans hδ)).trans hV [GOAL] case intro.intro.intro.intro.intro.intro.intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U ⊢ HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f ⋆[precompR (P × G) L, q₀.snd] fun x => fderiv 𝕜 (↿g) (q₀.fst, x)) q₀ [PROOFSTEP] letI := ContinuousLinearMap.hasOpNorm (𝕜 := 𝕜) (𝕜₂ := 𝕜) (E := E) (F := (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) (σ₁₂ := RingHom.id 𝕜) [GOAL] case intro.intro.intro.intro.intro.intro.intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm ⊢ HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f ⋆[precompR (P × G) L, q₀.snd] fun x => fderiv 𝕜 (↿g) (q₀.fst, x)) q₀ [PROOFSTEP] let bound : G → ℝ := indicator U fun t => ‖(L.precompR (P × G))‖ * ‖f t‖ * C [GOAL] case intro.intro.intro.intro.intro.intro.intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C ⊢ HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f ⋆[precompR (P × G) L, q₀.snd] fun x => fderiv 𝕜 (↿g) (q₀.fst, x)) q₀ [PROOFSTEP] have I4 : ∀ᵐ a : G ∂μ, ∀ x : P × G, dist x q₀ < δ → ‖L.precompR (P × G) (f a) (g' (x.fst, x.snd - a))‖ ≤ bound a := by apply eventually_of_forall intro a x hx rw [Prod.dist_eq, dist_eq_norm, dist_eq_norm] at hx have : (-tsupport fun a => g' (x.1, a)) + ball q₀.2 δ ⊆ U := by apply Subset.trans _ hδ rw [K'_def, add_assoc] apply add_subset_add · rw [neg_subset_neg] refine closure_minimal (support_subset_iff'.2 fun z hz => ?_) hk.isClosed apply g'_zero x.1 z (h₀ε _) hz rw [mem_ball_iff_norm] exact ((le_max_left _ _).trans_lt hx).trans_le δε · simp only [add_ball, thickening_singleton, zero_vadd, subset_rfl] apply convolution_integrand_bound_right_of_le_of_subset _ _ _ this · intro y exact hε _ _ (((le_max_left _ _).trans_lt hx).trans_le δε) · rw [mem_ball_iff_norm] exact (le_max_right _ _).trans_lt hx [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C ⊢ ∀ᵐ (a : G) ∂μ, ∀ (x : P × G), dist x q₀ < δ → ‖↑(↑(precompR (P × G) L) (f a)) (g' (x.fst, x.snd - a))‖ ≤ bound a [PROOFSTEP] apply eventually_of_forall [GOAL] case hp 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C ⊢ ∀ (x : G) (x_1 : P × G), dist x_1 q₀ < δ → ‖↑(↑(precompR (P × G) L) (f x)) (g' (x_1.fst, x_1.snd - x))‖ ≤ bound x [PROOFSTEP] intro a x hx [GOAL] case hp 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C a : G x : P × G hx : dist x q₀ < δ ⊢ ‖↑(↑(precompR (P × G) L) (f a)) (g' (x.fst, x.snd - a))‖ ≤ bound a [PROOFSTEP] rw [Prod.dist_eq, dist_eq_norm, dist_eq_norm] at hx [GOAL] case hp 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C a : G x : P × G hx : max ‖x.fst - q₀.fst‖ ‖x.snd - q₀.snd‖ < δ ⊢ ‖↑(↑(precompR (P × G) L) (f a)) (g' (x.fst, x.snd - a))‖ ≤ bound a [PROOFSTEP] have : (-tsupport fun a => g' (x.1, a)) + ball q₀.2 δ ⊆ U := by apply Subset.trans _ hδ rw [K'_def, add_assoc] apply add_subset_add · rw [neg_subset_neg] refine closure_minimal (support_subset_iff'.2 fun z hz => ?_) hk.isClosed apply g'_zero x.1 z (h₀ε _) hz rw [mem_ball_iff_norm] exact ((le_max_left _ _).trans_lt hx).trans_le δε · simp only [add_ball, thickening_singleton, zero_vadd, subset_rfl] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C a : G x : P × G hx : max ‖x.fst - q₀.fst‖ ‖x.snd - q₀.snd‖ < δ ⊢ (-tsupport fun a => g' (x.fst, a)) + ball q₀.snd δ ⊆ U [PROOFSTEP] apply Subset.trans _ hδ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C a : G x : P × G hx : max ‖x.fst - q₀.fst‖ ‖x.snd - q₀.snd‖ < δ ⊢ (-tsupport fun a => g' (x.fst, a)) + ball q₀.snd δ ⊆ K' + ball 0 δ [PROOFSTEP] rw [K'_def, add_assoc] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C a : G x : P × G hx : max ‖x.fst - q₀.fst‖ ‖x.snd - q₀.snd‖ < δ ⊢ (-tsupport fun a => g' (x.fst, a)) + ball q₀.snd δ ⊆ -k + ({q₀.snd} + ball 0 δ) [PROOFSTEP] apply add_subset_add [GOAL] case a 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C a : G x : P × G hx : max ‖x.fst - q₀.fst‖ ‖x.snd - q₀.snd‖ < δ ⊢ (-tsupport fun a => g' (x.fst, a)) ⊆ -k [PROOFSTEP] rw [neg_subset_neg] [GOAL] case a 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C a : G x : P × G hx : max ‖x.fst - q₀.fst‖ ‖x.snd - q₀.snd‖ < δ ⊢ (tsupport fun a => g' (x.fst, a)) ⊆ k [PROOFSTEP] refine closure_minimal (support_subset_iff'.2 fun z hz => ?_) hk.isClosed [GOAL] case a 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C a : G x : P × G hx : max ‖x.fst - q₀.fst‖ ‖x.snd - q₀.snd‖ < δ z : G hz : ¬z ∈ k ⊢ g' (x.fst, z) = 0 [PROOFSTEP] apply g'_zero x.1 z (h₀ε _) hz [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C a : G x : P × G hx : max ‖x.fst - q₀.fst‖ ‖x.snd - q₀.snd‖ < δ z : G hz : ¬z ∈ k ⊢ x.fst ∈ ball q₀.fst ε [PROOFSTEP] rw [mem_ball_iff_norm] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C a : G x : P × G hx : max ‖x.fst - q₀.fst‖ ‖x.snd - q₀.snd‖ < δ z : G hz : ¬z ∈ k ⊢ ‖x.fst - q₀.fst‖ < ε [PROOFSTEP] exact ((le_max_left _ _).trans_lt hx).trans_le δε [GOAL] case a 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C a : G x : P × G hx : max ‖x.fst - q₀.fst‖ ‖x.snd - q₀.snd‖ < δ ⊢ ball q₀.snd δ ⊆ {q₀.snd} + ball 0 δ [PROOFSTEP] simp only [add_ball, thickening_singleton, zero_vadd, subset_rfl] [GOAL] case hp 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this✝ : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C a : G x : P × G hx : max ‖x.fst - q₀.fst‖ ‖x.snd - q₀.snd‖ < δ this : (-tsupport fun a => g' (x.fst, a)) + ball q₀.snd δ ⊆ U ⊢ ‖↑(↑(precompR (P × G) L) (f a)) (g' (x.fst, x.snd - a))‖ ≤ bound a [PROOFSTEP] apply convolution_integrand_bound_right_of_le_of_subset _ _ _ this [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this✝ : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C a : G x : P × G hx : max ‖x.fst - q₀.fst‖ ‖x.snd - q₀.snd‖ < δ this : (-tsupport fun a => g' (x.fst, a)) + ball q₀.snd δ ⊆ U ⊢ ∀ (i : G), ‖g' (x.fst, i)‖ ≤ C [PROOFSTEP] intro y [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y✝ y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this✝ : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C a : G x : P × G hx : max ‖x.fst - q₀.fst‖ ‖x.snd - q₀.snd‖ < δ this : (-tsupport fun a => g' (x.fst, a)) + ball q₀.snd δ ⊆ U y : G ⊢ ‖g' (x.fst, y)‖ ≤ C [PROOFSTEP] exact hε _ _ (((le_max_left _ _).trans_lt hx).trans_le δε) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this✝ : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C a : G x : P × G hx : max ‖x.fst - q₀.fst‖ ‖x.snd - q₀.snd‖ < δ this : (-tsupport fun a => g' (x.fst, a)) + ball q₀.snd δ ⊆ U ⊢ x.snd ∈ ball q₀.snd δ [PROOFSTEP] rw [mem_ball_iff_norm] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this✝ : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C a : G x : P × G hx : max ‖x.fst - q₀.fst‖ ‖x.snd - q₀.snd‖ < δ this : (-tsupport fun a => g' (x.fst, a)) + ball q₀.snd δ ⊆ U ⊢ ‖x.snd - q₀.snd‖ < δ [PROOFSTEP] exact (le_max_right _ _).trans_lt hx [GOAL] case intro.intro.intro.intro.intro.intro.intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C I4 : ∀ᵐ (a : G) ∂μ, ∀ (x : P × G), dist x q₀ < δ → ‖↑(↑(precompR (P × G) L) (f a)) (g' (x.fst, x.snd - a))‖ ≤ bound a ⊢ HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f ⋆[precompR (P × G) L, q₀.snd] fun x => fderiv 𝕜 (↿g) (q₀.fst, x)) q₀ [PROOFSTEP] have I5 : Integrable bound μ := by rw [integrable_indicator_iff U_open.measurableSet] exact (hU.norm.const_mul _).mul_const _ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C I4 : ∀ᵐ (a : G) ∂μ, ∀ (x : P × G), dist x q₀ < δ → ‖↑(↑(precompR (P × G) L) (f a)) (g' (x.fst, x.snd - a))‖ ≤ bound a ⊢ Integrable bound [PROOFSTEP] rw [integrable_indicator_iff U_open.measurableSet] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C I4 : ∀ᵐ (a : G) ∂μ, ∀ (x : P × G), dist x q₀ < δ → ‖↑(↑(precompR (P × G) L) (f a)) (g' (x.fst, x.snd - a))‖ ≤ bound a ⊢ IntegrableOn (fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C) U [PROOFSTEP] exact (hU.norm.const_mul _).mul_const _ [GOAL] case intro.intro.intro.intro.intro.intro.intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C I4 : ∀ᵐ (a : G) ∂μ, ∀ (x : P × G), dist x q₀ < δ → ‖↑(↑(precompR (P × G) L) (f a)) (g' (x.fst, x.snd - a))‖ ≤ bound a I5 : Integrable bound ⊢ HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f ⋆[precompR (P × G) L, q₀.snd] fun x => fderiv 𝕜 (↿g) (q₀.fst, x)) q₀ [PROOFSTEP] have I6 : ∀ᵐ a : G ∂μ, ∀ x : P × G, dist x q₀ < δ → HasFDerivAt (fun x : P × G => L (f a) (g x.1 (x.2 - a))) ((L (f a)).comp (g' (x.fst, x.snd - a))) x := by apply eventually_of_forall intro a x hx apply (L _).hasFDerivAt.comp x have N : s ×ˢ univ ∈ 𝓝 (x.1, x.2 - a) := by apply A' apply h₀ε rw [Prod.dist_eq] at hx exact lt_of_lt_of_le (lt_of_le_of_lt (le_max_left _ _) hx) δε have Z := ((hg.differentiableOn le_rfl).differentiableAt N).hasFDerivAt have Z' : HasFDerivAt (fun x : P × G => (x.1, x.2 - a)) (ContinuousLinearMap.id 𝕜 (P × G)) x := by have : (fun x : P × G => (x.1, x.2 - a)) = _root_.id - fun x => (0, a) := by ext x <;> simp only [Pi.sub_apply, id.def, Prod.fst_sub, sub_zero, Prod.snd_sub] rw [this] exact (hasFDerivAt_id x).sub_const (0, a) exact Z.comp x Z' [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C I4 : ∀ᵐ (a : G) ∂μ, ∀ (x : P × G), dist x q₀ < δ → ‖↑(↑(precompR (P × G) L) (f a)) (g' (x.fst, x.snd - a))‖ ≤ bound a I5 : Integrable bound ⊢ ∀ᵐ (a : G) ∂μ, ∀ (x : P × G), dist x q₀ < δ → HasFDerivAt (fun x => ↑(↑L (f a)) (g x.fst (x.snd - a))) (ContinuousLinearMap.comp (↑L (f a)) (g' (x.fst, x.snd - a))) x [PROOFSTEP] apply eventually_of_forall [GOAL] case hp 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C I4 : ∀ᵐ (a : G) ∂μ, ∀ (x : P × G), dist x q₀ < δ → ‖↑(↑(precompR (P × G) L) (f a)) (g' (x.fst, x.snd - a))‖ ≤ bound a I5 : Integrable bound ⊢ ∀ (x : G) (x_1 : P × G), dist x_1 q₀ < δ → HasFDerivAt (fun x_2 => ↑(↑L (f x)) (g x_2.fst (x_2.snd - x))) (ContinuousLinearMap.comp (↑L (f x)) (g' (x_1.fst, x_1.snd - x))) x_1 [PROOFSTEP] intro a x hx [GOAL] case hp 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C I4 : ∀ᵐ (a : G) ∂μ, ∀ (x : P × G), dist x q₀ < δ → ‖↑(↑(precompR (P × G) L) (f a)) (g' (x.fst, x.snd - a))‖ ≤ bound a I5 : Integrable bound a : G x : P × G hx : dist x q₀ < δ ⊢ HasFDerivAt (fun x => ↑(↑L (f a)) (g x.fst (x.snd - a))) (ContinuousLinearMap.comp (↑L (f a)) (g' (x.fst, x.snd - a))) x [PROOFSTEP] apply (L _).hasFDerivAt.comp x [GOAL] case hp 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C I4 : ∀ᵐ (a : G) ∂μ, ∀ (x : P × G), dist x q₀ < δ → ‖↑(↑(precompR (P × G) L) (f a)) (g' (x.fst, x.snd - a))‖ ≤ bound a I5 : Integrable bound a : G x : P × G hx : dist x q₀ < δ ⊢ HasFDerivAt (fun x => g x.fst (x.snd - a)) (g' (x.fst, x.snd - a)) x [PROOFSTEP] have N : s ×ˢ univ ∈ 𝓝 (x.1, x.2 - a) := by apply A' apply h₀ε rw [Prod.dist_eq] at hx exact lt_of_lt_of_le (lt_of_le_of_lt (le_max_left _ _) hx) δε [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C I4 : ∀ᵐ (a : G) ∂μ, ∀ (x : P × G), dist x q₀ < δ → ‖↑(↑(precompR (P × G) L) (f a)) (g' (x.fst, x.snd - a))‖ ≤ bound a I5 : Integrable bound a : G x : P × G hx : dist x q₀ < δ ⊢ s ×ˢ univ ∈ 𝓝 (x.fst, x.snd - a) [PROOFSTEP] apply A' [GOAL] case a 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C I4 : ∀ᵐ (a : G) ∂μ, ∀ (x : P × G), dist x q₀ < δ → ‖↑(↑(precompR (P × G) L) (f a)) (g' (x.fst, x.snd - a))‖ ≤ bound a I5 : Integrable bound a : G x : P × G hx : dist x q₀ < δ ⊢ (x.fst, x.snd - a).fst ∈ s [PROOFSTEP] apply h₀ε [GOAL] case a.a 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C I4 : ∀ᵐ (a : G) ∂μ, ∀ (x : P × G), dist x q₀ < δ → ‖↑(↑(precompR (P × G) L) (f a)) (g' (x.fst, x.snd - a))‖ ≤ bound a I5 : Integrable bound a : G x : P × G hx : dist x q₀ < δ ⊢ (x.fst, x.snd - a).fst ∈ ball q₀.fst ε [PROOFSTEP] rw [Prod.dist_eq] at hx [GOAL] case a.a 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C I4 : ∀ᵐ (a : G) ∂μ, ∀ (x : P × G), dist x q₀ < δ → ‖↑(↑(precompR (P × G) L) (f a)) (g' (x.fst, x.snd - a))‖ ≤ bound a I5 : Integrable bound a : G x : P × G hx : max (dist x.fst q₀.fst) (dist x.snd q₀.snd) < δ ⊢ (x.fst, x.snd - a).fst ∈ ball q₀.fst ε [PROOFSTEP] exact lt_of_lt_of_le (lt_of_le_of_lt (le_max_left _ _) hx) δε [GOAL] case hp 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C I4 : ∀ᵐ (a : G) ∂μ, ∀ (x : P × G), dist x q₀ < δ → ‖↑(↑(precompR (P × G) L) (f a)) (g' (x.fst, x.snd - a))‖ ≤ bound a I5 : Integrable bound a : G x : P × G hx : dist x q₀ < δ N : s ×ˢ univ ∈ 𝓝 (x.fst, x.snd - a) ⊢ HasFDerivAt (fun x => g x.fst (x.snd - a)) (g' (x.fst, x.snd - a)) x [PROOFSTEP] have Z := ((hg.differentiableOn le_rfl).differentiableAt N).hasFDerivAt [GOAL] case hp 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C I4 : ∀ᵐ (a : G) ∂μ, ∀ (x : P × G), dist x q₀ < δ → ‖↑(↑(precompR (P × G) L) (f a)) (g' (x.fst, x.snd - a))‖ ≤ bound a I5 : Integrable bound a : G x : P × G hx : dist x q₀ < δ N : s ×ˢ univ ∈ 𝓝 (x.fst, x.snd - a) Z : HasFDerivAt (↿g) (fderiv 𝕜 (↿g) (x.fst, x.snd - a)) (x.fst, x.snd - a) ⊢ HasFDerivAt (fun x => g x.fst (x.snd - a)) (g' (x.fst, x.snd - a)) x [PROOFSTEP] have Z' : HasFDerivAt (fun x : P × G => (x.1, x.2 - a)) (ContinuousLinearMap.id 𝕜 (P × G)) x := by have : (fun x : P × G => (x.1, x.2 - a)) = _root_.id - fun x => (0, a) := by ext x <;> simp only [Pi.sub_apply, id.def, Prod.fst_sub, sub_zero, Prod.snd_sub] rw [this] exact (hasFDerivAt_id x).sub_const (0, a) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C I4 : ∀ᵐ (a : G) ∂μ, ∀ (x : P × G), dist x q₀ < δ → ‖↑(↑(precompR (P × G) L) (f a)) (g' (x.fst, x.snd - a))‖ ≤ bound a I5 : Integrable bound a : G x : P × G hx : dist x q₀ < δ N : s ×ˢ univ ∈ 𝓝 (x.fst, x.snd - a) Z : HasFDerivAt (↿g) (fderiv 𝕜 (↿g) (x.fst, x.snd - a)) (x.fst, x.snd - a) ⊢ HasFDerivAt (fun x => (x.fst, x.snd - a)) (ContinuousLinearMap.id 𝕜 (P × G)) x [PROOFSTEP] have : (fun x : P × G => (x.1, x.2 - a)) = _root_.id - fun x => (0, a) := by ext x <;> simp only [Pi.sub_apply, id.def, Prod.fst_sub, sub_zero, Prod.snd_sub] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C I4 : ∀ᵐ (a : G) ∂μ, ∀ (x : P × G), dist x q₀ < δ → ‖↑(↑(precompR (P × G) L) (f a)) (g' (x.fst, x.snd - a))‖ ≤ bound a I5 : Integrable bound a : G x : P × G hx : dist x q₀ < δ N : s ×ˢ univ ∈ 𝓝 (x.fst, x.snd - a) Z : HasFDerivAt (↿g) (fderiv 𝕜 (↿g) (x.fst, x.snd - a)) (x.fst, x.snd - a) ⊢ (fun x => (x.fst, x.snd - a)) = _root_.id - fun x => (0, a) [PROOFSTEP] ext x [GOAL] case h.h₁ 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝¹ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C I4 : ∀ᵐ (a : G) ∂μ, ∀ (x : P × G), dist x q₀ < δ → ‖↑(↑(precompR (P × G) L) (f a)) (g' (x.fst, x.snd - a))‖ ≤ bound a I5 : Integrable bound a : G x✝ : P × G hx : dist x✝ q₀ < δ N : s ×ˢ univ ∈ 𝓝 (x✝.fst, x✝.snd - a) Z : HasFDerivAt (↿g) (fderiv 𝕜 (↿g) (x✝.fst, x✝.snd - a)) (x✝.fst, x✝.snd - a) x : P × G ⊢ (x.fst, x.snd - a).fst = ((_root_.id - fun x => (0, a)) x).fst [PROOFSTEP] simp only [Pi.sub_apply, id.def, Prod.fst_sub, sub_zero, Prod.snd_sub] [GOAL] case h.h₂ 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝¹ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C I4 : ∀ᵐ (a : G) ∂μ, ∀ (x : P × G), dist x q₀ < δ → ‖↑(↑(precompR (P × G) L) (f a)) (g' (x.fst, x.snd - a))‖ ≤ bound a I5 : Integrable bound a : G x✝ : P × G hx : dist x✝ q₀ < δ N : s ×ˢ univ ∈ 𝓝 (x✝.fst, x✝.snd - a) Z : HasFDerivAt (↿g) (fderiv 𝕜 (↿g) (x✝.fst, x✝.snd - a)) (x✝.fst, x✝.snd - a) x : P × G ⊢ (x.fst, x.snd - a).snd = ((_root_.id - fun x => (0, a)) x).snd [PROOFSTEP] simp only [Pi.sub_apply, id.def, Prod.fst_sub, sub_zero, Prod.snd_sub] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this✝ : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C I4 : ∀ᵐ (a : G) ∂μ, ∀ (x : P × G), dist x q₀ < δ → ‖↑(↑(precompR (P × G) L) (f a)) (g' (x.fst, x.snd - a))‖ ≤ bound a I5 : Integrable bound a : G x : P × G hx : dist x q₀ < δ N : s ×ˢ univ ∈ 𝓝 (x.fst, x.snd - a) Z : HasFDerivAt (↿g) (fderiv 𝕜 (↿g) (x.fst, x.snd - a)) (x.fst, x.snd - a) this : (fun x => (x.fst, x.snd - a)) = _root_.id - fun x => (0, a) ⊢ HasFDerivAt (fun x => (x.fst, x.snd - a)) (ContinuousLinearMap.id 𝕜 (P × G)) x [PROOFSTEP] rw [this] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this✝ : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C I4 : ∀ᵐ (a : G) ∂μ, ∀ (x : P × G), dist x q₀ < δ → ‖↑(↑(precompR (P × G) L) (f a)) (g' (x.fst, x.snd - a))‖ ≤ bound a I5 : Integrable bound a : G x : P × G hx : dist x q₀ < δ N : s ×ˢ univ ∈ 𝓝 (x.fst, x.snd - a) Z : HasFDerivAt (↿g) (fderiv 𝕜 (↿g) (x.fst, x.snd - a)) (x.fst, x.snd - a) this : (fun x => (x.fst, x.snd - a)) = _root_.id - fun x => (0, a) ⊢ HasFDerivAt (_root_.id - fun x => (0, a)) (ContinuousLinearMap.id 𝕜 (P × G)) x [PROOFSTEP] exact (hasFDerivAt_id x).sub_const (0, a) [GOAL] case hp 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C I4 : ∀ᵐ (a : G) ∂μ, ∀ (x : P × G), dist x q₀ < δ → ‖↑(↑(precompR (P × G) L) (f a)) (g' (x.fst, x.snd - a))‖ ≤ bound a I5 : Integrable bound a : G x : P × G hx : dist x q₀ < δ N : s ×ˢ univ ∈ 𝓝 (x.fst, x.snd - a) Z : HasFDerivAt (↿g) (fderiv 𝕜 (↿g) (x.fst, x.snd - a)) (x.fst, x.snd - a) Z' : HasFDerivAt (fun x => (x.fst, x.snd - a)) (ContinuousLinearMap.id 𝕜 (P × G)) x ⊢ HasFDerivAt (fun x => g x.fst (x.snd - a)) (g' (x.fst, x.snd - a)) x [PROOFSTEP] exact Z.comp x Z' [GOAL] case intro.intro.intro.intro.intro.intro.intro.intro.intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g✝ g'✝ : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 1 (↿g) (s ×ˢ univ) q₀ : P × G hq₀ : q₀.fst ∈ s g' : P × G → P × G →L[𝕜] E' := fderiv 𝕜 ↿g A : ∀ (p : P), p ∈ s → Continuous (g p) A' : ∀ (q : P × G), q.fst ∈ s → s ×ˢ univ ∈ 𝓝 q g'_zero : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g' (p, x) = 0 ε C : ℝ εpos : 0 < ε h₀ε : ball q₀.fst ε ⊆ s hε : ∀ (p : P) (x : G), ‖p - q₀.fst‖ < ε → ‖g' (p, x)‖ ≤ C I1 : ∀ᶠ (x : P × G) in 𝓝 q₀, AEStronglyMeasurable (fun a => ↑(↑L (f a)) (g x.fst (x.snd - a))) μ I2 : Integrable fun a => ↑(↑L (f a)) (g q₀.fst (q₀.snd - a)) I3 : AEStronglyMeasurable (fun a => ContinuousLinearMap.comp (↑L (f a)) (g' (q₀.fst, q₀.snd - a))) μ K' : Set G := -k + {q₀.snd} K'_def : K' = -k + {q₀.snd} hK' : IsCompact K' U : Set G U_open : IsOpen U K'U : K' ⊆ U hU : IntegrableOn f U δ : ℝ δpos : 0 < δ δε : δ ≤ ε hδ : K' + ball 0 δ ⊆ U this : Norm (E →L[𝕜] (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) := hasOpNorm bound : G → ℝ := indicator U fun t => ‖precompR (P × G) L‖ * ‖f t‖ * C I4 : ∀ᵐ (a : G) ∂μ, ∀ (x : P × G), dist x q₀ < δ → ‖↑(↑(precompR (P × G) L) (f a)) (g' (x.fst, x.snd - a))‖ ≤ bound a I5 : Integrable bound I6 : ∀ᵐ (a : G) ∂μ, ∀ (x : P × G), dist x q₀ < δ → HasFDerivAt (fun x => ↑(↑L (f a)) (g x.fst (x.snd - a))) (ContinuousLinearMap.comp (↑L (f a)) (g' (x.fst, x.snd - a))) x ⊢ HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f ⋆[precompR (P × G) L, q₀.snd] fun x => fderiv 𝕜 (↿g) (q₀.fst, x)) q₀ [PROOFSTEP] exact hasFDerivAt_integral_of_dominated_of_fderiv_le δpos I1 I2 I3 I4 I5 I6 [GOAL] 𝕜 : Type u𝕜 G✝ : Type uG E : Type uE E'✝ : Type uE' E'' : Type uE'' F✝ : Type uF F' : Type uF' F'' : Type uF'' P✝ : Type uP inst✝²⁸ : NormedAddCommGroup E inst✝²⁷ : NormedAddCommGroup E'✝ inst✝²⁶ : NormedAddCommGroup E'' inst✝²⁵ : NormedAddCommGroup F✝ f✝ f' : G✝ → E g✝ g' : G✝ → E'✝ x x' : G✝ y y' : E inst✝²⁴ : IsROrC 𝕜 inst✝²³ : NormedSpace 𝕜 E inst✝²² : NormedSpace 𝕜 E'✝ inst✝²¹ : NormedSpace 𝕜 E'' inst✝²⁰ : NormedSpace ℝ F✝ inst✝¹⁹ : NormedSpace 𝕜 F✝ inst✝¹⁸ : CompleteSpace F✝ inst✝¹⁷ : MeasurableSpace G✝ inst✝¹⁶ : NormedAddCommGroup G✝ inst✝¹⁵ : BorelSpace G✝ inst✝¹⁴ : NormedSpace 𝕜 G✝ inst✝¹³ : NormedAddCommGroup P✝ inst✝¹² : NormedSpace 𝕜 P✝ μ✝ : Measure G✝ L✝ : E →L[𝕜] E'✝ →L[𝕜] F✝ G E' F P : Type uP inst✝¹¹ : NormedAddCommGroup E' inst✝¹⁰ : NormedAddCommGroup F inst✝⁹ : NormedSpace 𝕜 E' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G μ : Measure G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) ⊢ ContDiffOn 𝕜 n (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] induction' n using ENat.nat_induction with n ih ih generalizing g E' F [GOAL] case h0 𝕜 : Type u𝕜 G✝ : Type uG E : Type uE E'✝¹ : Type uE' E'' : Type uE'' F✝¹ : Type uF F' : Type uF' F'' : Type uF'' P✝ : Type uP inst✝³⁴ : NormedAddCommGroup E inst✝³³ : NormedAddCommGroup E'✝¹ inst✝³² : NormedAddCommGroup E'' inst✝³¹ : NormedAddCommGroup F✝¹ f✝ f' : G✝ → E g✝¹ g' : G✝ → E'✝¹ x x' : G✝ y y' : E inst✝³⁰ : IsROrC 𝕜 inst✝²⁹ : NormedSpace 𝕜 E inst✝²⁸ : NormedSpace 𝕜 E'✝¹ inst✝²⁷ : NormedSpace 𝕜 E'' inst✝²⁶ : NormedSpace ℝ F✝¹ inst✝²⁵ : NormedSpace 𝕜 F✝¹ inst✝²⁴ : CompleteSpace F✝¹ inst✝²³ : MeasurableSpace G✝ inst✝²² : NormedAddCommGroup G✝ inst✝²¹ : BorelSpace G✝ inst✝²⁰ : NormedSpace 𝕜 G✝ inst✝¹⁹ : NormedAddCommGroup P✝ inst✝¹⁸ : NormedSpace 𝕜 P✝ μ✝ : Measure G✝ L✝¹ : E →L[𝕜] E'✝¹ →L[𝕜] F✝¹ G E'✝ F✝ P : Type uP inst✝¹⁷ : NormedAddCommGroup E'✝ inst✝¹⁶ : NormedAddCommGroup F✝ inst✝¹⁵ : NormedSpace 𝕜 E'✝ inst✝¹⁴ : NormedSpace ℝ F✝ inst✝¹³ : NormedSpace 𝕜 F✝ inst✝¹² : CompleteSpace F✝ inst✝¹¹ : MeasurableSpace G μ : Measure G inst✝¹⁰ : NormedAddCommGroup G inst✝⁹ : BorelSpace G inst✝⁸ : NormedSpace 𝕜 G inst✝⁷ : NormedAddCommGroup P inst✝⁶ : NormedSpace 𝕜 P f : G → E n : ℕ∞ L✝ : E →L[𝕜] E'✝ →L[𝕜] F✝ g✝ : P → G → E'✝ s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs✝ : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g✝ p x = 0 hf : LocallyIntegrable f hg✝ : ContDiffOn 𝕜 n (↿g✝) (s ×ˢ univ) E' F : Type uP inst✝⁵ : NormedAddCommGroup E' inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace 𝕜 E' inst✝² : NormedSpace ℝ F inst✝¹ : NormedSpace 𝕜 F inst✝ : CompleteSpace F L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hg : ContDiffOn 𝕜 0 (↿g) (s ×ˢ univ) ⊢ ContDiffOn 𝕜 0 (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] rw [contDiffOn_zero] at hg ⊢ [GOAL] case h0 𝕜 : Type u𝕜 G✝ : Type uG E : Type uE E'✝¹ : Type uE' E'' : Type uE'' F✝¹ : Type uF F' : Type uF' F'' : Type uF'' P✝ : Type uP inst✝³⁴ : NormedAddCommGroup E inst✝³³ : NormedAddCommGroup E'✝¹ inst✝³² : NormedAddCommGroup E'' inst✝³¹ : NormedAddCommGroup F✝¹ f✝ f' : G✝ → E g✝¹ g' : G✝ → E'✝¹ x x' : G✝ y y' : E inst✝³⁰ : IsROrC 𝕜 inst✝²⁹ : NormedSpace 𝕜 E inst✝²⁸ : NormedSpace 𝕜 E'✝¹ inst✝²⁷ : NormedSpace 𝕜 E'' inst✝²⁶ : NormedSpace ℝ F✝¹ inst✝²⁵ : NormedSpace 𝕜 F✝¹ inst✝²⁴ : CompleteSpace F✝¹ inst✝²³ : MeasurableSpace G✝ inst✝²² : NormedAddCommGroup G✝ inst✝²¹ : BorelSpace G✝ inst✝²⁰ : NormedSpace 𝕜 G✝ inst✝¹⁹ : NormedAddCommGroup P✝ inst✝¹⁸ : NormedSpace 𝕜 P✝ μ✝ : Measure G✝ L✝¹ : E →L[𝕜] E'✝¹ →L[𝕜] F✝¹ G E'✝ F✝ P : Type uP inst✝¹⁷ : NormedAddCommGroup E'✝ inst✝¹⁶ : NormedAddCommGroup F✝ inst✝¹⁵ : NormedSpace 𝕜 E'✝ inst✝¹⁴ : NormedSpace ℝ F✝ inst✝¹³ : NormedSpace 𝕜 F✝ inst✝¹² : CompleteSpace F✝ inst✝¹¹ : MeasurableSpace G μ : Measure G inst✝¹⁰ : NormedAddCommGroup G inst✝⁹ : BorelSpace G inst✝⁸ : NormedSpace 𝕜 G inst✝⁷ : NormedAddCommGroup P inst✝⁶ : NormedSpace 𝕜 P f : G → E n : ℕ∞ L✝ : E →L[𝕜] E'✝ →L[𝕜] F✝ g✝ : P → G → E'✝ s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs✝ : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g✝ p x = 0 hf : LocallyIntegrable f hg✝ : ContDiffOn 𝕜 n (↿g✝) (s ×ˢ univ) E' F : Type uP inst✝⁵ : NormedAddCommGroup E' inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace 𝕜 E' inst✝² : NormedSpace ℝ F inst✝¹ : NormedSpace 𝕜 F inst✝ : CompleteSpace F L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hg : ContinuousOn (↿g) (s ×ˢ univ) ⊢ ContinuousOn (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] exact continuousOn_convolution_right_with_param L hk hgs hf hg [GOAL] case hsuc 𝕜 : Type u𝕜 G✝ : Type uG E : Type uE E'✝¹ : Type uE' E'' : Type uE'' F✝¹ : Type uF F' : Type uF' F'' : Type uF'' P✝ : Type uP inst✝³⁴ : NormedAddCommGroup E inst✝³³ : NormedAddCommGroup E'✝¹ inst✝³² : NormedAddCommGroup E'' inst✝³¹ : NormedAddCommGroup F✝¹ f✝ f' : G✝ → E g✝¹ g' : G✝ → E'✝¹ x x' : G✝ y y' : E inst✝³⁰ : IsROrC 𝕜 inst✝²⁹ : NormedSpace 𝕜 E inst✝²⁸ : NormedSpace 𝕜 E'✝¹ inst✝²⁷ : NormedSpace 𝕜 E'' inst✝²⁶ : NormedSpace ℝ F✝¹ inst✝²⁵ : NormedSpace 𝕜 F✝¹ inst✝²⁴ : CompleteSpace F✝¹ inst✝²³ : MeasurableSpace G✝ inst✝²² : NormedAddCommGroup G✝ inst✝²¹ : BorelSpace G✝ inst✝²⁰ : NormedSpace 𝕜 G✝ inst✝¹⁹ : NormedAddCommGroup P✝ inst✝¹⁸ : NormedSpace 𝕜 P✝ μ✝ : Measure G✝ L✝¹ : E →L[𝕜] E'✝¹ →L[𝕜] F✝¹ G E'✝ F✝ P : Type uP inst✝¹⁷ : NormedAddCommGroup E'✝ inst✝¹⁶ : NormedAddCommGroup F✝ inst✝¹⁵ : NormedSpace 𝕜 E'✝ inst✝¹⁴ : NormedSpace ℝ F✝ inst✝¹³ : NormedSpace 𝕜 F✝ inst✝¹² : CompleteSpace F✝ inst✝¹¹ : MeasurableSpace G μ : Measure G inst✝¹⁰ : NormedAddCommGroup G inst✝⁹ : BorelSpace G inst✝⁸ : NormedSpace 𝕜 G inst✝⁷ : NormedAddCommGroup P inst✝⁶ : NormedSpace 𝕜 P f : G → E n✝ : ℕ∞ L✝ : E →L[𝕜] E'✝ →L[𝕜] F✝ g✝ : P → G → E'✝ s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs✝ : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g✝ p x = 0 hf : LocallyIntegrable f hg✝ : ContDiffOn 𝕜 n✝ (↿g✝) (s ×ˢ univ) n : ℕ ih : ∀ {E' F : Type uP} [inst : NormedAddCommGroup E'] [inst_1 : NormedAddCommGroup F] [inst_2 : NormedSpace 𝕜 E'] [inst_3 : NormedSpace ℝ F] [inst_4 : NormedSpace 𝕜 F] [inst_5 : CompleteSpace F] (L : E →L[𝕜] E' →L[𝕜] F) {g : P → G → E'}, (∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0) → ContDiffOn 𝕜 (↑n) (↿g) (s ×ˢ univ) → ContDiffOn 𝕜 (↑n) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) E' F : Type uP inst✝⁵ : NormedAddCommGroup E' inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace 𝕜 E' inst✝² : NormedSpace ℝ F inst✝¹ : NormedSpace 𝕜 F inst✝ : CompleteSpace F L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hg : ContDiffOn 𝕜 (↑(Nat.succ n)) (↿g) (s ×ˢ univ) ⊢ ContDiffOn 𝕜 (↑(Nat.succ n)) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] let f' : P → G → P × G →L[𝕜] F := fun p a => (f ⋆[L.precompR (P × G), μ] fun x : G => fderiv 𝕜 (uncurry g) (p, x)) a [GOAL] case hsuc 𝕜 : Type u𝕜 G✝ : Type uG E : Type uE E'✝¹ : Type uE' E'' : Type uE'' F✝¹ : Type uF F' : Type uF' F'' : Type uF'' P✝ : Type uP inst✝³⁴ : NormedAddCommGroup E inst✝³³ : NormedAddCommGroup E'✝¹ inst✝³² : NormedAddCommGroup E'' inst✝³¹ : NormedAddCommGroup F✝¹ f✝ f'✝ : G✝ → E g✝¹ g' : G✝ → E'✝¹ x x' : G✝ y y' : E inst✝³⁰ : IsROrC 𝕜 inst✝²⁹ : NormedSpace 𝕜 E inst✝²⁸ : NormedSpace 𝕜 E'✝¹ inst✝²⁷ : NormedSpace 𝕜 E'' inst✝²⁶ : NormedSpace ℝ F✝¹ inst✝²⁵ : NormedSpace 𝕜 F✝¹ inst✝²⁴ : CompleteSpace F✝¹ inst✝²³ : MeasurableSpace G✝ inst✝²² : NormedAddCommGroup G✝ inst✝²¹ : BorelSpace G✝ inst✝²⁰ : NormedSpace 𝕜 G✝ inst✝¹⁹ : NormedAddCommGroup P✝ inst✝¹⁸ : NormedSpace 𝕜 P✝ μ✝ : Measure G✝ L✝¹ : E →L[𝕜] E'✝¹ →L[𝕜] F✝¹ G E'✝ F✝ P : Type uP inst✝¹⁷ : NormedAddCommGroup E'✝ inst✝¹⁶ : NormedAddCommGroup F✝ inst✝¹⁵ : NormedSpace 𝕜 E'✝ inst✝¹⁴ : NormedSpace ℝ F✝ inst✝¹³ : NormedSpace 𝕜 F✝ inst✝¹² : CompleteSpace F✝ inst✝¹¹ : MeasurableSpace G μ : Measure G inst✝¹⁰ : NormedAddCommGroup G inst✝⁹ : BorelSpace G inst✝⁸ : NormedSpace 𝕜 G inst✝⁷ : NormedAddCommGroup P inst✝⁶ : NormedSpace 𝕜 P f : G → E n✝ : ℕ∞ L✝ : E →L[𝕜] E'✝ →L[𝕜] F✝ g✝ : P → G → E'✝ s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs✝ : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g✝ p x = 0 hf : LocallyIntegrable f hg✝ : ContDiffOn 𝕜 n✝ (↿g✝) (s ×ˢ univ) n : ℕ ih : ∀ {E' F : Type uP} [inst : NormedAddCommGroup E'] [inst_1 : NormedAddCommGroup F] [inst_2 : NormedSpace 𝕜 E'] [inst_3 : NormedSpace ℝ F] [inst_4 : NormedSpace 𝕜 F] [inst_5 : CompleteSpace F] (L : E →L[𝕜] E' →L[𝕜] F) {g : P → G → E'}, (∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0) → ContDiffOn 𝕜 (↑n) (↿g) (s ×ˢ univ) → ContDiffOn 𝕜 (↑n) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) E' F : Type uP inst✝⁵ : NormedAddCommGroup E' inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace 𝕜 E' inst✝² : NormedSpace ℝ F inst✝¹ : NormedSpace 𝕜 F inst✝ : CompleteSpace F L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hg : ContDiffOn 𝕜 (↑(Nat.succ n)) (↿g) (s ×ˢ univ) f' : P → G → P × G →L[𝕜] F := fun p a => f ⋆[precompR (P × G) L, a] fun x => fderiv 𝕜 (uncurry g) (p, x) ⊢ ContDiffOn 𝕜 (↑(Nat.succ n)) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] have A : ∀ q₀ : P × G, q₀.1 ∈ s → HasFDerivAt (fun q : P × G => (f ⋆[L, μ] g q.1) q.2) (f' q₀.1 q₀.2) q₀ := hasFDerivAt_convolution_right_with_param L hs hk hgs hf hg.one_of_succ [GOAL] case hsuc 𝕜 : Type u𝕜 G✝ : Type uG E : Type uE E'✝¹ : Type uE' E'' : Type uE'' F✝¹ : Type uF F' : Type uF' F'' : Type uF'' P✝ : Type uP inst✝³⁴ : NormedAddCommGroup E inst✝³³ : NormedAddCommGroup E'✝¹ inst✝³² : NormedAddCommGroup E'' inst✝³¹ : NormedAddCommGroup F✝¹ f✝ f'✝ : G✝ → E g✝¹ g' : G✝ → E'✝¹ x x' : G✝ y y' : E inst✝³⁰ : IsROrC 𝕜 inst✝²⁹ : NormedSpace 𝕜 E inst✝²⁸ : NormedSpace 𝕜 E'✝¹ inst✝²⁷ : NormedSpace 𝕜 E'' inst✝²⁶ : NormedSpace ℝ F✝¹ inst✝²⁵ : NormedSpace 𝕜 F✝¹ inst✝²⁴ : CompleteSpace F✝¹ inst✝²³ : MeasurableSpace G✝ inst✝²² : NormedAddCommGroup G✝ inst✝²¹ : BorelSpace G✝ inst✝²⁰ : NormedSpace 𝕜 G✝ inst✝¹⁹ : NormedAddCommGroup P✝ inst✝¹⁸ : NormedSpace 𝕜 P✝ μ✝ : Measure G✝ L✝¹ : E →L[𝕜] E'✝¹ →L[𝕜] F✝¹ G E'✝ F✝ P : Type uP inst✝¹⁷ : NormedAddCommGroup E'✝ inst✝¹⁶ : NormedAddCommGroup F✝ inst✝¹⁵ : NormedSpace 𝕜 E'✝ inst✝¹⁴ : NormedSpace ℝ F✝ inst✝¹³ : NormedSpace 𝕜 F✝ inst✝¹² : CompleteSpace F✝ inst✝¹¹ : MeasurableSpace G μ : Measure G inst✝¹⁰ : NormedAddCommGroup G inst✝⁹ : BorelSpace G inst✝⁸ : NormedSpace 𝕜 G inst✝⁷ : NormedAddCommGroup P inst✝⁶ : NormedSpace 𝕜 P f : G → E n✝ : ℕ∞ L✝ : E →L[𝕜] E'✝ →L[𝕜] F✝ g✝ : P → G → E'✝ s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs✝ : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g✝ p x = 0 hf : LocallyIntegrable f hg✝ : ContDiffOn 𝕜 n✝ (↿g✝) (s ×ˢ univ) n : ℕ ih : ∀ {E' F : Type uP} [inst : NormedAddCommGroup E'] [inst_1 : NormedAddCommGroup F] [inst_2 : NormedSpace 𝕜 E'] [inst_3 : NormedSpace ℝ F] [inst_4 : NormedSpace 𝕜 F] [inst_5 : CompleteSpace F] (L : E →L[𝕜] E' →L[𝕜] F) {g : P → G → E'}, (∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0) → ContDiffOn 𝕜 (↑n) (↿g) (s ×ˢ univ) → ContDiffOn 𝕜 (↑n) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) E' F : Type uP inst✝⁵ : NormedAddCommGroup E' inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace 𝕜 E' inst✝² : NormedSpace ℝ F inst✝¹ : NormedSpace 𝕜 F inst✝ : CompleteSpace F L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hg : ContDiffOn 𝕜 (↑(Nat.succ n)) (↿g) (s ×ˢ univ) f' : P → G → P × G →L[𝕜] F := fun p a => f ⋆[precompR (P × G) L, a] fun x => fderiv 𝕜 (uncurry g) (p, x) A : ∀ (q₀ : P × G), q₀.fst ∈ s → HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f' q₀.fst q₀.snd) q₀ ⊢ ContDiffOn 𝕜 (↑(Nat.succ n)) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] rw [contDiffOn_succ_iff_fderiv_of_open (hs.prod (@isOpen_univ G _))] at hg ⊢ [GOAL] case hsuc 𝕜 : Type u𝕜 G✝ : Type uG E : Type uE E'✝¹ : Type uE' E'' : Type uE'' F✝¹ : Type uF F' : Type uF' F'' : Type uF'' P✝ : Type uP inst✝³⁴ : NormedAddCommGroup E inst✝³³ : NormedAddCommGroup E'✝¹ inst✝³² : NormedAddCommGroup E'' inst✝³¹ : NormedAddCommGroup F✝¹ f✝ f'✝ : G✝ → E g✝¹ g' : G✝ → E'✝¹ x x' : G✝ y y' : E inst✝³⁰ : IsROrC 𝕜 inst✝²⁹ : NormedSpace 𝕜 E inst✝²⁸ : NormedSpace 𝕜 E'✝¹ inst✝²⁷ : NormedSpace 𝕜 E'' inst✝²⁶ : NormedSpace ℝ F✝¹ inst✝²⁵ : NormedSpace 𝕜 F✝¹ inst✝²⁴ : CompleteSpace F✝¹ inst✝²³ : MeasurableSpace G✝ inst✝²² : NormedAddCommGroup G✝ inst✝²¹ : BorelSpace G✝ inst✝²⁰ : NormedSpace 𝕜 G✝ inst✝¹⁹ : NormedAddCommGroup P✝ inst✝¹⁸ : NormedSpace 𝕜 P✝ μ✝ : Measure G✝ L✝¹ : E →L[𝕜] E'✝¹ →L[𝕜] F✝¹ G E'✝ F✝ P : Type uP inst✝¹⁷ : NormedAddCommGroup E'✝ inst✝¹⁶ : NormedAddCommGroup F✝ inst✝¹⁵ : NormedSpace 𝕜 E'✝ inst✝¹⁴ : NormedSpace ℝ F✝ inst✝¹³ : NormedSpace 𝕜 F✝ inst✝¹² : CompleteSpace F✝ inst✝¹¹ : MeasurableSpace G μ : Measure G inst✝¹⁰ : NormedAddCommGroup G inst✝⁹ : BorelSpace G inst✝⁸ : NormedSpace 𝕜 G inst✝⁷ : NormedAddCommGroup P inst✝⁶ : NormedSpace 𝕜 P f : G → E n✝ : ℕ∞ L✝ : E →L[𝕜] E'✝ →L[𝕜] F✝ g✝ : P → G → E'✝ s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs✝ : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g✝ p x = 0 hf : LocallyIntegrable f hg✝ : ContDiffOn 𝕜 n✝ (↿g✝) (s ×ˢ univ) n : ℕ ih : ∀ {E' F : Type uP} [inst : NormedAddCommGroup E'] [inst_1 : NormedAddCommGroup F] [inst_2 : NormedSpace 𝕜 E'] [inst_3 : NormedSpace ℝ F] [inst_4 : NormedSpace 𝕜 F] [inst_5 : CompleteSpace F] (L : E →L[𝕜] E' →L[𝕜] F) {g : P → G → E'}, (∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0) → ContDiffOn 𝕜 (↑n) (↿g) (s ×ˢ univ) → ContDiffOn 𝕜 (↑n) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) E' F : Type uP inst✝⁵ : NormedAddCommGroup E' inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace 𝕜 E' inst✝² : NormedSpace ℝ F inst✝¹ : NormedSpace 𝕜 F inst✝ : CompleteSpace F L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hg : DifferentiableOn 𝕜 (↿g) (s ×ˢ univ) ∧ ContDiffOn 𝕜 (↑n) (fun y => fderiv 𝕜 (↿g) y) (s ×ˢ univ) f' : P → G → P × G →L[𝕜] F := fun p a => f ⋆[precompR (P × G) L, a] fun x => fderiv 𝕜 (uncurry g) (p, x) A : ∀ (q₀ : P × G), q₀.fst ∈ s → HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f' q₀.fst q₀.snd) q₀ ⊢ DifferentiableOn 𝕜 (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) ∧ ContDiffOn 𝕜 (↑n) (fun y => fderiv 𝕜 (fun q => f ⋆[L, q.snd] g q.fst) y) (s ×ˢ univ) [PROOFSTEP] constructor [GOAL] case hsuc.left 𝕜 : Type u𝕜 G✝ : Type uG E : Type uE E'✝¹ : Type uE' E'' : Type uE'' F✝¹ : Type uF F' : Type uF' F'' : Type uF'' P✝ : Type uP inst✝³⁴ : NormedAddCommGroup E inst✝³³ : NormedAddCommGroup E'✝¹ inst✝³² : NormedAddCommGroup E'' inst✝³¹ : NormedAddCommGroup F✝¹ f✝ f'✝ : G✝ → E g✝¹ g' : G✝ → E'✝¹ x x' : G✝ y y' : E inst✝³⁰ : IsROrC 𝕜 inst✝²⁹ : NormedSpace 𝕜 E inst✝²⁸ : NormedSpace 𝕜 E'✝¹ inst✝²⁷ : NormedSpace 𝕜 E'' inst✝²⁶ : NormedSpace ℝ F✝¹ inst✝²⁵ : NormedSpace 𝕜 F✝¹ inst✝²⁴ : CompleteSpace F✝¹ inst✝²³ : MeasurableSpace G✝ inst✝²² : NormedAddCommGroup G✝ inst✝²¹ : BorelSpace G✝ inst✝²⁰ : NormedSpace 𝕜 G✝ inst✝¹⁹ : NormedAddCommGroup P✝ inst✝¹⁸ : NormedSpace 𝕜 P✝ μ✝ : Measure G✝ L✝¹ : E →L[𝕜] E'✝¹ →L[𝕜] F✝¹ G E'✝ F✝ P : Type uP inst✝¹⁷ : NormedAddCommGroup E'✝ inst✝¹⁶ : NormedAddCommGroup F✝ inst✝¹⁵ : NormedSpace 𝕜 E'✝ inst✝¹⁴ : NormedSpace ℝ F✝ inst✝¹³ : NormedSpace 𝕜 F✝ inst✝¹² : CompleteSpace F✝ inst✝¹¹ : MeasurableSpace G μ : Measure G inst✝¹⁰ : NormedAddCommGroup G inst✝⁹ : BorelSpace G inst✝⁸ : NormedSpace 𝕜 G inst✝⁷ : NormedAddCommGroup P inst✝⁶ : NormedSpace 𝕜 P f : G → E n✝ : ℕ∞ L✝ : E →L[𝕜] E'✝ →L[𝕜] F✝ g✝ : P → G → E'✝ s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs✝ : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g✝ p x = 0 hf : LocallyIntegrable f hg✝ : ContDiffOn 𝕜 n✝ (↿g✝) (s ×ˢ univ) n : ℕ ih : ∀ {E' F : Type uP} [inst : NormedAddCommGroup E'] [inst_1 : NormedAddCommGroup F] [inst_2 : NormedSpace 𝕜 E'] [inst_3 : NormedSpace ℝ F] [inst_4 : NormedSpace 𝕜 F] [inst_5 : CompleteSpace F] (L : E →L[𝕜] E' →L[𝕜] F) {g : P → G → E'}, (∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0) → ContDiffOn 𝕜 (↑n) (↿g) (s ×ˢ univ) → ContDiffOn 𝕜 (↑n) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) E' F : Type uP inst✝⁵ : NormedAddCommGroup E' inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace 𝕜 E' inst✝² : NormedSpace ℝ F inst✝¹ : NormedSpace 𝕜 F inst✝ : CompleteSpace F L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hg : DifferentiableOn 𝕜 (↿g) (s ×ˢ univ) ∧ ContDiffOn 𝕜 (↑n) (fun y => fderiv 𝕜 (↿g) y) (s ×ˢ univ) f' : P → G → P × G →L[𝕜] F := fun p a => f ⋆[precompR (P × G) L, a] fun x => fderiv 𝕜 (uncurry g) (p, x) A : ∀ (q₀ : P × G), q₀.fst ∈ s → HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f' q₀.fst q₀.snd) q₀ ⊢ DifferentiableOn 𝕜 (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] rintro ⟨p, x⟩ ⟨hp, -⟩ [GOAL] case hsuc.left.mk.intro 𝕜 : Type u𝕜 G✝ : Type uG E : Type uE E'✝¹ : Type uE' E'' : Type uE'' F✝¹ : Type uF F' : Type uF' F'' : Type uF'' P✝ : Type uP inst✝³⁴ : NormedAddCommGroup E inst✝³³ : NormedAddCommGroup E'✝¹ inst✝³² : NormedAddCommGroup E'' inst✝³¹ : NormedAddCommGroup F✝¹ f✝ f'✝ : G✝ → E g✝¹ g' : G✝ → E'✝¹ x✝ x' : G✝ y y' : E inst✝³⁰ : IsROrC 𝕜 inst✝²⁹ : NormedSpace 𝕜 E inst✝²⁸ : NormedSpace 𝕜 E'✝¹ inst✝²⁷ : NormedSpace 𝕜 E'' inst✝²⁶ : NormedSpace ℝ F✝¹ inst✝²⁵ : NormedSpace 𝕜 F✝¹ inst✝²⁴ : CompleteSpace F✝¹ inst✝²³ : MeasurableSpace G✝ inst✝²² : NormedAddCommGroup G✝ inst✝²¹ : BorelSpace G✝ inst✝²⁰ : NormedSpace 𝕜 G✝ inst✝¹⁹ : NormedAddCommGroup P✝ inst✝¹⁸ : NormedSpace 𝕜 P✝ μ✝ : Measure G✝ L✝¹ : E →L[𝕜] E'✝¹ →L[𝕜] F✝¹ G E'✝ F✝ P : Type uP inst✝¹⁷ : NormedAddCommGroup E'✝ inst✝¹⁶ : NormedAddCommGroup F✝ inst✝¹⁵ : NormedSpace 𝕜 E'✝ inst✝¹⁴ : NormedSpace ℝ F✝ inst✝¹³ : NormedSpace 𝕜 F✝ inst✝¹² : CompleteSpace F✝ inst✝¹¹ : MeasurableSpace G μ : Measure G inst✝¹⁰ : NormedAddCommGroup G inst✝⁹ : BorelSpace G inst✝⁸ : NormedSpace 𝕜 G inst✝⁷ : NormedAddCommGroup P inst✝⁶ : NormedSpace 𝕜 P f : G → E n✝ : ℕ∞ L✝ : E →L[𝕜] E'✝ →L[𝕜] F✝ g✝ : P → G → E'✝ s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs✝ : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g✝ p x = 0 hf : LocallyIntegrable f hg✝ : ContDiffOn 𝕜 n✝ (↿g✝) (s ×ˢ univ) n : ℕ ih : ∀ {E' F : Type uP} [inst : NormedAddCommGroup E'] [inst_1 : NormedAddCommGroup F] [inst_2 : NormedSpace 𝕜 E'] [inst_3 : NormedSpace ℝ F] [inst_4 : NormedSpace 𝕜 F] [inst_5 : CompleteSpace F] (L : E →L[𝕜] E' →L[𝕜] F) {g : P → G → E'}, (∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0) → ContDiffOn 𝕜 (↑n) (↿g) (s ×ˢ univ) → ContDiffOn 𝕜 (↑n) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) E' F : Type uP inst✝⁵ : NormedAddCommGroup E' inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace 𝕜 E' inst✝² : NormedSpace ℝ F inst✝¹ : NormedSpace 𝕜 F inst✝ : CompleteSpace F L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hg : DifferentiableOn 𝕜 (↿g) (s ×ˢ univ) ∧ ContDiffOn 𝕜 (↑n) (fun y => fderiv 𝕜 (↿g) y) (s ×ˢ univ) f' : P → G → P × G →L[𝕜] F := fun p a => f ⋆[precompR (P × G) L, a] fun x => fderiv 𝕜 (uncurry g) (p, x) A : ∀ (q₀ : P × G), q₀.fst ∈ s → HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f' q₀.fst q₀.snd) q₀ p : P x : G hp : (p, x).fst ∈ s ⊢ DifferentiableWithinAt 𝕜 (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) (p, x) [PROOFSTEP] exact (A (p, x) hp).differentiableAt.differentiableWithinAt [GOAL] case hsuc.right 𝕜 : Type u𝕜 G✝ : Type uG E : Type uE E'✝¹ : Type uE' E'' : Type uE'' F✝¹ : Type uF F' : Type uF' F'' : Type uF'' P✝ : Type uP inst✝³⁴ : NormedAddCommGroup E inst✝³³ : NormedAddCommGroup E'✝¹ inst✝³² : NormedAddCommGroup E'' inst✝³¹ : NormedAddCommGroup F✝¹ f✝ f'✝ : G✝ → E g✝¹ g' : G✝ → E'✝¹ x x' : G✝ y y' : E inst✝³⁰ : IsROrC 𝕜 inst✝²⁹ : NormedSpace 𝕜 E inst✝²⁸ : NormedSpace 𝕜 E'✝¹ inst✝²⁷ : NormedSpace 𝕜 E'' inst✝²⁶ : NormedSpace ℝ F✝¹ inst✝²⁵ : NormedSpace 𝕜 F✝¹ inst✝²⁴ : CompleteSpace F✝¹ inst✝²³ : MeasurableSpace G✝ inst✝²² : NormedAddCommGroup G✝ inst✝²¹ : BorelSpace G✝ inst✝²⁰ : NormedSpace 𝕜 G✝ inst✝¹⁹ : NormedAddCommGroup P✝ inst✝¹⁸ : NormedSpace 𝕜 P✝ μ✝ : Measure G✝ L✝¹ : E →L[𝕜] E'✝¹ →L[𝕜] F✝¹ G E'✝ F✝ P : Type uP inst✝¹⁷ : NormedAddCommGroup E'✝ inst✝¹⁶ : NormedAddCommGroup F✝ inst✝¹⁵ : NormedSpace 𝕜 E'✝ inst✝¹⁴ : NormedSpace ℝ F✝ inst✝¹³ : NormedSpace 𝕜 F✝ inst✝¹² : CompleteSpace F✝ inst✝¹¹ : MeasurableSpace G μ : Measure G inst✝¹⁰ : NormedAddCommGroup G inst✝⁹ : BorelSpace G inst✝⁸ : NormedSpace 𝕜 G inst✝⁷ : NormedAddCommGroup P inst✝⁶ : NormedSpace 𝕜 P f : G → E n✝ : ℕ∞ L✝ : E →L[𝕜] E'✝ →L[𝕜] F✝ g✝ : P → G → E'✝ s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs✝ : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g✝ p x = 0 hf : LocallyIntegrable f hg✝ : ContDiffOn 𝕜 n✝ (↿g✝) (s ×ˢ univ) n : ℕ ih : ∀ {E' F : Type uP} [inst : NormedAddCommGroup E'] [inst_1 : NormedAddCommGroup F] [inst_2 : NormedSpace 𝕜 E'] [inst_3 : NormedSpace ℝ F] [inst_4 : NormedSpace 𝕜 F] [inst_5 : CompleteSpace F] (L : E →L[𝕜] E' →L[𝕜] F) {g : P → G → E'}, (∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0) → ContDiffOn 𝕜 (↑n) (↿g) (s ×ˢ univ) → ContDiffOn 𝕜 (↑n) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) E' F : Type uP inst✝⁵ : NormedAddCommGroup E' inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace 𝕜 E' inst✝² : NormedSpace ℝ F inst✝¹ : NormedSpace 𝕜 F inst✝ : CompleteSpace F L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hg : DifferentiableOn 𝕜 (↿g) (s ×ˢ univ) ∧ ContDiffOn 𝕜 (↑n) (fun y => fderiv 𝕜 (↿g) y) (s ×ˢ univ) f' : P → G → P × G →L[𝕜] F := fun p a => f ⋆[precompR (P × G) L, a] fun x => fderiv 𝕜 (uncurry g) (p, x) A : ∀ (q₀ : P × G), q₀.fst ∈ s → HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f' q₀.fst q₀.snd) q₀ ⊢ ContDiffOn 𝕜 (↑n) (fun y => fderiv 𝕜 (fun q => f ⋆[L, q.snd] g q.fst) y) (s ×ˢ univ) [PROOFSTEP] suffices H : ContDiffOn 𝕜 n (↿f') (s ×ˢ univ) [GOAL] case hsuc.right 𝕜 : Type u𝕜 G✝ : Type uG E : Type uE E'✝¹ : Type uE' E'' : Type uE'' F✝¹ : Type uF F' : Type uF' F'' : Type uF'' P✝ : Type uP inst✝³⁴ : NormedAddCommGroup E inst✝³³ : NormedAddCommGroup E'✝¹ inst✝³² : NormedAddCommGroup E'' inst✝³¹ : NormedAddCommGroup F✝¹ f✝ f'✝ : G✝ → E g✝¹ g' : G✝ → E'✝¹ x x' : G✝ y y' : E inst✝³⁰ : IsROrC 𝕜 inst✝²⁹ : NormedSpace 𝕜 E inst✝²⁸ : NormedSpace 𝕜 E'✝¹ inst✝²⁷ : NormedSpace 𝕜 E'' inst✝²⁶ : NormedSpace ℝ F✝¹ inst✝²⁵ : NormedSpace 𝕜 F✝¹ inst✝²⁴ : CompleteSpace F✝¹ inst✝²³ : MeasurableSpace G✝ inst✝²² : NormedAddCommGroup G✝ inst✝²¹ : BorelSpace G✝ inst✝²⁰ : NormedSpace 𝕜 G✝ inst✝¹⁹ : NormedAddCommGroup P✝ inst✝¹⁸ : NormedSpace 𝕜 P✝ μ✝ : Measure G✝ L✝¹ : E →L[𝕜] E'✝¹ →L[𝕜] F✝¹ G E'✝ F✝ P : Type uP inst✝¹⁷ : NormedAddCommGroup E'✝ inst✝¹⁶ : NormedAddCommGroup F✝ inst✝¹⁵ : NormedSpace 𝕜 E'✝ inst✝¹⁴ : NormedSpace ℝ F✝ inst✝¹³ : NormedSpace 𝕜 F✝ inst✝¹² : CompleteSpace F✝ inst✝¹¹ : MeasurableSpace G μ : Measure G inst✝¹⁰ : NormedAddCommGroup G inst✝⁹ : BorelSpace G inst✝⁸ : NormedSpace 𝕜 G inst✝⁷ : NormedAddCommGroup P inst✝⁶ : NormedSpace 𝕜 P f : G → E n✝ : ℕ∞ L✝ : E →L[𝕜] E'✝ →L[𝕜] F✝ g✝ : P → G → E'✝ s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs✝ : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g✝ p x = 0 hf : LocallyIntegrable f hg✝ : ContDiffOn 𝕜 n✝ (↿g✝) (s ×ˢ univ) n : ℕ ih : ∀ {E' F : Type uP} [inst : NormedAddCommGroup E'] [inst_1 : NormedAddCommGroup F] [inst_2 : NormedSpace 𝕜 E'] [inst_3 : NormedSpace ℝ F] [inst_4 : NormedSpace 𝕜 F] [inst_5 : CompleteSpace F] (L : E →L[𝕜] E' →L[𝕜] F) {g : P → G → E'}, (∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0) → ContDiffOn 𝕜 (↑n) (↿g) (s ×ˢ univ) → ContDiffOn 𝕜 (↑n) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) E' F : Type uP inst✝⁵ : NormedAddCommGroup E' inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace 𝕜 E' inst✝² : NormedSpace ℝ F inst✝¹ : NormedSpace 𝕜 F inst✝ : CompleteSpace F L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hg : DifferentiableOn 𝕜 (↿g) (s ×ˢ univ) ∧ ContDiffOn 𝕜 (↑n) (fun y => fderiv 𝕜 (↿g) y) (s ×ˢ univ) f' : P → G → P × G →L[𝕜] F := fun p a => f ⋆[precompR (P × G) L, a] fun x => fderiv 𝕜 (uncurry g) (p, x) A : ∀ (q₀ : P × G), q₀.fst ∈ s → HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f' q₀.fst q₀.snd) q₀ H : ContDiffOn 𝕜 (↑n) (↿f') (s ×ˢ univ) ⊢ ContDiffOn 𝕜 (↑n) (fun y => fderiv 𝕜 (fun q => f ⋆[L, q.snd] g q.fst) y) (s ×ˢ univ) [PROOFSTEP] apply H.congr [GOAL] case hsuc.right 𝕜 : Type u𝕜 G✝ : Type uG E : Type uE E'✝¹ : Type uE' E'' : Type uE'' F✝¹ : Type uF F' : Type uF' F'' : Type uF'' P✝ : Type uP inst✝³⁴ : NormedAddCommGroup E inst✝³³ : NormedAddCommGroup E'✝¹ inst✝³² : NormedAddCommGroup E'' inst✝³¹ : NormedAddCommGroup F✝¹ f✝ f'✝ : G✝ → E g✝¹ g' : G✝ → E'✝¹ x x' : G✝ y y' : E inst✝³⁰ : IsROrC 𝕜 inst✝²⁹ : NormedSpace 𝕜 E inst✝²⁸ : NormedSpace 𝕜 E'✝¹ inst✝²⁷ : NormedSpace 𝕜 E'' inst✝²⁶ : NormedSpace ℝ F✝¹ inst✝²⁵ : NormedSpace 𝕜 F✝¹ inst✝²⁴ : CompleteSpace F✝¹ inst✝²³ : MeasurableSpace G✝ inst✝²² : NormedAddCommGroup G✝ inst✝²¹ : BorelSpace G✝ inst✝²⁰ : NormedSpace 𝕜 G✝ inst✝¹⁹ : NormedAddCommGroup P✝ inst✝¹⁸ : NormedSpace 𝕜 P✝ μ✝ : Measure G✝ L✝¹ : E →L[𝕜] E'✝¹ →L[𝕜] F✝¹ G E'✝ F✝ P : Type uP inst✝¹⁷ : NormedAddCommGroup E'✝ inst✝¹⁶ : NormedAddCommGroup F✝ inst✝¹⁵ : NormedSpace 𝕜 E'✝ inst✝¹⁴ : NormedSpace ℝ F✝ inst✝¹³ : NormedSpace 𝕜 F✝ inst✝¹² : CompleteSpace F✝ inst✝¹¹ : MeasurableSpace G μ : Measure G inst✝¹⁰ : NormedAddCommGroup G inst✝⁹ : BorelSpace G inst✝⁸ : NormedSpace 𝕜 G inst✝⁷ : NormedAddCommGroup P inst✝⁶ : NormedSpace 𝕜 P f : G → E n✝ : ℕ∞ L✝ : E →L[𝕜] E'✝ →L[𝕜] F✝ g✝ : P → G → E'✝ s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs✝ : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g✝ p x = 0 hf : LocallyIntegrable f hg✝ : ContDiffOn 𝕜 n✝ (↿g✝) (s ×ˢ univ) n : ℕ ih : ∀ {E' F : Type uP} [inst : NormedAddCommGroup E'] [inst_1 : NormedAddCommGroup F] [inst_2 : NormedSpace 𝕜 E'] [inst_3 : NormedSpace ℝ F] [inst_4 : NormedSpace 𝕜 F] [inst_5 : CompleteSpace F] (L : E →L[𝕜] E' →L[𝕜] F) {g : P → G → E'}, (∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0) → ContDiffOn 𝕜 (↑n) (↿g) (s ×ˢ univ) → ContDiffOn 𝕜 (↑n) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) E' F : Type uP inst✝⁵ : NormedAddCommGroup E' inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace 𝕜 E' inst✝² : NormedSpace ℝ F inst✝¹ : NormedSpace 𝕜 F inst✝ : CompleteSpace F L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hg : DifferentiableOn 𝕜 (↿g) (s ×ˢ univ) ∧ ContDiffOn 𝕜 (↑n) (fun y => fderiv 𝕜 (↿g) y) (s ×ˢ univ) f' : P → G → P × G →L[𝕜] F := fun p a => f ⋆[precompR (P × G) L, a] fun x => fderiv 𝕜 (uncurry g) (p, x) A : ∀ (q₀ : P × G), q₀.fst ∈ s → HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f' q₀.fst q₀.snd) q₀ H : ContDiffOn 𝕜 (↑n) (↿f') (s ×ˢ univ) ⊢ ∀ (x : P × G), x ∈ s ×ˢ univ → fderiv 𝕜 (fun q => f ⋆[L, q.snd] g q.fst) x = (↿f') x [PROOFSTEP] rintro ⟨p, x⟩ ⟨hp, -⟩ [GOAL] case hsuc.right.mk.intro 𝕜 : Type u𝕜 G✝ : Type uG E : Type uE E'✝¹ : Type uE' E'' : Type uE'' F✝¹ : Type uF F' : Type uF' F'' : Type uF'' P✝ : Type uP inst✝³⁴ : NormedAddCommGroup E inst✝³³ : NormedAddCommGroup E'✝¹ inst✝³² : NormedAddCommGroup E'' inst✝³¹ : NormedAddCommGroup F✝¹ f✝ f'✝ : G✝ → E g✝¹ g' : G✝ → E'✝¹ x✝ x' : G✝ y y' : E inst✝³⁰ : IsROrC 𝕜 inst✝²⁹ : NormedSpace 𝕜 E inst✝²⁸ : NormedSpace 𝕜 E'✝¹ inst✝²⁷ : NormedSpace 𝕜 E'' inst✝²⁶ : NormedSpace ℝ F✝¹ inst✝²⁵ : NormedSpace 𝕜 F✝¹ inst✝²⁴ : CompleteSpace F✝¹ inst✝²³ : MeasurableSpace G✝ inst✝²² : NormedAddCommGroup G✝ inst✝²¹ : BorelSpace G✝ inst✝²⁰ : NormedSpace 𝕜 G✝ inst✝¹⁹ : NormedAddCommGroup P✝ inst✝¹⁸ : NormedSpace 𝕜 P✝ μ✝ : Measure G✝ L✝¹ : E →L[𝕜] E'✝¹ →L[𝕜] F✝¹ G E'✝ F✝ P : Type uP inst✝¹⁷ : NormedAddCommGroup E'✝ inst✝¹⁶ : NormedAddCommGroup F✝ inst✝¹⁵ : NormedSpace 𝕜 E'✝ inst✝¹⁴ : NormedSpace ℝ F✝ inst✝¹³ : NormedSpace 𝕜 F✝ inst✝¹² : CompleteSpace F✝ inst✝¹¹ : MeasurableSpace G μ : Measure G inst✝¹⁰ : NormedAddCommGroup G inst✝⁹ : BorelSpace G inst✝⁸ : NormedSpace 𝕜 G inst✝⁷ : NormedAddCommGroup P inst✝⁶ : NormedSpace 𝕜 P f : G → E n✝ : ℕ∞ L✝ : E →L[𝕜] E'✝ →L[𝕜] F✝ g✝ : P → G → E'✝ s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs✝ : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g✝ p x = 0 hf : LocallyIntegrable f hg✝ : ContDiffOn 𝕜 n✝ (↿g✝) (s ×ˢ univ) n : ℕ ih : ∀ {E' F : Type uP} [inst : NormedAddCommGroup E'] [inst_1 : NormedAddCommGroup F] [inst_2 : NormedSpace 𝕜 E'] [inst_3 : NormedSpace ℝ F] [inst_4 : NormedSpace 𝕜 F] [inst_5 : CompleteSpace F] (L : E →L[𝕜] E' →L[𝕜] F) {g : P → G → E'}, (∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0) → ContDiffOn 𝕜 (↑n) (↿g) (s ×ˢ univ) → ContDiffOn 𝕜 (↑n) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) E' F : Type uP inst✝⁵ : NormedAddCommGroup E' inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace 𝕜 E' inst✝² : NormedSpace ℝ F inst✝¹ : NormedSpace 𝕜 F inst✝ : CompleteSpace F L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hg : DifferentiableOn 𝕜 (↿g) (s ×ˢ univ) ∧ ContDiffOn 𝕜 (↑n) (fun y => fderiv 𝕜 (↿g) y) (s ×ˢ univ) f' : P → G → P × G →L[𝕜] F := fun p a => f ⋆[precompR (P × G) L, a] fun x => fderiv 𝕜 (uncurry g) (p, x) A : ∀ (q₀ : P × G), q₀.fst ∈ s → HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f' q₀.fst q₀.snd) q₀ H : ContDiffOn 𝕜 (↑n) (↿f') (s ×ˢ univ) p : P x : G hp : (p, x).fst ∈ s ⊢ fderiv 𝕜 (fun q => f ⋆[L, q.snd] g q.fst) (p, x) = (↿f') (p, x) [PROOFSTEP] exact (A (p, x) hp).fderiv [GOAL] case H 𝕜 : Type u𝕜 G✝ : Type uG E : Type uE E'✝¹ : Type uE' E'' : Type uE'' F✝¹ : Type uF F' : Type uF' F'' : Type uF'' P✝ : Type uP inst✝³⁴ : NormedAddCommGroup E inst✝³³ : NormedAddCommGroup E'✝¹ inst✝³² : NormedAddCommGroup E'' inst✝³¹ : NormedAddCommGroup F✝¹ f✝ f'✝ : G✝ → E g✝¹ g' : G✝ → E'✝¹ x x' : G✝ y y' : E inst✝³⁰ : IsROrC 𝕜 inst✝²⁹ : NormedSpace 𝕜 E inst✝²⁸ : NormedSpace 𝕜 E'✝¹ inst✝²⁷ : NormedSpace 𝕜 E'' inst✝²⁶ : NormedSpace ℝ F✝¹ inst✝²⁵ : NormedSpace 𝕜 F✝¹ inst✝²⁴ : CompleteSpace F✝¹ inst✝²³ : MeasurableSpace G✝ inst✝²² : NormedAddCommGroup G✝ inst✝²¹ : BorelSpace G✝ inst✝²⁰ : NormedSpace 𝕜 G✝ inst✝¹⁹ : NormedAddCommGroup P✝ inst✝¹⁸ : NormedSpace 𝕜 P✝ μ✝ : Measure G✝ L✝¹ : E →L[𝕜] E'✝¹ →L[𝕜] F✝¹ G E'✝ F✝ P : Type uP inst✝¹⁷ : NormedAddCommGroup E'✝ inst✝¹⁶ : NormedAddCommGroup F✝ inst✝¹⁵ : NormedSpace 𝕜 E'✝ inst✝¹⁴ : NormedSpace ℝ F✝ inst✝¹³ : NormedSpace 𝕜 F✝ inst✝¹² : CompleteSpace F✝ inst✝¹¹ : MeasurableSpace G μ : Measure G inst✝¹⁰ : NormedAddCommGroup G inst✝⁹ : BorelSpace G inst✝⁸ : NormedSpace 𝕜 G inst✝⁷ : NormedAddCommGroup P inst✝⁶ : NormedSpace 𝕜 P f : G → E n✝ : ℕ∞ L✝ : E →L[𝕜] E'✝ →L[𝕜] F✝ g✝ : P → G → E'✝ s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs✝ : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g✝ p x = 0 hf : LocallyIntegrable f hg✝ : ContDiffOn 𝕜 n✝ (↿g✝) (s ×ˢ univ) n : ℕ ih : ∀ {E' F : Type uP} [inst : NormedAddCommGroup E'] [inst_1 : NormedAddCommGroup F] [inst_2 : NormedSpace 𝕜 E'] [inst_3 : NormedSpace ℝ F] [inst_4 : NormedSpace 𝕜 F] [inst_5 : CompleteSpace F] (L : E →L[𝕜] E' →L[𝕜] F) {g : P → G → E'}, (∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0) → ContDiffOn 𝕜 (↑n) (↿g) (s ×ˢ univ) → ContDiffOn 𝕜 (↑n) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) E' F : Type uP inst✝⁵ : NormedAddCommGroup E' inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace 𝕜 E' inst✝² : NormedSpace ℝ F inst✝¹ : NormedSpace 𝕜 F inst✝ : CompleteSpace F L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hg : DifferentiableOn 𝕜 (↿g) (s ×ˢ univ) ∧ ContDiffOn 𝕜 (↑n) (fun y => fderiv 𝕜 (↿g) y) (s ×ˢ univ) f' : P → G → P × G →L[𝕜] F := fun p a => f ⋆[precompR (P × G) L, a] fun x => fderiv 𝕜 (uncurry g) (p, x) A : ∀ (q₀ : P × G), q₀.fst ∈ s → HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f' q₀.fst q₀.snd) q₀ ⊢ ContDiffOn 𝕜 (↑n) (↿f') (s ×ˢ univ) [PROOFSTEP] have B : ∀ (p : P) (x : G), p ∈ s → x ∉ k → fderiv 𝕜 (uncurry g) (p, x) = 0 := by intro p x hp hx apply (hasFDerivAt_zero_of_eventually_const (0 : E') _).fderiv have M2 : kᶜ ∈ 𝓝 x := IsOpen.mem_nhds hk.isClosed.isOpen_compl hx have M1 : s ∈ 𝓝 p := hs.mem_nhds hp rw [nhds_prod_eq] filter_upwards [prod_mem_prod M1 M2] rintro ⟨p, y⟩ ⟨hp, hy⟩ exact hgs p y hp hy [GOAL] 𝕜 : Type u𝕜 G✝ : Type uG E : Type uE E'✝¹ : Type uE' E'' : Type uE'' F✝¹ : Type uF F' : Type uF' F'' : Type uF'' P✝ : Type uP inst✝³⁴ : NormedAddCommGroup E inst✝³³ : NormedAddCommGroup E'✝¹ inst✝³² : NormedAddCommGroup E'' inst✝³¹ : NormedAddCommGroup F✝¹ f✝ f'✝ : G✝ → E g✝¹ g' : G✝ → E'✝¹ x x' : G✝ y y' : E inst✝³⁰ : IsROrC 𝕜 inst✝²⁹ : NormedSpace 𝕜 E inst✝²⁸ : NormedSpace 𝕜 E'✝¹ inst✝²⁷ : NormedSpace 𝕜 E'' inst✝²⁶ : NormedSpace ℝ F✝¹ inst✝²⁵ : NormedSpace 𝕜 F✝¹ inst✝²⁴ : CompleteSpace F✝¹ inst✝²³ : MeasurableSpace G✝ inst✝²² : NormedAddCommGroup G✝ inst✝²¹ : BorelSpace G✝ inst✝²⁰ : NormedSpace 𝕜 G✝ inst✝¹⁹ : NormedAddCommGroup P✝ inst✝¹⁸ : NormedSpace 𝕜 P✝ μ✝ : Measure G✝ L✝¹ : E →L[𝕜] E'✝¹ →L[𝕜] F✝¹ G E'✝ F✝ P : Type uP inst✝¹⁷ : NormedAddCommGroup E'✝ inst✝¹⁶ : NormedAddCommGroup F✝ inst✝¹⁵ : NormedSpace 𝕜 E'✝ inst✝¹⁴ : NormedSpace ℝ F✝ inst✝¹³ : NormedSpace 𝕜 F✝ inst✝¹² : CompleteSpace F✝ inst✝¹¹ : MeasurableSpace G μ : Measure G inst✝¹⁰ : NormedAddCommGroup G inst✝⁹ : BorelSpace G inst✝⁸ : NormedSpace 𝕜 G inst✝⁷ : NormedAddCommGroup P inst✝⁶ : NormedSpace 𝕜 P f : G → E n✝ : ℕ∞ L✝ : E →L[𝕜] E'✝ →L[𝕜] F✝ g✝ : P → G → E'✝ s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs✝ : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g✝ p x = 0 hf : LocallyIntegrable f hg✝ : ContDiffOn 𝕜 n✝ (↿g✝) (s ×ˢ univ) n : ℕ ih : ∀ {E' F : Type uP} [inst : NormedAddCommGroup E'] [inst_1 : NormedAddCommGroup F] [inst_2 : NormedSpace 𝕜 E'] [inst_3 : NormedSpace ℝ F] [inst_4 : NormedSpace 𝕜 F] [inst_5 : CompleteSpace F] (L : E →L[𝕜] E' →L[𝕜] F) {g : P → G → E'}, (∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0) → ContDiffOn 𝕜 (↑n) (↿g) (s ×ˢ univ) → ContDiffOn 𝕜 (↑n) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) E' F : Type uP inst✝⁵ : NormedAddCommGroup E' inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace 𝕜 E' inst✝² : NormedSpace ℝ F inst✝¹ : NormedSpace 𝕜 F inst✝ : CompleteSpace F L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hg : DifferentiableOn 𝕜 (↿g) (s ×ˢ univ) ∧ ContDiffOn 𝕜 (↑n) (fun y => fderiv 𝕜 (↿g) y) (s ×ˢ univ) f' : P → G → P × G →L[𝕜] F := fun p a => f ⋆[precompR (P × G) L, a] fun x => fderiv 𝕜 (uncurry g) (p, x) A : ∀ (q₀ : P × G), q₀.fst ∈ s → HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f' q₀.fst q₀.snd) q₀ ⊢ ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → fderiv 𝕜 (uncurry g) (p, x) = 0 [PROOFSTEP] intro p x hp hx [GOAL] 𝕜 : Type u𝕜 G✝ : Type uG E : Type uE E'✝¹ : Type uE' E'' : Type uE'' F✝¹ : Type uF F' : Type uF' F'' : Type uF'' P✝ : Type uP inst✝³⁴ : NormedAddCommGroup E inst✝³³ : NormedAddCommGroup E'✝¹ inst✝³² : NormedAddCommGroup E'' inst✝³¹ : NormedAddCommGroup F✝¹ f✝ f'✝ : G✝ → E g✝¹ g' : G✝ → E'✝¹ x✝ x' : G✝ y y' : E inst✝³⁰ : IsROrC 𝕜 inst✝²⁹ : NormedSpace 𝕜 E inst✝²⁸ : NormedSpace 𝕜 E'✝¹ inst✝²⁷ : NormedSpace 𝕜 E'' inst✝²⁶ : NormedSpace ℝ F✝¹ inst✝²⁵ : NormedSpace 𝕜 F✝¹ inst✝²⁴ : CompleteSpace F✝¹ inst✝²³ : MeasurableSpace G✝ inst✝²² : NormedAddCommGroup G✝ inst✝²¹ : BorelSpace G✝ inst✝²⁰ : NormedSpace 𝕜 G✝ inst✝¹⁹ : NormedAddCommGroup P✝ inst✝¹⁸ : NormedSpace 𝕜 P✝ μ✝ : Measure G✝ L✝¹ : E →L[𝕜] E'✝¹ →L[𝕜] F✝¹ G E'✝ F✝ P : Type uP inst✝¹⁷ : NormedAddCommGroup E'✝ inst✝¹⁶ : NormedAddCommGroup F✝ inst✝¹⁵ : NormedSpace 𝕜 E'✝ inst✝¹⁴ : NormedSpace ℝ F✝ inst✝¹³ : NormedSpace 𝕜 F✝ inst✝¹² : CompleteSpace F✝ inst✝¹¹ : MeasurableSpace G μ : Measure G inst✝¹⁰ : NormedAddCommGroup G inst✝⁹ : BorelSpace G inst✝⁸ : NormedSpace 𝕜 G inst✝⁷ : NormedAddCommGroup P inst✝⁶ : NormedSpace 𝕜 P f : G → E n✝ : ℕ∞ L✝ : E →L[𝕜] E'✝ →L[𝕜] F✝ g✝ : P → G → E'✝ s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs✝ : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g✝ p x = 0 hf : LocallyIntegrable f hg✝ : ContDiffOn 𝕜 n✝ (↿g✝) (s ×ˢ univ) n : ℕ ih : ∀ {E' F : Type uP} [inst : NormedAddCommGroup E'] [inst_1 : NormedAddCommGroup F] [inst_2 : NormedSpace 𝕜 E'] [inst_3 : NormedSpace ℝ F] [inst_4 : NormedSpace 𝕜 F] [inst_5 : CompleteSpace F] (L : E →L[𝕜] E' →L[𝕜] F) {g : P → G → E'}, (∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0) → ContDiffOn 𝕜 (↑n) (↿g) (s ×ˢ univ) → ContDiffOn 𝕜 (↑n) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) E' F : Type uP inst✝⁵ : NormedAddCommGroup E' inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace 𝕜 E' inst✝² : NormedSpace ℝ F inst✝¹ : NormedSpace 𝕜 F inst✝ : CompleteSpace F L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hg : DifferentiableOn 𝕜 (↿g) (s ×ˢ univ) ∧ ContDiffOn 𝕜 (↑n) (fun y => fderiv 𝕜 (↿g) y) (s ×ˢ univ) f' : P → G → P × G →L[𝕜] F := fun p a => f ⋆[precompR (P × G) L, a] fun x => fderiv 𝕜 (uncurry g) (p, x) A : ∀ (q₀ : P × G), q₀.fst ∈ s → HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f' q₀.fst q₀.snd) q₀ p : P x : G hp : p ∈ s hx : ¬x ∈ k ⊢ fderiv 𝕜 (uncurry g) (p, x) = 0 [PROOFSTEP] apply (hasFDerivAt_zero_of_eventually_const (0 : E') _).fderiv [GOAL] 𝕜 : Type u𝕜 G✝ : Type uG E : Type uE E'✝¹ : Type uE' E'' : Type uE'' F✝¹ : Type uF F' : Type uF' F'' : Type uF'' P✝ : Type uP inst✝³⁴ : NormedAddCommGroup E inst✝³³ : NormedAddCommGroup E'✝¹ inst✝³² : NormedAddCommGroup E'' inst✝³¹ : NormedAddCommGroup F✝¹ f✝ f'✝ : G✝ → E g✝¹ g' : G✝ → E'✝¹ x✝ x' : G✝ y y' : E inst✝³⁰ : IsROrC 𝕜 inst✝²⁹ : NormedSpace 𝕜 E inst✝²⁸ : NormedSpace 𝕜 E'✝¹ inst✝²⁷ : NormedSpace 𝕜 E'' inst✝²⁶ : NormedSpace ℝ F✝¹ inst✝²⁵ : NormedSpace 𝕜 F✝¹ inst✝²⁴ : CompleteSpace F✝¹ inst✝²³ : MeasurableSpace G✝ inst✝²² : NormedAddCommGroup G✝ inst✝²¹ : BorelSpace G✝ inst✝²⁰ : NormedSpace 𝕜 G✝ inst✝¹⁹ : NormedAddCommGroup P✝ inst✝¹⁸ : NormedSpace 𝕜 P✝ μ✝ : Measure G✝ L✝¹ : E →L[𝕜] E'✝¹ →L[𝕜] F✝¹ G E'✝ F✝ P : Type uP inst✝¹⁷ : NormedAddCommGroup E'✝ inst✝¹⁶ : NormedAddCommGroup F✝ inst✝¹⁵ : NormedSpace 𝕜 E'✝ inst✝¹⁴ : NormedSpace ℝ F✝ inst✝¹³ : NormedSpace 𝕜 F✝ inst✝¹² : CompleteSpace F✝ inst✝¹¹ : MeasurableSpace G μ : Measure G inst✝¹⁰ : NormedAddCommGroup G inst✝⁹ : BorelSpace G inst✝⁸ : NormedSpace 𝕜 G inst✝⁷ : NormedAddCommGroup P inst✝⁶ : NormedSpace 𝕜 P f : G → E n✝ : ℕ∞ L✝ : E →L[𝕜] E'✝ →L[𝕜] F✝ g✝ : P → G → E'✝ s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs✝ : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g✝ p x = 0 hf : LocallyIntegrable f hg✝ : ContDiffOn 𝕜 n✝ (↿g✝) (s ×ˢ univ) n : ℕ ih : ∀ {E' F : Type uP} [inst : NormedAddCommGroup E'] [inst_1 : NormedAddCommGroup F] [inst_2 : NormedSpace 𝕜 E'] [inst_3 : NormedSpace ℝ F] [inst_4 : NormedSpace 𝕜 F] [inst_5 : CompleteSpace F] (L : E →L[𝕜] E' →L[𝕜] F) {g : P → G → E'}, (∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0) → ContDiffOn 𝕜 (↑n) (↿g) (s ×ˢ univ) → ContDiffOn 𝕜 (↑n) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) E' F : Type uP inst✝⁵ : NormedAddCommGroup E' inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace 𝕜 E' inst✝² : NormedSpace ℝ F inst✝¹ : NormedSpace 𝕜 F inst✝ : CompleteSpace F L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hg : DifferentiableOn 𝕜 (↿g) (s ×ˢ univ) ∧ ContDiffOn 𝕜 (↑n) (fun y => fderiv 𝕜 (↿g) y) (s ×ˢ univ) f' : P → G → P × G →L[𝕜] F := fun p a => f ⋆[precompR (P × G) L, a] fun x => fderiv 𝕜 (uncurry g) (p, x) A : ∀ (q₀ : P × G), q₀.fst ∈ s → HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f' q₀.fst q₀.snd) q₀ p : P x : G hp : p ∈ s hx : ¬x ∈ k ⊢ uncurry g =ᶠ[𝓝 (p, x)] fun x => 0 [PROOFSTEP] have M2 : kᶜ ∈ 𝓝 x := IsOpen.mem_nhds hk.isClosed.isOpen_compl hx [GOAL] 𝕜 : Type u𝕜 G✝ : Type uG E : Type uE E'✝¹ : Type uE' E'' : Type uE'' F✝¹ : Type uF F' : Type uF' F'' : Type uF'' P✝ : Type uP inst✝³⁴ : NormedAddCommGroup E inst✝³³ : NormedAddCommGroup E'✝¹ inst✝³² : NormedAddCommGroup E'' inst✝³¹ : NormedAddCommGroup F✝¹ f✝ f'✝ : G✝ → E g✝¹ g' : G✝ → E'✝¹ x✝ x' : G✝ y y' : E inst✝³⁰ : IsROrC 𝕜 inst✝²⁹ : NormedSpace 𝕜 E inst✝²⁸ : NormedSpace 𝕜 E'✝¹ inst✝²⁷ : NormedSpace 𝕜 E'' inst✝²⁶ : NormedSpace ℝ F✝¹ inst✝²⁵ : NormedSpace 𝕜 F✝¹ inst✝²⁴ : CompleteSpace F✝¹ inst✝²³ : MeasurableSpace G✝ inst✝²² : NormedAddCommGroup G✝ inst✝²¹ : BorelSpace G✝ inst✝²⁰ : NormedSpace 𝕜 G✝ inst✝¹⁹ : NormedAddCommGroup P✝ inst✝¹⁸ : NormedSpace 𝕜 P✝ μ✝ : Measure G✝ L✝¹ : E →L[𝕜] E'✝¹ →L[𝕜] F✝¹ G E'✝ F✝ P : Type uP inst✝¹⁷ : NormedAddCommGroup E'✝ inst✝¹⁶ : NormedAddCommGroup F✝ inst✝¹⁵ : NormedSpace 𝕜 E'✝ inst✝¹⁴ : NormedSpace ℝ F✝ inst✝¹³ : NormedSpace 𝕜 F✝ inst✝¹² : CompleteSpace F✝ inst✝¹¹ : MeasurableSpace G μ : Measure G inst✝¹⁰ : NormedAddCommGroup G inst✝⁹ : BorelSpace G inst✝⁸ : NormedSpace 𝕜 G inst✝⁷ : NormedAddCommGroup P inst✝⁶ : NormedSpace 𝕜 P f : G → E n✝ : ℕ∞ L✝ : E →L[𝕜] E'✝ →L[𝕜] F✝ g✝ : P → G → E'✝ s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs✝ : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g✝ p x = 0 hf : LocallyIntegrable f hg✝ : ContDiffOn 𝕜 n✝ (↿g✝) (s ×ˢ univ) n : ℕ ih : ∀ {E' F : Type uP} [inst : NormedAddCommGroup E'] [inst_1 : NormedAddCommGroup F] [inst_2 : NormedSpace 𝕜 E'] [inst_3 : NormedSpace ℝ F] [inst_4 : NormedSpace 𝕜 F] [inst_5 : CompleteSpace F] (L : E →L[𝕜] E' →L[𝕜] F) {g : P → G → E'}, (∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0) → ContDiffOn 𝕜 (↑n) (↿g) (s ×ˢ univ) → ContDiffOn 𝕜 (↑n) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) E' F : Type uP inst✝⁵ : NormedAddCommGroup E' inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace 𝕜 E' inst✝² : NormedSpace ℝ F inst✝¹ : NormedSpace 𝕜 F inst✝ : CompleteSpace F L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hg : DifferentiableOn 𝕜 (↿g) (s ×ˢ univ) ∧ ContDiffOn 𝕜 (↑n) (fun y => fderiv 𝕜 (↿g) y) (s ×ˢ univ) f' : P → G → P × G →L[𝕜] F := fun p a => f ⋆[precompR (P × G) L, a] fun x => fderiv 𝕜 (uncurry g) (p, x) A : ∀ (q₀ : P × G), q₀.fst ∈ s → HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f' q₀.fst q₀.snd) q₀ p : P x : G hp : p ∈ s hx : ¬x ∈ k M2 : kᶜ ∈ 𝓝 x ⊢ uncurry g =ᶠ[𝓝 (p, x)] fun x => 0 [PROOFSTEP] have M1 : s ∈ 𝓝 p := hs.mem_nhds hp [GOAL] 𝕜 : Type u𝕜 G✝ : Type uG E : Type uE E'✝¹ : Type uE' E'' : Type uE'' F✝¹ : Type uF F' : Type uF' F'' : Type uF'' P✝ : Type uP inst✝³⁴ : NormedAddCommGroup E inst✝³³ : NormedAddCommGroup E'✝¹ inst✝³² : NormedAddCommGroup E'' inst✝³¹ : NormedAddCommGroup F✝¹ f✝ f'✝ : G✝ → E g✝¹ g' : G✝ → E'✝¹ x✝ x' : G✝ y y' : E inst✝³⁰ : IsROrC 𝕜 inst✝²⁹ : NormedSpace 𝕜 E inst✝²⁸ : NormedSpace 𝕜 E'✝¹ inst✝²⁷ : NormedSpace 𝕜 E'' inst✝²⁶ : NormedSpace ℝ F✝¹ inst✝²⁵ : NormedSpace 𝕜 F✝¹ inst✝²⁴ : CompleteSpace F✝¹ inst✝²³ : MeasurableSpace G✝ inst✝²² : NormedAddCommGroup G✝ inst✝²¹ : BorelSpace G✝ inst✝²⁰ : NormedSpace 𝕜 G✝ inst✝¹⁹ : NormedAddCommGroup P✝ inst✝¹⁸ : NormedSpace 𝕜 P✝ μ✝ : Measure G✝ L✝¹ : E →L[𝕜] E'✝¹ →L[𝕜] F✝¹ G E'✝ F✝ P : Type uP inst✝¹⁷ : NormedAddCommGroup E'✝ inst✝¹⁶ : NormedAddCommGroup F✝ inst✝¹⁵ : NormedSpace 𝕜 E'✝ inst✝¹⁴ : NormedSpace ℝ F✝ inst✝¹³ : NormedSpace 𝕜 F✝ inst✝¹² : CompleteSpace F✝ inst✝¹¹ : MeasurableSpace G μ : Measure G inst✝¹⁰ : NormedAddCommGroup G inst✝⁹ : BorelSpace G inst✝⁸ : NormedSpace 𝕜 G inst✝⁷ : NormedAddCommGroup P inst✝⁶ : NormedSpace 𝕜 P f : G → E n✝ : ℕ∞ L✝ : E →L[𝕜] E'✝ →L[𝕜] F✝ g✝ : P → G → E'✝ s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs✝ : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g✝ p x = 0 hf : LocallyIntegrable f hg✝ : ContDiffOn 𝕜 n✝ (↿g✝) (s ×ˢ univ) n : ℕ ih : ∀ {E' F : Type uP} [inst : NormedAddCommGroup E'] [inst_1 : NormedAddCommGroup F] [inst_2 : NormedSpace 𝕜 E'] [inst_3 : NormedSpace ℝ F] [inst_4 : NormedSpace 𝕜 F] [inst_5 : CompleteSpace F] (L : E →L[𝕜] E' →L[𝕜] F) {g : P → G → E'}, (∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0) → ContDiffOn 𝕜 (↑n) (↿g) (s ×ˢ univ) → ContDiffOn 𝕜 (↑n) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) E' F : Type uP inst✝⁵ : NormedAddCommGroup E' inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace 𝕜 E' inst✝² : NormedSpace ℝ F inst✝¹ : NormedSpace 𝕜 F inst✝ : CompleteSpace F L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hg : DifferentiableOn 𝕜 (↿g) (s ×ˢ univ) ∧ ContDiffOn 𝕜 (↑n) (fun y => fderiv 𝕜 (↿g) y) (s ×ˢ univ) f' : P → G → P × G →L[𝕜] F := fun p a => f ⋆[precompR (P × G) L, a] fun x => fderiv 𝕜 (uncurry g) (p, x) A : ∀ (q₀ : P × G), q₀.fst ∈ s → HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f' q₀.fst q₀.snd) q₀ p : P x : G hp : p ∈ s hx : ¬x ∈ k M2 : kᶜ ∈ 𝓝 x M1 : s ∈ 𝓝 p ⊢ uncurry g =ᶠ[𝓝 (p, x)] fun x => 0 [PROOFSTEP] rw [nhds_prod_eq] [GOAL] 𝕜 : Type u𝕜 G✝ : Type uG E : Type uE E'✝¹ : Type uE' E'' : Type uE'' F✝¹ : Type uF F' : Type uF' F'' : Type uF'' P✝ : Type uP inst✝³⁴ : NormedAddCommGroup E inst✝³³ : NormedAddCommGroup E'✝¹ inst✝³² : NormedAddCommGroup E'' inst✝³¹ : NormedAddCommGroup F✝¹ f✝ f'✝ : G✝ → E g✝¹ g' : G✝ → E'✝¹ x✝ x' : G✝ y y' : E inst✝³⁰ : IsROrC 𝕜 inst✝²⁹ : NormedSpace 𝕜 E inst✝²⁸ : NormedSpace 𝕜 E'✝¹ inst✝²⁷ : NormedSpace 𝕜 E'' inst✝²⁶ : NormedSpace ℝ F✝¹ inst✝²⁵ : NormedSpace 𝕜 F✝¹ inst✝²⁴ : CompleteSpace F✝¹ inst✝²³ : MeasurableSpace G✝ inst✝²² : NormedAddCommGroup G✝ inst✝²¹ : BorelSpace G✝ inst✝²⁰ : NormedSpace 𝕜 G✝ inst✝¹⁹ : NormedAddCommGroup P✝ inst✝¹⁸ : NormedSpace 𝕜 P✝ μ✝ : Measure G✝ L✝¹ : E →L[𝕜] E'✝¹ →L[𝕜] F✝¹ G E'✝ F✝ P : Type uP inst✝¹⁷ : NormedAddCommGroup E'✝ inst✝¹⁶ : NormedAddCommGroup F✝ inst✝¹⁵ : NormedSpace 𝕜 E'✝ inst✝¹⁴ : NormedSpace ℝ F✝ inst✝¹³ : NormedSpace 𝕜 F✝ inst✝¹² : CompleteSpace F✝ inst✝¹¹ : MeasurableSpace G μ : Measure G inst✝¹⁰ : NormedAddCommGroup G inst✝⁹ : BorelSpace G inst✝⁸ : NormedSpace 𝕜 G inst✝⁷ : NormedAddCommGroup P inst✝⁶ : NormedSpace 𝕜 P f : G → E n✝ : ℕ∞ L✝ : E →L[𝕜] E'✝ →L[𝕜] F✝ g✝ : P → G → E'✝ s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs✝ : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g✝ p x = 0 hf : LocallyIntegrable f hg✝ : ContDiffOn 𝕜 n✝ (↿g✝) (s ×ˢ univ) n : ℕ ih : ∀ {E' F : Type uP} [inst : NormedAddCommGroup E'] [inst_1 : NormedAddCommGroup F] [inst_2 : NormedSpace 𝕜 E'] [inst_3 : NormedSpace ℝ F] [inst_4 : NormedSpace 𝕜 F] [inst_5 : CompleteSpace F] (L : E →L[𝕜] E' →L[𝕜] F) {g : P → G → E'}, (∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0) → ContDiffOn 𝕜 (↑n) (↿g) (s ×ˢ univ) → ContDiffOn 𝕜 (↑n) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) E' F : Type uP inst✝⁵ : NormedAddCommGroup E' inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace 𝕜 E' inst✝² : NormedSpace ℝ F inst✝¹ : NormedSpace 𝕜 F inst✝ : CompleteSpace F L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hg : DifferentiableOn 𝕜 (↿g) (s ×ˢ univ) ∧ ContDiffOn 𝕜 (↑n) (fun y => fderiv 𝕜 (↿g) y) (s ×ˢ univ) f' : P → G → P × G →L[𝕜] F := fun p a => f ⋆[precompR (P × G) L, a] fun x => fderiv 𝕜 (uncurry g) (p, x) A : ∀ (q₀ : P × G), q₀.fst ∈ s → HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f' q₀.fst q₀.snd) q₀ p : P x : G hp : p ∈ s hx : ¬x ∈ k M2 : kᶜ ∈ 𝓝 x M1 : s ∈ 𝓝 p ⊢ uncurry g =ᶠ[𝓝 p ×ˢ 𝓝 x] fun x => 0 [PROOFSTEP] filter_upwards [prod_mem_prod M1 M2] [GOAL] case h 𝕜 : Type u𝕜 G✝ : Type uG E : Type uE E'✝¹ : Type uE' E'' : Type uE'' F✝¹ : Type uF F' : Type uF' F'' : Type uF'' P✝ : Type uP inst✝³⁴ : NormedAddCommGroup E inst✝³³ : NormedAddCommGroup E'✝¹ inst✝³² : NormedAddCommGroup E'' inst✝³¹ : NormedAddCommGroup F✝¹ f✝ f'✝ : G✝ → E g✝¹ g' : G✝ → E'✝¹ x✝ x' : G✝ y y' : E inst✝³⁰ : IsROrC 𝕜 inst✝²⁹ : NormedSpace 𝕜 E inst✝²⁸ : NormedSpace 𝕜 E'✝¹ inst✝²⁷ : NormedSpace 𝕜 E'' inst✝²⁶ : NormedSpace ℝ F✝¹ inst✝²⁵ : NormedSpace 𝕜 F✝¹ inst✝²⁴ : CompleteSpace F✝¹ inst✝²³ : MeasurableSpace G✝ inst✝²² : NormedAddCommGroup G✝ inst✝²¹ : BorelSpace G✝ inst✝²⁰ : NormedSpace 𝕜 G✝ inst✝¹⁹ : NormedAddCommGroup P✝ inst✝¹⁸ : NormedSpace 𝕜 P✝ μ✝ : Measure G✝ L✝¹ : E →L[𝕜] E'✝¹ →L[𝕜] F✝¹ G E'✝ F✝ P : Type uP inst✝¹⁷ : NormedAddCommGroup E'✝ inst✝¹⁶ : NormedAddCommGroup F✝ inst✝¹⁵ : NormedSpace 𝕜 E'✝ inst✝¹⁴ : NormedSpace ℝ F✝ inst✝¹³ : NormedSpace 𝕜 F✝ inst✝¹² : CompleteSpace F✝ inst✝¹¹ : MeasurableSpace G μ : Measure G inst✝¹⁰ : NormedAddCommGroup G inst✝⁹ : BorelSpace G inst✝⁸ : NormedSpace 𝕜 G inst✝⁷ : NormedAddCommGroup P inst✝⁶ : NormedSpace 𝕜 P f : G → E n✝ : ℕ∞ L✝ : E →L[𝕜] E'✝ →L[𝕜] F✝ g✝ : P → G → E'✝ s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs✝ : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g✝ p x = 0 hf : LocallyIntegrable f hg✝ : ContDiffOn 𝕜 n✝ (↿g✝) (s ×ˢ univ) n : ℕ ih : ∀ {E' F : Type uP} [inst : NormedAddCommGroup E'] [inst_1 : NormedAddCommGroup F] [inst_2 : NormedSpace 𝕜 E'] [inst_3 : NormedSpace ℝ F] [inst_4 : NormedSpace 𝕜 F] [inst_5 : CompleteSpace F] (L : E →L[𝕜] E' →L[𝕜] F) {g : P → G → E'}, (∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0) → ContDiffOn 𝕜 (↑n) (↿g) (s ×ˢ univ) → ContDiffOn 𝕜 (↑n) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) E' F : Type uP inst✝⁵ : NormedAddCommGroup E' inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace 𝕜 E' inst✝² : NormedSpace ℝ F inst✝¹ : NormedSpace 𝕜 F inst✝ : CompleteSpace F L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hg : DifferentiableOn 𝕜 (↿g) (s ×ˢ univ) ∧ ContDiffOn 𝕜 (↑n) (fun y => fderiv 𝕜 (↿g) y) (s ×ˢ univ) f' : P → G → P × G →L[𝕜] F := fun p a => f ⋆[precompR (P × G) L, a] fun x => fderiv 𝕜 (uncurry g) (p, x) A : ∀ (q₀ : P × G), q₀.fst ∈ s → HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f' q₀.fst q₀.snd) q₀ p : P x : G hp : p ∈ s hx : ¬x ∈ k M2 : kᶜ ∈ 𝓝 x M1 : s ∈ 𝓝 p ⊢ ∀ (a : P × G), a ∈ s ×ˢ kᶜ → uncurry g a = 0 [PROOFSTEP] rintro ⟨p, y⟩ ⟨hp, hy⟩ [GOAL] case h.mk.intro 𝕜 : Type u𝕜 G✝ : Type uG E : Type uE E'✝¹ : Type uE' E'' : Type uE'' F✝¹ : Type uF F' : Type uF' F'' : Type uF'' P✝ : Type uP inst✝³⁴ : NormedAddCommGroup E inst✝³³ : NormedAddCommGroup E'✝¹ inst✝³² : NormedAddCommGroup E'' inst✝³¹ : NormedAddCommGroup F✝¹ f✝ f'✝ : G✝ → E g✝¹ g' : G✝ → E'✝¹ x✝ x' : G✝ y✝ y' : E inst✝³⁰ : IsROrC 𝕜 inst✝²⁹ : NormedSpace 𝕜 E inst✝²⁸ : NormedSpace 𝕜 E'✝¹ inst✝²⁷ : NormedSpace 𝕜 E'' inst✝²⁶ : NormedSpace ℝ F✝¹ inst✝²⁵ : NormedSpace 𝕜 F✝¹ inst✝²⁴ : CompleteSpace F✝¹ inst✝²³ : MeasurableSpace G✝ inst✝²² : NormedAddCommGroup G✝ inst✝²¹ : BorelSpace G✝ inst✝²⁰ : NormedSpace 𝕜 G✝ inst✝¹⁹ : NormedAddCommGroup P✝ inst✝¹⁸ : NormedSpace 𝕜 P✝ μ✝ : Measure G✝ L✝¹ : E →L[𝕜] E'✝¹ →L[𝕜] F✝¹ G E'✝ F✝ P : Type uP inst✝¹⁷ : NormedAddCommGroup E'✝ inst✝¹⁶ : NormedAddCommGroup F✝ inst✝¹⁵ : NormedSpace 𝕜 E'✝ inst✝¹⁴ : NormedSpace ℝ F✝ inst✝¹³ : NormedSpace 𝕜 F✝ inst✝¹² : CompleteSpace F✝ inst✝¹¹ : MeasurableSpace G μ : Measure G inst✝¹⁰ : NormedAddCommGroup G inst✝⁹ : BorelSpace G inst✝⁸ : NormedSpace 𝕜 G inst✝⁷ : NormedAddCommGroup P inst✝⁶ : NormedSpace 𝕜 P f : G → E n✝ : ℕ∞ L✝ : E →L[𝕜] E'✝ →L[𝕜] F✝ g✝ : P → G → E'✝ s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs✝ : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g✝ p x = 0 hf : LocallyIntegrable f hg✝ : ContDiffOn 𝕜 n✝ (↿g✝) (s ×ˢ univ) n : ℕ ih : ∀ {E' F : Type uP} [inst : NormedAddCommGroup E'] [inst_1 : NormedAddCommGroup F] [inst_2 : NormedSpace 𝕜 E'] [inst_3 : NormedSpace ℝ F] [inst_4 : NormedSpace 𝕜 F] [inst_5 : CompleteSpace F] (L : E →L[𝕜] E' →L[𝕜] F) {g : P → G → E'}, (∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0) → ContDiffOn 𝕜 (↑n) (↿g) (s ×ˢ univ) → ContDiffOn 𝕜 (↑n) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) E' F : Type uP inst✝⁵ : NormedAddCommGroup E' inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace 𝕜 E' inst✝² : NormedSpace ℝ F inst✝¹ : NormedSpace 𝕜 F inst✝ : CompleteSpace F L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hg : DifferentiableOn 𝕜 (↿g) (s ×ˢ univ) ∧ ContDiffOn 𝕜 (↑n) (fun y => fderiv 𝕜 (↿g) y) (s ×ˢ univ) f' : P → G → P × G →L[𝕜] F := fun p a => f ⋆[precompR (P × G) L, a] fun x => fderiv 𝕜 (uncurry g) (p, x) A : ∀ (q₀ : P × G), q₀.fst ∈ s → HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f' q₀.fst q₀.snd) q₀ p✝ : P x : G hp✝ : p✝ ∈ s hx : ¬x ∈ k M2 : kᶜ ∈ 𝓝 x M1 : s ∈ 𝓝 p✝ p : P y : G hp : (p, y).fst ∈ s hy : (p, y).snd ∈ kᶜ ⊢ uncurry g (p, y) = 0 [PROOFSTEP] exact hgs p y hp hy [GOAL] case H 𝕜 : Type u𝕜 G✝ : Type uG E : Type uE E'✝¹ : Type uE' E'' : Type uE'' F✝¹ : Type uF F' : Type uF' F'' : Type uF'' P✝ : Type uP inst✝³⁴ : NormedAddCommGroup E inst✝³³ : NormedAddCommGroup E'✝¹ inst✝³² : NormedAddCommGroup E'' inst✝³¹ : NormedAddCommGroup F✝¹ f✝ f'✝ : G✝ → E g✝¹ g' : G✝ → E'✝¹ x x' : G✝ y y' : E inst✝³⁰ : IsROrC 𝕜 inst✝²⁹ : NormedSpace 𝕜 E inst✝²⁸ : NormedSpace 𝕜 E'✝¹ inst✝²⁷ : NormedSpace 𝕜 E'' inst✝²⁶ : NormedSpace ℝ F✝¹ inst✝²⁵ : NormedSpace 𝕜 F✝¹ inst✝²⁴ : CompleteSpace F✝¹ inst✝²³ : MeasurableSpace G✝ inst✝²² : NormedAddCommGroup G✝ inst✝²¹ : BorelSpace G✝ inst✝²⁰ : NormedSpace 𝕜 G✝ inst✝¹⁹ : NormedAddCommGroup P✝ inst✝¹⁸ : NormedSpace 𝕜 P✝ μ✝ : Measure G✝ L✝¹ : E →L[𝕜] E'✝¹ →L[𝕜] F✝¹ G E'✝ F✝ P : Type uP inst✝¹⁷ : NormedAddCommGroup E'✝ inst✝¹⁶ : NormedAddCommGroup F✝ inst✝¹⁵ : NormedSpace 𝕜 E'✝ inst✝¹⁴ : NormedSpace ℝ F✝ inst✝¹³ : NormedSpace 𝕜 F✝ inst✝¹² : CompleteSpace F✝ inst✝¹¹ : MeasurableSpace G μ : Measure G inst✝¹⁰ : NormedAddCommGroup G inst✝⁹ : BorelSpace G inst✝⁸ : NormedSpace 𝕜 G inst✝⁷ : NormedAddCommGroup P inst✝⁶ : NormedSpace 𝕜 P f : G → E n✝ : ℕ∞ L✝ : E →L[𝕜] E'✝ →L[𝕜] F✝ g✝ : P → G → E'✝ s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs✝ : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g✝ p x = 0 hf : LocallyIntegrable f hg✝ : ContDiffOn 𝕜 n✝ (↿g✝) (s ×ˢ univ) n : ℕ ih : ∀ {E' F : Type uP} [inst : NormedAddCommGroup E'] [inst_1 : NormedAddCommGroup F] [inst_2 : NormedSpace 𝕜 E'] [inst_3 : NormedSpace ℝ F] [inst_4 : NormedSpace 𝕜 F] [inst_5 : CompleteSpace F] (L : E →L[𝕜] E' →L[𝕜] F) {g : P → G → E'}, (∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0) → ContDiffOn 𝕜 (↑n) (↿g) (s ×ˢ univ) → ContDiffOn 𝕜 (↑n) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) E' F : Type uP inst✝⁵ : NormedAddCommGroup E' inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace 𝕜 E' inst✝² : NormedSpace ℝ F inst✝¹ : NormedSpace 𝕜 F inst✝ : CompleteSpace F L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hg : DifferentiableOn 𝕜 (↿g) (s ×ˢ univ) ∧ ContDiffOn 𝕜 (↑n) (fun y => fderiv 𝕜 (↿g) y) (s ×ˢ univ) f' : P → G → P × G →L[𝕜] F := fun p a => f ⋆[precompR (P × G) L, a] fun x => fderiv 𝕜 (uncurry g) (p, x) A : ∀ (q₀ : P × G), q₀.fst ∈ s → HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f' q₀.fst q₀.snd) q₀ B : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → fderiv 𝕜 (uncurry g) (p, x) = 0 ⊢ ContDiffOn 𝕜 (↑n) (↿f') (s ×ˢ univ) [PROOFSTEP] apply ih (L.precompR (P × G) : _) B [GOAL] case H 𝕜 : Type u𝕜 G✝ : Type uG E : Type uE E'✝¹ : Type uE' E'' : Type uE'' F✝¹ : Type uF F' : Type uF' F'' : Type uF'' P✝ : Type uP inst✝³⁴ : NormedAddCommGroup E inst✝³³ : NormedAddCommGroup E'✝¹ inst✝³² : NormedAddCommGroup E'' inst✝³¹ : NormedAddCommGroup F✝¹ f✝ f'✝ : G✝ → E g✝¹ g' : G✝ → E'✝¹ x x' : G✝ y y' : E inst✝³⁰ : IsROrC 𝕜 inst✝²⁹ : NormedSpace 𝕜 E inst✝²⁸ : NormedSpace 𝕜 E'✝¹ inst✝²⁷ : NormedSpace 𝕜 E'' inst✝²⁶ : NormedSpace ℝ F✝¹ inst✝²⁵ : NormedSpace 𝕜 F✝¹ inst✝²⁴ : CompleteSpace F✝¹ inst✝²³ : MeasurableSpace G✝ inst✝²² : NormedAddCommGroup G✝ inst✝²¹ : BorelSpace G✝ inst✝²⁰ : NormedSpace 𝕜 G✝ inst✝¹⁹ : NormedAddCommGroup P✝ inst✝¹⁸ : NormedSpace 𝕜 P✝ μ✝ : Measure G✝ L✝¹ : E →L[𝕜] E'✝¹ →L[𝕜] F✝¹ G E'✝ F✝ P : Type uP inst✝¹⁷ : NormedAddCommGroup E'✝ inst✝¹⁶ : NormedAddCommGroup F✝ inst✝¹⁵ : NormedSpace 𝕜 E'✝ inst✝¹⁴ : NormedSpace ℝ F✝ inst✝¹³ : NormedSpace 𝕜 F✝ inst✝¹² : CompleteSpace F✝ inst✝¹¹ : MeasurableSpace G μ : Measure G inst✝¹⁰ : NormedAddCommGroup G inst✝⁹ : BorelSpace G inst✝⁸ : NormedSpace 𝕜 G inst✝⁷ : NormedAddCommGroup P inst✝⁶ : NormedSpace 𝕜 P f : G → E n✝ : ℕ∞ L✝ : E →L[𝕜] E'✝ →L[𝕜] F✝ g✝ : P → G → E'✝ s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs✝ : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g✝ p x = 0 hf : LocallyIntegrable f hg✝ : ContDiffOn 𝕜 n✝ (↿g✝) (s ×ˢ univ) n : ℕ ih : ∀ {E' F : Type uP} [inst : NormedAddCommGroup E'] [inst_1 : NormedAddCommGroup F] [inst_2 : NormedSpace 𝕜 E'] [inst_3 : NormedSpace ℝ F] [inst_4 : NormedSpace 𝕜 F] [inst_5 : CompleteSpace F] (L : E →L[𝕜] E' →L[𝕜] F) {g : P → G → E'}, (∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0) → ContDiffOn 𝕜 (↑n) (↿g) (s ×ˢ univ) → ContDiffOn 𝕜 (↑n) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) E' F : Type uP inst✝⁵ : NormedAddCommGroup E' inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace 𝕜 E' inst✝² : NormedSpace ℝ F inst✝¹ : NormedSpace 𝕜 F inst✝ : CompleteSpace F L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hg : DifferentiableOn 𝕜 (↿g) (s ×ˢ univ) ∧ ContDiffOn 𝕜 (↑n) (fun y => fderiv 𝕜 (↿g) y) (s ×ˢ univ) f' : P → G → P × G →L[𝕜] F := fun p a => f ⋆[precompR (P × G) L, a] fun x => fderiv 𝕜 (uncurry g) (p, x) A : ∀ (q₀ : P × G), q₀.fst ∈ s → HasFDerivAt (fun q => f ⋆[L, q.snd] g q.fst) (f' q₀.fst q₀.snd) q₀ B : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → fderiv 𝕜 (uncurry g) (p, x) = 0 ⊢ ContDiffOn 𝕜 (↑n) (↿fun p x => fderiv 𝕜 (uncurry g) (p, x)) (s ×ˢ univ) [PROOFSTEP] convert hg.2 [GOAL] case htop 𝕜 : Type u𝕜 G✝ : Type uG E : Type uE E'✝¹ : Type uE' E'' : Type uE'' F✝¹ : Type uF F' : Type uF' F'' : Type uF'' P✝ : Type uP inst✝³⁴ : NormedAddCommGroup E inst✝³³ : NormedAddCommGroup E'✝¹ inst✝³² : NormedAddCommGroup E'' inst✝³¹ : NormedAddCommGroup F✝¹ f✝ f' : G✝ → E g✝¹ g' : G✝ → E'✝¹ x x' : G✝ y y' : E inst✝³⁰ : IsROrC 𝕜 inst✝²⁹ : NormedSpace 𝕜 E inst✝²⁸ : NormedSpace 𝕜 E'✝¹ inst✝²⁷ : NormedSpace 𝕜 E'' inst✝²⁶ : NormedSpace ℝ F✝¹ inst✝²⁵ : NormedSpace 𝕜 F✝¹ inst✝²⁴ : CompleteSpace F✝¹ inst✝²³ : MeasurableSpace G✝ inst✝²² : NormedAddCommGroup G✝ inst✝²¹ : BorelSpace G✝ inst✝²⁰ : NormedSpace 𝕜 G✝ inst✝¹⁹ : NormedAddCommGroup P✝ inst✝¹⁸ : NormedSpace 𝕜 P✝ μ✝ : Measure G✝ L✝¹ : E →L[𝕜] E'✝¹ →L[𝕜] F✝¹ G E'✝ F✝ P : Type uP inst✝¹⁷ : NormedAddCommGroup E'✝ inst✝¹⁶ : NormedAddCommGroup F✝ inst✝¹⁵ : NormedSpace 𝕜 E'✝ inst✝¹⁴ : NormedSpace ℝ F✝ inst✝¹³ : NormedSpace 𝕜 F✝ inst✝¹² : CompleteSpace F✝ inst✝¹¹ : MeasurableSpace G μ : Measure G inst✝¹⁰ : NormedAddCommGroup G inst✝⁹ : BorelSpace G inst✝⁸ : NormedSpace 𝕜 G inst✝⁷ : NormedAddCommGroup P inst✝⁶ : NormedSpace 𝕜 P f : G → E n : ℕ∞ L✝ : E →L[𝕜] E'✝ →L[𝕜] F✝ g✝ : P → G → E'✝ s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs✝ : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g✝ p x = 0 hf : LocallyIntegrable f hg✝ : ContDiffOn 𝕜 n (↿g✝) (s ×ˢ univ) ih : ∀ (n : ℕ) {E' F : Type uP} [inst : NormedAddCommGroup E'] [inst_1 : NormedAddCommGroup F] [inst_2 : NormedSpace 𝕜 E'] [inst_3 : NormedSpace ℝ F] [inst_4 : NormedSpace 𝕜 F] [inst_5 : CompleteSpace F] (L : E →L[𝕜] E' →L[𝕜] F) {g : P → G → E'}, (∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0) → ContDiffOn 𝕜 (↑n) (↿g) (s ×ˢ univ) → ContDiffOn 𝕜 (↑n) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) E' F : Type uP inst✝⁵ : NormedAddCommGroup E' inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace 𝕜 E' inst✝² : NormedSpace ℝ F inst✝¹ : NormedSpace 𝕜 F inst✝ : CompleteSpace F L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hg : ContDiffOn 𝕜 ⊤ (↿g) (s ×ˢ univ) ⊢ ContDiffOn 𝕜 ⊤ (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] rw [contDiffOn_top] at hg ⊢ [GOAL] case htop 𝕜 : Type u𝕜 G✝ : Type uG E : Type uE E'✝¹ : Type uE' E'' : Type uE'' F✝¹ : Type uF F' : Type uF' F'' : Type uF'' P✝ : Type uP inst✝³⁴ : NormedAddCommGroup E inst✝³³ : NormedAddCommGroup E'✝¹ inst✝³² : NormedAddCommGroup E'' inst✝³¹ : NormedAddCommGroup F✝¹ f✝ f' : G✝ → E g✝¹ g' : G✝ → E'✝¹ x x' : G✝ y y' : E inst✝³⁰ : IsROrC 𝕜 inst✝²⁹ : NormedSpace 𝕜 E inst✝²⁸ : NormedSpace 𝕜 E'✝¹ inst✝²⁷ : NormedSpace 𝕜 E'' inst✝²⁶ : NormedSpace ℝ F✝¹ inst✝²⁵ : NormedSpace 𝕜 F✝¹ inst✝²⁴ : CompleteSpace F✝¹ inst✝²³ : MeasurableSpace G✝ inst✝²² : NormedAddCommGroup G✝ inst✝²¹ : BorelSpace G✝ inst✝²⁰ : NormedSpace 𝕜 G✝ inst✝¹⁹ : NormedAddCommGroup P✝ inst✝¹⁸ : NormedSpace 𝕜 P✝ μ✝ : Measure G✝ L✝¹ : E →L[𝕜] E'✝¹ →L[𝕜] F✝¹ G E'✝ F✝ P : Type uP inst✝¹⁷ : NormedAddCommGroup E'✝ inst✝¹⁶ : NormedAddCommGroup F✝ inst✝¹⁵ : NormedSpace 𝕜 E'✝ inst✝¹⁴ : NormedSpace ℝ F✝ inst✝¹³ : NormedSpace 𝕜 F✝ inst✝¹² : CompleteSpace F✝ inst✝¹¹ : MeasurableSpace G μ : Measure G inst✝¹⁰ : NormedAddCommGroup G inst✝⁹ : BorelSpace G inst✝⁸ : NormedSpace 𝕜 G inst✝⁷ : NormedAddCommGroup P inst✝⁶ : NormedSpace 𝕜 P f : G → E n : ℕ∞ L✝ : E →L[𝕜] E'✝ →L[𝕜] F✝ g✝ : P → G → E'✝ s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs✝ : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g✝ p x = 0 hf : LocallyIntegrable f hg✝ : ContDiffOn 𝕜 n (↿g✝) (s ×ˢ univ) ih : ∀ (n : ℕ) {E' F : Type uP} [inst : NormedAddCommGroup E'] [inst_1 : NormedAddCommGroup F] [inst_2 : NormedSpace 𝕜 E'] [inst_3 : NormedSpace ℝ F] [inst_4 : NormedSpace 𝕜 F] [inst_5 : CompleteSpace F] (L : E →L[𝕜] E' →L[𝕜] F) {g : P → G → E'}, (∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0) → ContDiffOn 𝕜 (↑n) (↿g) (s ×ˢ univ) → ContDiffOn 𝕜 (↑n) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) E' F : Type uP inst✝⁵ : NormedAddCommGroup E' inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace 𝕜 E' inst✝² : NormedSpace ℝ F inst✝¹ : NormedSpace 𝕜 F inst✝ : CompleteSpace F L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hg : ∀ (n : ℕ), ContDiffOn 𝕜 (↑n) (↿g) (s ×ˢ univ) ⊢ ∀ (n : ℕ), ContDiffOn 𝕜 (↑n) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] intro n [GOAL] case htop 𝕜 : Type u𝕜 G✝ : Type uG E : Type uE E'✝¹ : Type uE' E'' : Type uE'' F✝¹ : Type uF F' : Type uF' F'' : Type uF'' P✝ : Type uP inst✝³⁴ : NormedAddCommGroup E inst✝³³ : NormedAddCommGroup E'✝¹ inst✝³² : NormedAddCommGroup E'' inst✝³¹ : NormedAddCommGroup F✝¹ f✝ f' : G✝ → E g✝¹ g' : G✝ → E'✝¹ x x' : G✝ y y' : E inst✝³⁰ : IsROrC 𝕜 inst✝²⁹ : NormedSpace 𝕜 E inst✝²⁸ : NormedSpace 𝕜 E'✝¹ inst✝²⁷ : NormedSpace 𝕜 E'' inst✝²⁶ : NormedSpace ℝ F✝¹ inst✝²⁵ : NormedSpace 𝕜 F✝¹ inst✝²⁴ : CompleteSpace F✝¹ inst✝²³ : MeasurableSpace G✝ inst✝²² : NormedAddCommGroup G✝ inst✝²¹ : BorelSpace G✝ inst✝²⁰ : NormedSpace 𝕜 G✝ inst✝¹⁹ : NormedAddCommGroup P✝ inst✝¹⁸ : NormedSpace 𝕜 P✝ μ✝ : Measure G✝ L✝¹ : E →L[𝕜] E'✝¹ →L[𝕜] F✝¹ G E'✝ F✝ P : Type uP inst✝¹⁷ : NormedAddCommGroup E'✝ inst✝¹⁶ : NormedAddCommGroup F✝ inst✝¹⁵ : NormedSpace 𝕜 E'✝ inst✝¹⁴ : NormedSpace ℝ F✝ inst✝¹³ : NormedSpace 𝕜 F✝ inst✝¹² : CompleteSpace F✝ inst✝¹¹ : MeasurableSpace G μ : Measure G inst✝¹⁰ : NormedAddCommGroup G inst✝⁹ : BorelSpace G inst✝⁸ : NormedSpace 𝕜 G inst✝⁷ : NormedAddCommGroup P inst✝⁶ : NormedSpace 𝕜 P f : G → E n✝ : ℕ∞ L✝ : E →L[𝕜] E'✝ →L[𝕜] F✝ g✝ : P → G → E'✝ s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs✝ : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g✝ p x = 0 hf : LocallyIntegrable f hg✝ : ContDiffOn 𝕜 n✝ (↿g✝) (s ×ˢ univ) ih : ∀ (n : ℕ) {E' F : Type uP} [inst : NormedAddCommGroup E'] [inst_1 : NormedAddCommGroup F] [inst_2 : NormedSpace 𝕜 E'] [inst_3 : NormedSpace ℝ F] [inst_4 : NormedSpace 𝕜 F] [inst_5 : CompleteSpace F] (L : E →L[𝕜] E' →L[𝕜] F) {g : P → G → E'}, (∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0) → ContDiffOn 𝕜 (↑n) (↿g) (s ×ˢ univ) → ContDiffOn 𝕜 (↑n) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) E' F : Type uP inst✝⁵ : NormedAddCommGroup E' inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace 𝕜 E' inst✝² : NormedSpace ℝ F inst✝¹ : NormedSpace 𝕜 F inst✝ : CompleteSpace F L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hg : ∀ (n : ℕ), ContDiffOn 𝕜 (↑n) (↿g) (s ×ˢ univ) n : ℕ ⊢ ContDiffOn 𝕜 (↑n) (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] exact ih n L hgs (hg n) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) ⊢ ContDiffOn 𝕜 n (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] let eG : Type max uG uE' uF uP := ULift.{max uE' uF uP} G [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G ⊢ ContDiffOn 𝕜 n (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] borelize eG [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG ⊢ ContDiffOn 𝕜 n (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] let eE' : Type max uE' uG uF uP := ULift.{max uG uF uP} E' [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' ⊢ ContDiffOn 𝕜 n (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] let eF : Type max uF uG uE' uP := ULift.{max uG uE' uP} F [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F ⊢ ContDiffOn 𝕜 n (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] let eP : Type max uP uG uE' uF := ULift.{max uG uE' uF} P [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P ⊢ ContDiffOn 𝕜 n (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] have isoG : eG ≃L[𝕜] G := ContinuousLinearEquiv.ulift [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G ⊢ ContDiffOn 𝕜 n (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] have isoE' : eE' ≃L[𝕜] E' := ContinuousLinearEquiv.ulift [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' ⊢ ContDiffOn 𝕜 n (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] have isoF : eF ≃L[𝕜] F := ContinuousLinearEquiv.ulift [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F ⊢ ContDiffOn 𝕜 n (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] have isoP : eP ≃L[𝕜] P := ContinuousLinearEquiv.ulift [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ⊢ ContDiffOn 𝕜 n (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] let ef := f ∘ isoG [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG ⊢ ContDiffOn 𝕜 n (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] let eμ : MeasureTheory.Measure eG := Measure.map isoG.symm μ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ ⊢ ContDiffOn 𝕜 n (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] let eg : eP → eG → eE' := fun ep ex => isoE'.symm (g (isoP ep) (isoG ex)) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) ⊢ ContDiffOn 𝕜 n (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] let eL := ContinuousLinearMap.comp ((ContinuousLinearEquiv.arrowCongr isoE' isoF).symm : (E' →L[𝕜] F) →L[𝕜] eE' →L[𝕜] eF) L [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L ⊢ ContDiffOn 𝕜 n (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] let R := fun q : eP × eG => (ef ⋆[eL, eμ] eg q.1) q.2 [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst ⊢ ContDiffOn 𝕜 n (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] have R_contdiff : ContDiffOn 𝕜 n R ((isoP ⁻¹' s) ×ˢ univ) := by have hek : IsCompact (isoG ⁻¹' k) := isoG.toHomeomorph.closedEmbedding.isCompact_preimage hk have hes : IsOpen (isoP ⁻¹' s) := isoP.continuous.isOpen_preimage _ hs refine' contDiffOn_convolution_right_with_param_aux eL hes hek _ _ _ · intro p x hp hx simp only [(· ∘ ·), ContinuousLinearEquiv.prod_apply, LinearIsometryEquiv.coe_coe, ContinuousLinearEquiv.map_eq_zero_iff] exact hgs _ _ hp hx · apply (locallyIntegrable_map_homeomorph isoG.symm.toHomeomorph).2 convert hf ext1 x simp only [ContinuousLinearEquiv.coe_toHomeomorph, (· ∘ ·), ContinuousLinearEquiv.apply_symm_apply] · apply isoE'.symm.contDiff.comp_contDiffOn apply hg.comp (isoP.prod isoG).contDiff.contDiffOn rintro ⟨p, x⟩ ⟨hp, -⟩ simpa only [mem_preimage, ContinuousLinearEquiv.prod_apply, prod_mk_mem_set_prod_eq, mem_univ, and_true_iff] using hp [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst ⊢ ContDiffOn 𝕜 n R ((↑isoP ⁻¹' s) ×ˢ univ) [PROOFSTEP] have hek : IsCompact (isoG ⁻¹' k) := isoG.toHomeomorph.closedEmbedding.isCompact_preimage hk [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst hek : IsCompact (↑isoG ⁻¹' k) ⊢ ContDiffOn 𝕜 n R ((↑isoP ⁻¹' s) ×ˢ univ) [PROOFSTEP] have hes : IsOpen (isoP ⁻¹' s) := isoP.continuous.isOpen_preimage _ hs [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst hek : IsCompact (↑isoG ⁻¹' k) hes : IsOpen (↑isoP ⁻¹' s) ⊢ ContDiffOn 𝕜 n R ((↑isoP ⁻¹' s) ×ˢ univ) [PROOFSTEP] refine' contDiffOn_convolution_right_with_param_aux eL hes hek _ _ _ [GOAL] case refine'_1 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst hek : IsCompact (↑isoG ⁻¹' k) hes : IsOpen (↑isoP ⁻¹' s) ⊢ ∀ (p : eP) (x : eG), p ∈ ↑isoP ⁻¹' s → ¬x ∈ ↑isoG ⁻¹' k → eg p x = 0 [PROOFSTEP] intro p x hp hx [GOAL] case refine'_1 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst hek : IsCompact (↑isoG ⁻¹' k) hes : IsOpen (↑isoP ⁻¹' s) p : eP x : eG hp : p ∈ ↑isoP ⁻¹' s hx : ¬x ∈ ↑isoG ⁻¹' k ⊢ eg p x = 0 [PROOFSTEP] simp only [(· ∘ ·), ContinuousLinearEquiv.prod_apply, LinearIsometryEquiv.coe_coe, ContinuousLinearEquiv.map_eq_zero_iff] [GOAL] case refine'_1 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst hek : IsCompact (↑isoG ⁻¹' k) hes : IsOpen (↑isoP ⁻¹' s) p : eP x : eG hp : p ∈ ↑isoP ⁻¹' s hx : ¬x ∈ ↑isoG ⁻¹' k ⊢ g (↑isoP p) (↑isoG x) = 0 [PROOFSTEP] exact hgs _ _ hp hx [GOAL] case refine'_2 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst hek : IsCompact (↑isoG ⁻¹' k) hes : IsOpen (↑isoP ⁻¹' s) ⊢ LocallyIntegrable ef [PROOFSTEP] apply (locallyIntegrable_map_homeomorph isoG.symm.toHomeomorph).2 [GOAL] case refine'_2 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst hek : IsCompact (↑isoG ⁻¹' k) hes : IsOpen (↑isoP ⁻¹' s) ⊢ LocallyIntegrable (ef ∘ ↑(ContinuousLinearEquiv.toHomeomorph (ContinuousLinearEquiv.symm isoG))) [PROOFSTEP] convert hf [GOAL] case h.e'_6 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst hek : IsCompact (↑isoG ⁻¹' k) hes : IsOpen (↑isoP ⁻¹' s) ⊢ ef ∘ ↑(ContinuousLinearEquiv.toHomeomorph (ContinuousLinearEquiv.symm isoG)) = f [PROOFSTEP] ext1 x [GOAL] case h.e'_6.h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst hek : IsCompact (↑isoG ⁻¹' k) hes : IsOpen (↑isoP ⁻¹' s) x : G ⊢ (ef ∘ ↑(ContinuousLinearEquiv.toHomeomorph (ContinuousLinearEquiv.symm isoG))) x = f x [PROOFSTEP] simp only [ContinuousLinearEquiv.coe_toHomeomorph, (· ∘ ·), ContinuousLinearEquiv.apply_symm_apply] [GOAL] case refine'_3 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst hek : IsCompact (↑isoG ⁻¹' k) hes : IsOpen (↑isoP ⁻¹' s) ⊢ ContDiffOn 𝕜 n (↿eg) ((↑isoP ⁻¹' s) ×ˢ univ) [PROOFSTEP] apply isoE'.symm.contDiff.comp_contDiffOn [GOAL] case refine'_3 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst hek : IsCompact (↑isoG ⁻¹' k) hes : IsOpen (↑isoP ⁻¹' s) ⊢ ContDiffOn 𝕜 n (fun x => g (↑isoP x.fst) (↑isoG x.snd)) ((↑isoP ⁻¹' s) ×ˢ univ) [PROOFSTEP] apply hg.comp (isoP.prod isoG).contDiff.contDiffOn [GOAL] case refine'_3 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst hek : IsCompact (↑isoG ⁻¹' k) hes : IsOpen (↑isoP ⁻¹' s) ⊢ (↑isoP ⁻¹' s) ×ˢ univ ⊆ ↑(ContinuousLinearEquiv.prod isoP isoG) ⁻¹' s ×ˢ univ [PROOFSTEP] rintro ⟨p, x⟩ ⟨hp, -⟩ [GOAL] case refine'_3.mk.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst hek : IsCompact (↑isoG ⁻¹' k) hes : IsOpen (↑isoP ⁻¹' s) p : eP x : eG hp : (p, x).fst ∈ ↑isoP ⁻¹' s ⊢ (p, x) ∈ ↑(ContinuousLinearEquiv.prod isoP isoG) ⁻¹' s ×ˢ univ [PROOFSTEP] simpa only [mem_preimage, ContinuousLinearEquiv.prod_apply, prod_mk_mem_set_prod_eq, mem_univ, and_true_iff] using hp [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst R_contdiff : ContDiffOn 𝕜 n R ((↑isoP ⁻¹' s) ×ˢ univ) ⊢ ContDiffOn 𝕜 n (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] have A : ContDiffOn 𝕜 n (isoF ∘ R ∘ (isoP.prod isoG).symm) (s ×ˢ univ) := by apply isoF.contDiff.comp_contDiffOn apply R_contdiff.comp (ContinuousLinearEquiv.contDiff _).contDiffOn rintro ⟨p, x⟩ ⟨hp, -⟩ simpa only [mem_preimage, mem_prod, mem_univ, and_true_iff, ContinuousLinearEquiv.prod_symm, ContinuousLinearEquiv.prod_apply, ContinuousLinearEquiv.apply_symm_apply] using hp [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst R_contdiff : ContDiffOn 𝕜 n R ((↑isoP ⁻¹' s) ×ˢ univ) ⊢ ContDiffOn 𝕜 n (↑isoF ∘ R ∘ ↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.prod isoP isoG))) (s ×ˢ univ) [PROOFSTEP] apply isoF.contDiff.comp_contDiffOn [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst R_contdiff : ContDiffOn 𝕜 n R ((↑isoP ⁻¹' s) ×ˢ univ) ⊢ ContDiffOn 𝕜 n (R ∘ ↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.prod isoP isoG))) (s ×ˢ univ) [PROOFSTEP] apply R_contdiff.comp (ContinuousLinearEquiv.contDiff _).contDiffOn [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst R_contdiff : ContDiffOn 𝕜 n R ((↑isoP ⁻¹' s) ×ˢ univ) ⊢ s ×ˢ univ ⊆ ↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.prod isoP isoG)) ⁻¹' (↑isoP ⁻¹' s) ×ˢ univ [PROOFSTEP] rintro ⟨p, x⟩ ⟨hp, -⟩ [GOAL] case mk.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst R_contdiff : ContDiffOn 𝕜 n R ((↑isoP ⁻¹' s) ×ˢ univ) p : P x : G hp : (p, x).fst ∈ s ⊢ (p, x) ∈ ↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.prod isoP isoG)) ⁻¹' (↑isoP ⁻¹' s) ×ˢ univ [PROOFSTEP] simpa only [mem_preimage, mem_prod, mem_univ, and_true_iff, ContinuousLinearEquiv.prod_symm, ContinuousLinearEquiv.prod_apply, ContinuousLinearEquiv.apply_symm_apply] using hp [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst R_contdiff : ContDiffOn 𝕜 n R ((↑isoP ⁻¹' s) ×ˢ univ) A : ContDiffOn 𝕜 n (↑isoF ∘ R ∘ ↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.prod isoP isoG))) (s ×ˢ univ) ⊢ ContDiffOn 𝕜 n (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] have : isoF ∘ R ∘ (isoP.prod isoG).symm = fun q : P × G => (f ⋆[L, μ] g q.1) q.2 := by apply funext rintro ⟨p, x⟩ simp only [LinearIsometryEquiv.coe_coe, (· ∘ ·), ContinuousLinearEquiv.prod_symm, ContinuousLinearEquiv.prod_apply] simp only [convolution, coe_comp', ContinuousLinearEquiv.coe_coe, (· ∘ ·)] rw [ClosedEmbedding.integral_map, ← isoF.integral_comp_comm] swap; · exact isoG.symm.toHomeomorph.closedEmbedding congr 1 ext1 a simp only [(· ∘ ·), ContinuousLinearEquiv.apply_symm_apply, coe_comp', ContinuousLinearEquiv.prod_apply, ContinuousLinearEquiv.map_sub, ContinuousLinearEquiv.arrowCongr, ContinuousLinearEquiv.arrowCongrSL_symm_apply, ContinuousLinearEquiv.coe_coe, Function.comp_apply, ContinuousLinearEquiv.apply_symm_apply] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst R_contdiff : ContDiffOn 𝕜 n R ((↑isoP ⁻¹' s) ×ˢ univ) A : ContDiffOn 𝕜 n (↑isoF ∘ R ∘ ↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.prod isoP isoG))) (s ×ˢ univ) ⊢ ↑isoF ∘ R ∘ ↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.prod isoP isoG)) = fun q => f ⋆[L, q.snd] g q.fst [PROOFSTEP] apply funext [GOAL] case h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst R_contdiff : ContDiffOn 𝕜 n R ((↑isoP ⁻¹' s) ×ˢ univ) A : ContDiffOn 𝕜 n (↑isoF ∘ R ∘ ↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.prod isoP isoG))) (s ×ˢ univ) ⊢ ∀ (x : P × G), (↑isoF ∘ R ∘ ↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.prod isoP isoG))) x = f ⋆[L, x.snd] g x.fst [PROOFSTEP] rintro ⟨p, x⟩ [GOAL] case h.mk 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst R_contdiff : ContDiffOn 𝕜 n R ((↑isoP ⁻¹' s) ×ˢ univ) A : ContDiffOn 𝕜 n (↑isoF ∘ R ∘ ↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.prod isoP isoG))) (s ×ˢ univ) p : P x : G ⊢ (↑isoF ∘ R ∘ ↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.prod isoP isoG))) (p, x) = f ⋆[L, (p, x).snd] g (p, x).fst [PROOFSTEP] simp only [LinearIsometryEquiv.coe_coe, (· ∘ ·), ContinuousLinearEquiv.prod_symm, ContinuousLinearEquiv.prod_apply] [GOAL] case h.mk 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst R_contdiff : ContDiffOn 𝕜 n R ((↑isoP ⁻¹' s) ×ˢ univ) A : ContDiffOn 𝕜 n (↑isoF ∘ R ∘ ↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.prod isoP isoG))) (s ×ˢ univ) p : P x : G ⊢ ↑isoF ((fun x => f (↑isoG x)) ⋆[ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L, ↑(ContinuousLinearEquiv.symm isoG) x] fun ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP (↑(ContinuousLinearEquiv.symm isoP) p)) (↑isoG ex))) = f ⋆[L, x] g p [PROOFSTEP] simp only [convolution, coe_comp', ContinuousLinearEquiv.coe_coe, (· ∘ ·)] [GOAL] case h.mk 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst R_contdiff : ContDiffOn 𝕜 n R ((↑isoP ⁻¹' s) ×ˢ univ) A : ContDiffOn 𝕜 n (↑isoF ∘ R ∘ ↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.prod isoP isoG))) (s ×ˢ univ) p : P x : G ⊢ ↑isoF (∫ (t : ULift G), ↑(↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF)) (↑L (f (↑isoG t)))) (↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP (↑(ContinuousLinearEquiv.symm isoP) p)) (↑isoG (↑(ContinuousLinearEquiv.symm isoG) x - t)))) ∂Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ) = ∫ (t : G), ↑(↑L (f t)) (g p (x - t)) ∂μ [PROOFSTEP] rw [ClosedEmbedding.integral_map, ← isoF.integral_comp_comm] [GOAL] case h.mk 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst R_contdiff : ContDiffOn 𝕜 n R ((↑isoP ⁻¹' s) ×ˢ univ) A : ContDiffOn 𝕜 n (↑isoF ∘ R ∘ ↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.prod isoP isoG))) (s ×ˢ univ) p : P x : G ⊢ ∫ (a : G), ↑isoF (↑(↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF)) (↑L (f (↑isoG (↑(ContinuousLinearEquiv.symm isoG) a))))) (↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP (↑(ContinuousLinearEquiv.symm isoP) p)) (↑isoG (↑(ContinuousLinearEquiv.symm isoG) x - ↑(ContinuousLinearEquiv.symm isoG) a))))) ∂μ = ∫ (t : G), ↑(↑L (f t)) (g p (x - t)) ∂μ case h.mk.hφ 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst R_contdiff : ContDiffOn 𝕜 n R ((↑isoP ⁻¹' s) ×ˢ univ) A : ContDiffOn 𝕜 n (↑isoF ∘ R ∘ ↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.prod isoP isoG))) (s ×ˢ univ) p : P x : G ⊢ ClosedEmbedding ↑(ContinuousLinearEquiv.symm isoG) [PROOFSTEP] swap [GOAL] case h.mk.hφ 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst R_contdiff : ContDiffOn 𝕜 n R ((↑isoP ⁻¹' s) ×ˢ univ) A : ContDiffOn 𝕜 n (↑isoF ∘ R ∘ ↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.prod isoP isoG))) (s ×ˢ univ) p : P x : G ⊢ ClosedEmbedding ↑(ContinuousLinearEquiv.symm isoG) [PROOFSTEP] exact isoG.symm.toHomeomorph.closedEmbedding [GOAL] case h.mk 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst R_contdiff : ContDiffOn 𝕜 n R ((↑isoP ⁻¹' s) ×ˢ univ) A : ContDiffOn 𝕜 n (↑isoF ∘ R ∘ ↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.prod isoP isoG))) (s ×ˢ univ) p : P x : G ⊢ ∫ (a : G), ↑isoF (↑(↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF)) (↑L (f (↑isoG (↑(ContinuousLinearEquiv.symm isoG) a))))) (↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP (↑(ContinuousLinearEquiv.symm isoP) p)) (↑isoG (↑(ContinuousLinearEquiv.symm isoG) x - ↑(ContinuousLinearEquiv.symm isoG) a))))) ∂μ = ∫ (t : G), ↑(↑L (f t)) (g p (x - t)) ∂μ [PROOFSTEP] congr 1 [GOAL] case h.mk.e_f 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst R_contdiff : ContDiffOn 𝕜 n R ((↑isoP ⁻¹' s) ×ˢ univ) A : ContDiffOn 𝕜 n (↑isoF ∘ R ∘ ↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.prod isoP isoG))) (s ×ˢ univ) p : P x : G ⊢ (fun a => ↑isoF (↑(↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF)) (↑L (f (↑isoG (↑(ContinuousLinearEquiv.symm isoG) a))))) (↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP (↑(ContinuousLinearEquiv.symm isoP) p)) (↑isoG (↑(ContinuousLinearEquiv.symm isoG) x - ↑(ContinuousLinearEquiv.symm isoG) a)))))) = fun t => ↑(↑L (f t)) (g p (x - t)) [PROOFSTEP] ext1 a [GOAL] case h.mk.e_f.h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst R_contdiff : ContDiffOn 𝕜 n R ((↑isoP ⁻¹' s) ×ˢ univ) A : ContDiffOn 𝕜 n (↑isoF ∘ R ∘ ↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.prod isoP isoG))) (s ×ˢ univ) p : P x a : G ⊢ ↑isoF (↑(↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF)) (↑L (f (↑isoG (↑(ContinuousLinearEquiv.symm isoG) a))))) (↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP (↑(ContinuousLinearEquiv.symm isoP) p)) (↑isoG (↑(ContinuousLinearEquiv.symm isoG) x - ↑(ContinuousLinearEquiv.symm isoG) a))))) = ↑(↑L (f a)) (g p (x - a)) [PROOFSTEP] simp only [(· ∘ ·), ContinuousLinearEquiv.apply_symm_apply, coe_comp', ContinuousLinearEquiv.prod_apply, ContinuousLinearEquiv.map_sub, ContinuousLinearEquiv.arrowCongr, ContinuousLinearEquiv.arrowCongrSL_symm_apply, ContinuousLinearEquiv.coe_coe, Function.comp_apply, ContinuousLinearEquiv.apply_symm_apply] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst R_contdiff : ContDiffOn 𝕜 n R ((↑isoP ⁻¹' s) ×ˢ univ) A : ContDiffOn 𝕜 n (↑isoF ∘ R ∘ ↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.prod isoP isoG))) (s ×ˢ univ) this : ↑isoF ∘ R ∘ ↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.prod isoP isoG)) = fun q => f ⋆[L, q.snd] g q.fst ⊢ ContDiffOn 𝕜 n (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] simp_rw [this] at A [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F f : G → E n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) eG : Type (max uG uE' uF uP) := ULift G this✝¹ : MeasurableSpace eG := borel eG this✝ : BorelSpace eG eE' : Type (max uE' uG uF uP) := ULift E' eF : Type (max uF uG uE' uP) := ULift F eP : Type (max uP uG uE' uF) := ULift P isoG : eG ≃L[𝕜] G isoE' : eE' ≃L[𝕜] E' isoF : eF ≃L[𝕜] F isoP : eP ≃L[𝕜] P ef : eG → E := f ∘ ↑isoG eμ : Measure eG := Measure.map (↑(ContinuousLinearEquiv.symm isoG)) μ eg : eP → eG → eE' := fun ep ex => ↑(ContinuousLinearEquiv.symm isoE') (g (↑isoP ep) (↑isoG ex)) eL : E →L[𝕜] eE' →L[𝕜] eF := ContinuousLinearMap.comp (↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.arrowCongr isoE' isoF))) L R : eP × eG → eF := fun q => ef ⋆[eL, q.snd] eg q.fst R_contdiff : ContDiffOn 𝕜 n R ((↑isoP ⁻¹' s) ×ˢ univ) this : ↑isoF ∘ R ∘ ↑(ContinuousLinearEquiv.symm (ContinuousLinearEquiv.prod isoP isoG)) = fun q => f ⋆[L, q.snd] g q.fst A : ContDiffOn 𝕜 n (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) ⊢ ContDiffOn 𝕜 n (fun q => f ⋆[L, q.snd] g q.fst) (s ×ˢ univ) [PROOFSTEP] exact A [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F s : Set P v : P → G hv : ContDiffOn 𝕜 n v s f : G → E g : P → G → E' k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) ⊢ ContDiffOn 𝕜 n (fun x => f ⋆[L, v x] g x) s [PROOFSTEP] apply (contDiffOn_convolution_right_with_param L hs hk hgs hf hg).comp (contDiffOn_id.prod hv) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F s : Set P v : P → G hv : ContDiffOn 𝕜 n v s f : G → E g : P → G → E' k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) ⊢ s ⊆ (fun x => (_root_.id x, v x)) ⁻¹' s ×ˢ univ [PROOFSTEP] intro x hx [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F n : ℕ∞ L : E →L[𝕜] E' →L[𝕜] F s : Set P v : P → G hv : ContDiffOn 𝕜 n v s f : G → E g : P → G → E' k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) x : P hx : x ∈ s ⊢ x ∈ (fun x => (_root_.id x, v x)) ⁻¹' s ×ˢ univ [PROOFSTEP] simp only [hx, mem_preimage, prod_mk_mem_set_prod_eq, mem_univ, and_self_iff, id.def] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : IsROrC 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace ℝ F inst✝⁹ : NormedSpace 𝕜 F inst✝⁸ : CompleteSpace F inst✝⁷ : MeasurableSpace G inst✝⁶ : NormedAddCommGroup G inst✝⁵ : BorelSpace G inst✝⁴ : NormedSpace 𝕜 G inst✝³ : NormedAddCommGroup P inst✝² : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F inst✝¹ : IsAddLeftInvariant μ inst✝ : IsNegInvariant μ L : E' →L[𝕜] E →L[𝕜] F f : G → E n : ℕ∞ g : P → G → E' s : Set P k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) ⊢ ContDiffOn 𝕜 n (fun q => g q.fst ⋆[L, q.snd] f) (s ×ˢ univ) [PROOFSTEP] simpa only [convolution_flip] using contDiffOn_convolution_right_with_param L.flip hs hk hgs hf hg [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : IsROrC 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace ℝ F inst✝⁹ : NormedSpace 𝕜 F inst✝⁸ : CompleteSpace F inst✝⁷ : MeasurableSpace G inst✝⁶ : NormedAddCommGroup G inst✝⁵ : BorelSpace G inst✝⁴ : NormedSpace 𝕜 G inst✝³ : NormedAddCommGroup P inst✝² : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F inst✝¹ : IsAddLeftInvariant μ inst✝ : IsNegInvariant μ L : E' →L[𝕜] E →L[𝕜] F s : Set P n : ℕ∞ v : P → G hv : ContDiffOn 𝕜 n v s f : G → E g : P → G → E' k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) ⊢ ContDiffOn 𝕜 n (fun x => g x ⋆[L, v x] f) s [PROOFSTEP] apply (contDiffOn_convolution_left_with_param L hs hk hgs hf hg).comp (contDiffOn_id.prod hv) [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝¹⁴ : IsROrC 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace ℝ F inst✝⁹ : NormedSpace 𝕜 F inst✝⁸ : CompleteSpace F inst✝⁷ : MeasurableSpace G inst✝⁶ : NormedAddCommGroup G inst✝⁵ : BorelSpace G inst✝⁴ : NormedSpace 𝕜 G inst✝³ : NormedAddCommGroup P inst✝² : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F inst✝¹ : IsAddLeftInvariant μ inst✝ : IsNegInvariant μ L : E' →L[𝕜] E →L[𝕜] F s : Set P n : ℕ∞ v : P → G hv : ContDiffOn 𝕜 n v s f : G → E g : P → G → E' k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) ⊢ s ⊆ (fun x => (_root_.id x, v x)) ⁻¹' s ×ˢ univ [PROOFSTEP] intro x hx [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝¹⁴ : IsROrC 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace ℝ F inst✝⁹ : NormedSpace 𝕜 F inst✝⁸ : CompleteSpace F inst✝⁷ : MeasurableSpace G inst✝⁶ : NormedAddCommGroup G inst✝⁵ : BorelSpace G inst✝⁴ : NormedSpace 𝕜 G inst✝³ : NormedAddCommGroup P inst✝² : NormedSpace 𝕜 P μ : Measure G L✝ : E →L[𝕜] E' →L[𝕜] F inst✝¹ : IsAddLeftInvariant μ inst✝ : IsNegInvariant μ L : E' →L[𝕜] E →L[𝕜] F s : Set P n : ℕ∞ v : P → G hv : ContDiffOn 𝕜 n v s f : G → E g : P → G → E' k : Set G hs : IsOpen s hk : IsCompact k hgs : ∀ (p : P) (x : G), p ∈ s → ¬x ∈ k → g p x = 0 hf : LocallyIntegrable f hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ) x : P hx : x ∈ s ⊢ x ∈ (fun x => (_root_.id x, v x)) ⁻¹' s ×ˢ univ [PROOFSTEP] simp only [hx, mem_preimage, prod_mk_mem_set_prod_eq, mem_univ, and_self_iff, id.def] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F n : ℕ∞ hcg : HasCompactSupport g hf : LocallyIntegrable f hg : ContDiff 𝕜 n g ⊢ ContDiff 𝕜 n (convolution f g L) [PROOFSTEP] rcases exists_compact_iff_hasCompactSupport.2 hcg with ⟨k, hk, h'k⟩ [GOAL] case intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F n : ℕ∞ hcg : HasCompactSupport g hf : LocallyIntegrable f hg : ContDiff 𝕜 n g k : Set G hk : IsCompact k h'k : ∀ (x : G), ¬x ∈ k → g x = 0 ⊢ ContDiff 𝕜 n (convolution f g L) [PROOFSTEP] rw [← contDiffOn_univ] [GOAL] case intro.intro 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁶ : NormedAddCommGroup E inst✝¹⁵ : NormedAddCommGroup E' inst✝¹⁴ : NormedAddCommGroup E'' inst✝¹³ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹² : IsROrC 𝕜 inst✝¹¹ : NormedSpace 𝕜 E inst✝¹⁰ : NormedSpace 𝕜 E' inst✝⁹ : NormedSpace 𝕜 E'' inst✝⁸ : NormedSpace ℝ F inst✝⁷ : NormedSpace 𝕜 F inst✝⁶ : CompleteSpace F inst✝⁵ : MeasurableSpace G inst✝⁴ : NormedAddCommGroup G inst✝³ : BorelSpace G inst✝² : NormedSpace 𝕜 G inst✝¹ : NormedAddCommGroup P inst✝ : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F n : ℕ∞ hcg : HasCompactSupport g hf : LocallyIntegrable f hg : ContDiff 𝕜 n g k : Set G hk : IsCompact k h'k : ∀ (x : G), ¬x ∈ k → g x = 0 ⊢ ContDiffOn 𝕜 n (convolution f g L) univ [PROOFSTEP] exact contDiffOn_convolution_right_with_param_comp L contDiffOn_id isOpen_univ hk (fun p x _ hx => h'k x hx) hf (hg.comp contDiff_snd).contDiffOn [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁴ : IsROrC 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace ℝ F inst✝⁹ : NormedSpace 𝕜 F inst✝⁸ : CompleteSpace F inst✝⁷ : MeasurableSpace G inst✝⁶ : NormedAddCommGroup G inst✝⁵ : BorelSpace G inst✝⁴ : NormedSpace 𝕜 G inst✝³ : NormedAddCommGroup P inst✝² : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹ : IsAddLeftInvariant μ inst✝ : IsNegInvariant μ n : ℕ∞ hcf : HasCompactSupport f hf : ContDiff 𝕜 n f hg : LocallyIntegrable g ⊢ ContDiff 𝕜 n (convolution f g L) [PROOFSTEP] rw [← convolution_flip] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹⁸ : NormedAddCommGroup E inst✝¹⁷ : NormedAddCommGroup E' inst✝¹⁶ : NormedAddCommGroup E'' inst✝¹⁵ : NormedAddCommGroup F f f' : G → E g g' : G → E' x x' : G y y' : E inst✝¹⁴ : IsROrC 𝕜 inst✝¹³ : NormedSpace 𝕜 E inst✝¹² : NormedSpace 𝕜 E' inst✝¹¹ : NormedSpace 𝕜 E'' inst✝¹⁰ : NormedSpace ℝ F inst✝⁹ : NormedSpace 𝕜 F inst✝⁸ : CompleteSpace F inst✝⁷ : MeasurableSpace G inst✝⁶ : NormedAddCommGroup G inst✝⁵ : BorelSpace G inst✝⁴ : NormedSpace 𝕜 G inst✝³ : NormedAddCommGroup P inst✝² : NormedSpace 𝕜 P μ : Measure G L : E →L[𝕜] E' →L[𝕜] F inst✝¹ : IsAddLeftInvariant μ inst✝ : IsNegInvariant μ n : ℕ∞ hcf : HasCompactSupport f hf : ContDiff 𝕜 n f hg : LocallyIntegrable g ⊢ ContDiff 𝕜 n (convolution g f (ContinuousLinearMap.flip L)) [PROOFSTEP] exact hcf.contDiff_convolution_right L.flip hg hf [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedAddCommGroup E' inst✝⁶ : NormedAddCommGroup E'' inst✝⁵ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝⁴ : NormedSpace ℝ E inst✝³ : NormedSpace ℝ E' inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F f : ℝ → E g : ℝ → E' L : E →L[ℝ] E' →L[ℝ] F ν : autoParam (Measure ℝ) _auto✝ inst✝ : NoAtoms ν ⊢ posConvolution f g L = convolution (indicator (Ioi 0) f) (indicator (Ioi 0) g) L [PROOFSTEP] ext1 x [GOAL] case h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedAddCommGroup E' inst✝⁶ : NormedAddCommGroup E'' inst✝⁵ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝⁴ : NormedSpace ℝ E inst✝³ : NormedSpace ℝ E' inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F f : ℝ → E g : ℝ → E' L : E →L[ℝ] E' →L[ℝ] F ν : autoParam (Measure ℝ) _auto✝ inst✝ : NoAtoms ν x : ℝ ⊢ posConvolution f g L x = indicator (Ioi 0) f ⋆[L, x] indicator (Ioi 0) g [PROOFSTEP] unfold convolution posConvolution indicator [GOAL] case h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedAddCommGroup E' inst✝⁶ : NormedAddCommGroup E'' inst✝⁵ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝⁴ : NormedSpace ℝ E inst✝³ : NormedSpace ℝ E' inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F f : ℝ → E g : ℝ → E' L : E →L[ℝ] E' →L[ℝ] F ν : autoParam (Measure ℝ) _auto✝ inst✝ : NoAtoms ν x : ℝ ⊢ (if x ∈ Ioi 0 then (fun x => ∫ (t : ℝ) in 0 ..x, ↑(↑L (f t)) (g (x - t)) ∂ν) x else 0) = ∫ (t : ℝ), ↑(↑L (if t ∈ Ioi 0 then f t else 0)) (if x - t ∈ Ioi 0 then g (x - t) else 0) ∂ν [PROOFSTEP] simp only [GOAL] case h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedAddCommGroup E' inst✝⁶ : NormedAddCommGroup E'' inst✝⁵ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝⁴ : NormedSpace ℝ E inst✝³ : NormedSpace ℝ E' inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F f : ℝ → E g : ℝ → E' L : E →L[ℝ] E' →L[ℝ] F ν : autoParam (Measure ℝ) _auto✝ inst✝ : NoAtoms ν x : ℝ ⊢ (if x ∈ Ioi 0 then ∫ (t : ℝ) in 0 ..x, ↑(↑L (f t)) (g (x - t)) ∂ν else 0) = ∫ (t : ℝ), ↑(↑L (if t ∈ Ioi 0 then f t else 0)) (if x - t ∈ Ioi 0 then g (x - t) else 0) ∂ν [PROOFSTEP] split_ifs with h [GOAL] case pos 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedAddCommGroup E' inst✝⁶ : NormedAddCommGroup E'' inst✝⁵ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝⁴ : NormedSpace ℝ E inst✝³ : NormedSpace ℝ E' inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F f : ℝ → E g : ℝ → E' L : E →L[ℝ] E' →L[ℝ] F ν : autoParam (Measure ℝ) _auto✝ inst✝ : NoAtoms ν x : ℝ h : x ∈ Ioi 0 ⊢ ∫ (t : ℝ) in 0 ..x, ↑(↑L (f t)) (g (x - t)) ∂ν = ∫ (t : ℝ), ↑(↑L (if t ∈ Ioi 0 then f t else 0)) (if x - t ∈ Ioi 0 then g (x - t) else 0) ∂ν [PROOFSTEP] rw [intervalIntegral.integral_of_le (le_of_lt h), integral_Ioc_eq_integral_Ioo, ← integral_indicator (measurableSet_Ioo : MeasurableSet (Ioo 0 x))] [GOAL] case pos 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedAddCommGroup E' inst✝⁶ : NormedAddCommGroup E'' inst✝⁵ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝⁴ : NormedSpace ℝ E inst✝³ : NormedSpace ℝ E' inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F f : ℝ → E g : ℝ → E' L : E →L[ℝ] E' →L[ℝ] F ν : autoParam (Measure ℝ) _auto✝ inst✝ : NoAtoms ν x : ℝ h : x ∈ Ioi 0 ⊢ ∫ (x_1 : ℝ), indicator (Ioo 0 x) (fun t => ↑(↑L (f t)) (g (x - t))) x_1 ∂ν = ∫ (t : ℝ), ↑(↑L (if t ∈ Ioi 0 then f t else 0)) (if x - t ∈ Ioi 0 then g (x - t) else 0) ∂ν [PROOFSTEP] congr 1 with t : 1 [GOAL] case pos.e_f.h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedAddCommGroup E' inst✝⁶ : NormedAddCommGroup E'' inst✝⁵ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝⁴ : NormedSpace ℝ E inst✝³ : NormedSpace ℝ E' inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F f : ℝ → E g : ℝ → E' L : E →L[ℝ] E' →L[ℝ] F ν : autoParam (Measure ℝ) _auto✝ inst✝ : NoAtoms ν x : ℝ h : x ∈ Ioi 0 t : ℝ ⊢ indicator (Ioo 0 x) (fun t => ↑(↑L (f t)) (g (x - t))) t = ↑(↑L (if t ∈ Ioi 0 then f t else 0)) (if x - t ∈ Ioi 0 then g (x - t) else 0) [PROOFSTEP] have : t ≤ 0 ∨ t ∈ Ioo 0 x ∨ x ≤ t := by rcases le_or_lt t 0 with (h | h) · exact Or.inl h · rcases lt_or_le t x with (h' | h') exacts [Or.inr (Or.inl ⟨h, h'⟩), Or.inr (Or.inr h')] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedAddCommGroup E' inst✝⁶ : NormedAddCommGroup E'' inst✝⁵ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝⁴ : NormedSpace ℝ E inst✝³ : NormedSpace ℝ E' inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F f : ℝ → E g : ℝ → E' L : E →L[ℝ] E' →L[ℝ] F ν : autoParam (Measure ℝ) _auto✝ inst✝ : NoAtoms ν x : ℝ h : x ∈ Ioi 0 t : ℝ ⊢ t ≤ 0 ∨ t ∈ Ioo 0 x ∨ x ≤ t [PROOFSTEP] rcases le_or_lt t 0 with (h | h) [GOAL] case inl 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedAddCommGroup E' inst✝⁶ : NormedAddCommGroup E'' inst✝⁵ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝⁴ : NormedSpace ℝ E inst✝³ : NormedSpace ℝ E' inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F f : ℝ → E g : ℝ → E' L : E →L[ℝ] E' →L[ℝ] F ν : autoParam (Measure ℝ) _auto✝ inst✝ : NoAtoms ν x : ℝ h✝ : x ∈ Ioi 0 t : ℝ h : t ≤ 0 ⊢ t ≤ 0 ∨ t ∈ Ioo 0 x ∨ x ≤ t [PROOFSTEP] exact Or.inl h [GOAL] case inr 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedAddCommGroup E' inst✝⁶ : NormedAddCommGroup E'' inst✝⁵ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝⁴ : NormedSpace ℝ E inst✝³ : NormedSpace ℝ E' inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F f : ℝ → E g : ℝ → E' L : E →L[ℝ] E' →L[ℝ] F ν : autoParam (Measure ℝ) _auto✝ inst✝ : NoAtoms ν x : ℝ h✝ : x ∈ Ioi 0 t : ℝ h : 0 < t ⊢ t ≤ 0 ∨ t ∈ Ioo 0 x ∨ x ≤ t [PROOFSTEP] rcases lt_or_le t x with (h' | h') [GOAL] case inr.inl 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedAddCommGroup E' inst✝⁶ : NormedAddCommGroup E'' inst✝⁵ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝⁴ : NormedSpace ℝ E inst✝³ : NormedSpace ℝ E' inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F f : ℝ → E g : ℝ → E' L : E →L[ℝ] E' →L[ℝ] F ν : autoParam (Measure ℝ) _auto✝ inst✝ : NoAtoms ν x : ℝ h✝ : x ∈ Ioi 0 t : ℝ h : 0 < t h' : t < x ⊢ t ≤ 0 ∨ t ∈ Ioo 0 x ∨ x ≤ t case inr.inr 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedAddCommGroup E' inst✝⁶ : NormedAddCommGroup E'' inst✝⁵ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝⁴ : NormedSpace ℝ E inst✝³ : NormedSpace ℝ E' inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F f : ℝ → E g : ℝ → E' L : E →L[ℝ] E' →L[ℝ] F ν : autoParam (Measure ℝ) _auto✝ inst✝ : NoAtoms ν x : ℝ h✝ : x ∈ Ioi 0 t : ℝ h : 0 < t h' : x ≤ t ⊢ t ≤ 0 ∨ t ∈ Ioo 0 x ∨ x ≤ t [PROOFSTEP] exacts [Or.inr (Or.inl ⟨h, h'⟩), Or.inr (Or.inr h')] [GOAL] case pos.e_f.h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedAddCommGroup E' inst✝⁶ : NormedAddCommGroup E'' inst✝⁵ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝⁴ : NormedSpace ℝ E inst✝³ : NormedSpace ℝ E' inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F f : ℝ → E g : ℝ → E' L : E →L[ℝ] E' →L[ℝ] F ν : autoParam (Measure ℝ) _auto✝ inst✝ : NoAtoms ν x : ℝ h : x ∈ Ioi 0 t : ℝ this : t ≤ 0 ∨ t ∈ Ioo 0 x ∨ x ≤ t ⊢ indicator (Ioo 0 x) (fun t => ↑(↑L (f t)) (g (x - t))) t = ↑(↑L (if t ∈ Ioi 0 then f t else 0)) (if x - t ∈ Ioi 0 then g (x - t) else 0) [PROOFSTEP] rcases this with (ht | ht | ht) [GOAL] case pos.e_f.h.inl 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedAddCommGroup E' inst✝⁶ : NormedAddCommGroup E'' inst✝⁵ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝⁴ : NormedSpace ℝ E inst✝³ : NormedSpace ℝ E' inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F f : ℝ → E g : ℝ → E' L : E →L[ℝ] E' →L[ℝ] F ν : autoParam (Measure ℝ) _auto✝ inst✝ : NoAtoms ν x : ℝ h : x ∈ Ioi 0 t : ℝ ht : t ≤ 0 ⊢ indicator (Ioo 0 x) (fun t => ↑(↑L (f t)) (g (x - t))) t = ↑(↑L (if t ∈ Ioi 0 then f t else 0)) (if x - t ∈ Ioi 0 then g (x - t) else 0) [PROOFSTEP] rw [indicator_of_not_mem (not_mem_Ioo_of_le ht), if_neg (not_mem_Ioi.mpr ht), ContinuousLinearMap.map_zero, ContinuousLinearMap.zero_apply] [GOAL] case pos.e_f.h.inr.inl 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedAddCommGroup E' inst✝⁶ : NormedAddCommGroup E'' inst✝⁵ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝⁴ : NormedSpace ℝ E inst✝³ : NormedSpace ℝ E' inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F f : ℝ → E g : ℝ → E' L : E →L[ℝ] E' →L[ℝ] F ν : autoParam (Measure ℝ) _auto✝ inst✝ : NoAtoms ν x : ℝ h : x ∈ Ioi 0 t : ℝ ht : t ∈ Ioo 0 x ⊢ indicator (Ioo 0 x) (fun t => ↑(↑L (f t)) (g (x - t))) t = ↑(↑L (if t ∈ Ioi 0 then f t else 0)) (if x - t ∈ Ioi 0 then g (x - t) else 0) [PROOFSTEP] rw [indicator_of_mem ht, if_pos (mem_Ioi.mpr ht.1), if_pos (mem_Ioi.mpr <| sub_pos.mpr ht.2)] [GOAL] case pos.e_f.h.inr.inr 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedAddCommGroup E' inst✝⁶ : NormedAddCommGroup E'' inst✝⁵ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝⁴ : NormedSpace ℝ E inst✝³ : NormedSpace ℝ E' inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F f : ℝ → E g : ℝ → E' L : E →L[ℝ] E' →L[ℝ] F ν : autoParam (Measure ℝ) _auto✝ inst✝ : NoAtoms ν x : ℝ h : x ∈ Ioi 0 t : ℝ ht : x ≤ t ⊢ indicator (Ioo 0 x) (fun t => ↑(↑L (f t)) (g (x - t))) t = ↑(↑L (if t ∈ Ioi 0 then f t else 0)) (if x - t ∈ Ioi 0 then g (x - t) else 0) [PROOFSTEP] rw [indicator_of_not_mem (not_mem_Ioo_of_ge ht), if_neg (not_mem_Ioi.mpr (sub_nonpos_of_le ht)), ContinuousLinearMap.map_zero] [GOAL] case neg 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedAddCommGroup E' inst✝⁶ : NormedAddCommGroup E'' inst✝⁵ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝⁴ : NormedSpace ℝ E inst✝³ : NormedSpace ℝ E' inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F f : ℝ → E g : ℝ → E' L : E →L[ℝ] E' →L[ℝ] F ν : autoParam (Measure ℝ) _auto✝ inst✝ : NoAtoms ν x : ℝ h : ¬x ∈ Ioi 0 ⊢ 0 = ∫ (t : ℝ), ↑(↑L (if t ∈ Ioi 0 then f t else 0)) (if x - t ∈ Ioi 0 then g (x - t) else 0) ∂ν [PROOFSTEP] convert (integral_zero ℝ F).symm with t [GOAL] case h.e'_3.h.e'_7.h 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedAddCommGroup E' inst✝⁶ : NormedAddCommGroup E'' inst✝⁵ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝⁴ : NormedSpace ℝ E inst✝³ : NormedSpace ℝ E' inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F f : ℝ → E g : ℝ → E' L : E →L[ℝ] E' →L[ℝ] F ν : autoParam (Measure ℝ) _auto✝ inst✝ : NoAtoms ν x : ℝ h : ¬x ∈ Ioi 0 t : ℝ ⊢ ↑(↑L (if t ∈ Ioi 0 then f t else 0)) (if x - t ∈ Ioi 0 then g (x - t) else 0) = 0 [PROOFSTEP] by_cases ht : 0 < t [GOAL] case pos 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedAddCommGroup E' inst✝⁶ : NormedAddCommGroup E'' inst✝⁵ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝⁴ : NormedSpace ℝ E inst✝³ : NormedSpace ℝ E' inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F f : ℝ → E g : ℝ → E' L : E →L[ℝ] E' →L[ℝ] F ν : autoParam (Measure ℝ) _auto✝ inst✝ : NoAtoms ν x : ℝ h : ¬x ∈ Ioi 0 t : ℝ ht : 0 < t ⊢ ↑(↑L (if t ∈ Ioi 0 then f t else 0)) (if x - t ∈ Ioi 0 then g (x - t) else 0) = 0 [PROOFSTEP] rw [if_neg (_ : x - t ∉ Ioi 0), ContinuousLinearMap.map_zero] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedAddCommGroup E' inst✝⁶ : NormedAddCommGroup E'' inst✝⁵ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝⁴ : NormedSpace ℝ E inst✝³ : NormedSpace ℝ E' inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F f : ℝ → E g : ℝ → E' L : E →L[ℝ] E' →L[ℝ] F ν : autoParam (Measure ℝ) _auto✝ inst✝ : NoAtoms ν x : ℝ h : ¬x ∈ Ioi 0 t : ℝ ht : 0 < t ⊢ ¬x - t ∈ Ioi 0 [PROOFSTEP] rw [not_mem_Ioi] at h ⊢ [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedAddCommGroup E' inst✝⁶ : NormedAddCommGroup E'' inst✝⁵ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝⁴ : NormedSpace ℝ E inst✝³ : NormedSpace ℝ E' inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F f : ℝ → E g : ℝ → E' L : E →L[ℝ] E' →L[ℝ] F ν : autoParam (Measure ℝ) _auto✝ inst✝ : NoAtoms ν x : ℝ h : x ≤ 0 t : ℝ ht : 0 < t ⊢ x - t ≤ 0 [PROOFSTEP] exact sub_nonpos.mpr (h.trans ht.le) [GOAL] case neg 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedAddCommGroup E' inst✝⁶ : NormedAddCommGroup E'' inst✝⁵ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝⁴ : NormedSpace ℝ E inst✝³ : NormedSpace ℝ E' inst✝² : NormedSpace ℝ F inst✝¹ : CompleteSpace F f : ℝ → E g : ℝ → E' L : E →L[ℝ] E' →L[ℝ] F ν : autoParam (Measure ℝ) _auto✝ inst✝ : NoAtoms ν x : ℝ h : ¬x ∈ Ioi 0 t : ℝ ht : ¬0 < t ⊢ ↑(↑L (if t ∈ Ioi 0 then f t else 0)) (if x - t ∈ Ioi 0 then g (x - t) else 0) = 0 [PROOFSTEP] rw [if_neg (mem_Ioi.not.mpr ht), ContinuousLinearMap.map_zero, ContinuousLinearMap.zero_apply] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹¹ : NormedAddCommGroup E inst✝¹⁰ : NormedAddCommGroup E' inst✝⁹ : NormedAddCommGroup E'' inst✝⁸ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝⁷ : NormedSpace ℝ E inst✝⁶ : NormedSpace ℝ E' inst✝⁵ : NormedSpace ℝ F inst✝⁴ : CompleteSpace F f : ℝ → E g : ℝ → E' μ ν : Measure ℝ inst✝³ : SigmaFinite μ inst✝² : SigmaFinite ν inst✝¹ : IsAddRightInvariant μ inst✝ : NoAtoms ν hf : IntegrableOn f (Ioi 0) hg : IntegrableOn g (Ioi 0) L : E →L[ℝ] E' →L[ℝ] F ⊢ Integrable (posConvolution f g L) [PROOFSTEP] rw [← integrable_indicator_iff (measurableSet_Ioi : MeasurableSet (Ioi (0 : ℝ)))] at hf hg [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹¹ : NormedAddCommGroup E inst✝¹⁰ : NormedAddCommGroup E' inst✝⁹ : NormedAddCommGroup E'' inst✝⁸ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝⁷ : NormedSpace ℝ E inst✝⁶ : NormedSpace ℝ E' inst✝⁵ : NormedSpace ℝ F inst✝⁴ : CompleteSpace F f : ℝ → E g : ℝ → E' μ ν : Measure ℝ inst✝³ : SigmaFinite μ inst✝² : SigmaFinite ν inst✝¹ : IsAddRightInvariant μ inst✝ : NoAtoms ν hf : Integrable (indicator (Ioi 0) f) hg : Integrable (indicator (Ioi 0) g) L : E →L[ℝ] E' →L[ℝ] F ⊢ Integrable (posConvolution f g L) [PROOFSTEP] rw [posConvolution_eq_convolution_indicator f g L ν] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹¹ : NormedAddCommGroup E inst✝¹⁰ : NormedAddCommGroup E' inst✝⁹ : NormedAddCommGroup E'' inst✝⁸ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝⁷ : NormedSpace ℝ E inst✝⁶ : NormedSpace ℝ E' inst✝⁵ : NormedSpace ℝ F inst✝⁴ : CompleteSpace F f : ℝ → E g : ℝ → E' μ ν : Measure ℝ inst✝³ : SigmaFinite μ inst✝² : SigmaFinite ν inst✝¹ : IsAddRightInvariant μ inst✝ : NoAtoms ν hf : Integrable (indicator (Ioi 0) f) hg : Integrable (indicator (Ioi 0) g) L : E →L[ℝ] E' →L[ℝ] F ⊢ Integrable (convolution (indicator (Ioi 0) f) (indicator (Ioi 0) g) L) [PROOFSTEP] exact (hf.convolution_integrand L hg).integral_prod_left [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝⁹ : NormedSpace ℝ E inst✝⁸ : NormedSpace ℝ E' inst✝⁷ : NormedSpace ℝ F inst✝⁶ : CompleteSpace F inst✝⁵ : CompleteSpace E inst✝⁴ : CompleteSpace E' μ ν : Measure ℝ inst✝³ : SigmaFinite μ inst✝² : SigmaFinite ν inst✝¹ : IsAddRightInvariant μ inst✝ : NoAtoms ν f : ℝ → E g : ℝ → E' hf : IntegrableOn f (Ioi 0) hg : IntegrableOn g (Ioi 0) L : E →L[ℝ] E' →L[ℝ] F ⊢ ∫ (x : ℝ) in Ioi 0, ∫ (t : ℝ) in 0 ..x, ↑(↑L (f t)) (g (x - t)) ∂ν ∂μ = ↑(↑L (∫ (x : ℝ) in Ioi 0, f x ∂ν)) (∫ (x : ℝ) in Ioi 0, g x ∂μ) [PROOFSTEP] rw [← integrable_indicator_iff measurableSet_Ioi] at hf hg [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝⁹ : NormedSpace ℝ E inst✝⁸ : NormedSpace ℝ E' inst✝⁷ : NormedSpace ℝ F inst✝⁶ : CompleteSpace F inst✝⁵ : CompleteSpace E inst✝⁴ : CompleteSpace E' μ ν : Measure ℝ inst✝³ : SigmaFinite μ inst✝² : SigmaFinite ν inst✝¹ : IsAddRightInvariant μ inst✝ : NoAtoms ν f : ℝ → E g : ℝ → E' hf : Integrable (indicator (Ioi 0) f) hg : Integrable (indicator (Ioi 0) g) L : E →L[ℝ] E' →L[ℝ] F ⊢ ∫ (x : ℝ) in Ioi 0, ∫ (t : ℝ) in 0 ..x, ↑(↑L (f t)) (g (x - t)) ∂ν ∂μ = ↑(↑L (∫ (x : ℝ) in Ioi 0, f x ∂ν)) (∫ (x : ℝ) in Ioi 0, g x ∂μ) [PROOFSTEP] simp_rw [← integral_indicator measurableSet_Ioi] [GOAL] 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x x' : G y y' : E inst✝⁹ : NormedSpace ℝ E inst✝⁸ : NormedSpace ℝ E' inst✝⁷ : NormedSpace ℝ F inst✝⁶ : CompleteSpace F inst✝⁵ : CompleteSpace E inst✝⁴ : CompleteSpace E' μ ν : Measure ℝ inst✝³ : SigmaFinite μ inst✝² : SigmaFinite ν inst✝¹ : IsAddRightInvariant μ inst✝ : NoAtoms ν f : ℝ → E g : ℝ → E' hf : Integrable (indicator (Ioi 0) f) hg : Integrable (indicator (Ioi 0) g) L : E →L[ℝ] E' →L[ℝ] F ⊢ ∫ (x : ℝ), indicator (Ioi 0) (fun x => ∫ (t : ℝ) in 0 ..x, ↑(↑L (f t)) (g (x - t)) ∂ν) x ∂μ = ↑(↑L (∫ (x : ℝ), indicator (Ioi 0) (fun x => f x) x ∂ν)) (∫ (x : ℝ), indicator (Ioi 0) (fun x => g x) x ∂μ) [PROOFSTEP] convert integral_convolution L hf hg using 4 with x [GOAL] case h.e'_2.h.e'_7.h.h.e 𝕜 : Type u𝕜 G : Type uG E : Type uE E' : Type uE' E'' : Type uE'' F : Type uF F' : Type uF' F'' : Type uF'' P : Type uP inst✝¹³ : NormedAddCommGroup E inst✝¹² : NormedAddCommGroup E' inst✝¹¹ : NormedAddCommGroup E'' inst✝¹⁰ : NormedAddCommGroup F f✝ f' : G → E g✝ g' : G → E' x✝ x' : G y y' : E inst✝⁹ : NormedSpace ℝ E inst✝⁸ : NormedSpace ℝ E' inst✝⁷ : NormedSpace ℝ F inst✝⁶ : CompleteSpace F inst✝⁵ : CompleteSpace E inst✝⁴ : CompleteSpace E' μ ν : Measure ℝ inst✝³ : SigmaFinite μ inst✝² : SigmaFinite ν inst✝¹ : IsAddRightInvariant μ inst✝ : NoAtoms ν f : ℝ → E g : ℝ → E' hf : Integrable (indicator (Ioi 0) f) hg : Integrable (indicator (Ioi 0) g) L : E →L[ℝ] E' →L[ℝ] F x : ℝ ⊢ (indicator (Ioi 0) fun x => ∫ (t : ℝ) in 0 ..x, ↑(↑L (f t)) (g (x - t)) ∂ν) = convolution (indicator (Ioi 0) f) (indicator (Ioi 0) g) L [PROOFSTEP] apply posConvolution_eq_convolution_indicator
/* test_laplace.cpp * * Copyright Steven Watanabe 2014 * Distributed under the Boost Software License, Version 1.0. (See * accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) * * $Id$ * */ #include <boost/random/laplace_distribution.hpp> #include <boost/random/uniform_real.hpp> #include <boost/math/distributions/laplace.hpp> #define BOOST_RANDOM_DISTRIBUTION boost::random::laplace_distribution<> #define BOOST_RANDOM_DISTRIBUTION_NAME laplace #define BOOST_MATH_DISTRIBUTION boost::math::laplace #define BOOST_RANDOM_ARG1_TYPE double #define BOOST_RANDOM_ARG1_NAME mean #define BOOST_RANDOM_ARG1_DEFAULT 1000.0 #define BOOST_RANDOM_ARG1_DISTRIBUTION(n) boost::uniform_real<>(-n, n) #define BOOST_RANDOM_ARG2_TYPE double #define BOOST_RANDOM_ARG2_NAME beta #define BOOST_RANDOM_ARG2_DEFAULT 1000.0 #define BOOST_RANDOM_ARG2_DISTRIBUTION(n) boost::uniform_real<>(0.00001, n) #include "test_real_distribution.ipp"
```python from datascience import * import sympy solve = lambda x,y: sympy.solve(x-y)[0] if len(sympy.solve(x-y))==1 else "Not Single Solution" import matplotlib.pyplot as plt import numpy as np import pandas as pd import datetime as dt import warnings warnings.simplefilter("ignore") %matplotlib inline ``` # Bertrand Competition Another model we consider is **Bertrand competition**, named for Joseph Louis Francois Bertrand, that is similar to Cournot competition but that firms compete using _prices_ rather than quantity. Under the assumptions of this model, consumers want to buy everything at the lowest price, and if the price is the same then demand is evenly split between those producers. One fundamental assumption is that all firms have the same unit cost of production, which means that as long as the price the firm sets is above the unit cost, it is willing to supply any amount that is demanded. An example of a Bertrand oligopoly comes form the soft drink industry: Coke and Pepsi (which form a **duopoly**, a market with only two participants). Both firms compete by changing their prices based on a function that takes into account the price charged by their competitor. This model predicts that even this small competition will result in prices being reduced to the marginal cost level, the same outcome as perfect competition. ## Bertrand Equilibrium To find the Bertrand equilibrium, let $c$ be the (constant) marginal cost, $p_1$ be firm 1's price level, $p_2$ be firm 2's price level, and $p_m$ be the monopoly price level. Firm 1's price depends on what it believes firm 2 will set its prices to be. Because consumers always buy at the lowest price and the firm will fulfill any level of demand, pricing just below firm 2 will obtain full market demand for firm 1. Why might this not be a good idea? If firm 2 is pricing below the level of marginal cost, then firm 1 will incur losses because they would need to sell at a price lower than the cost of production. Let $p'_1(p_2)$ be firm 1's optimal price based on price $p_2$ set by firm 2. The graph below shows $p'_1(p_2)$. Note that when $p_2 < c$, $p'_1$ is equal to $c$, that $p'_1$ rises linearly along but _just below_ the line $p_1 = p_2$ with $p_2$ until $p_2$ reaches $p_m$ (the monopoly price level), and that it then levels off at $p_m$. In this way, firm 1's price stays below firm 2's price when it is not operating at a loss and does not exceed $p_m$ (because $p_m$ is the profit-maximizing amount for a monopoly and producing more actually results in less profit). This piecewise function has the formula $$ p'_1(p_2) = \begin{cases} c & \text{if } p_2 < c + h \\ p_2 - h & \text{if } c + h \le p_2 < p_m + h \\ p_m & \text{otherwise} \end{cases} $$ where $h$ is a small positive value and indicates the vertical distance between $p'_1$ and the line $p_1 = p_2$. We can think of $h$ as the amount by which firm 1 will undercut firm 2: as long as firm 1 will be operating at a profit and not exceeding $p_m$, they will sell at $h$ dollars below $p_2$. ```python p_m = 18 c = 6 dist = 0.4 # the distance from p_1 = p_2 to p'_1(p_2) xs1 = np.linspace(0, c, 100) ys1 = c * np.ones_like(xs1) xs2 = np.linspace(c + dist, p_m + dist, 100) ys2 = xs2.copy() - dist xs3 = np.linspace(p_m + dist, 25, 100) ys3 = p_m * np.ones_like(xs3) xs = np.append(np.append(xs1, xs2), xs3) ys = np.append(np.append(ys1, ys2), ys3) plt.figure(figsize=[8,8]) plt.plot(xs, ys, label=r"$p'_1(p_2)$") y_equals_x_xs = np.linspace(0, 25, 100) y_equals_x_ys = y_equals_x_xs.copy() plt.plot(y_equals_x_xs, y_equals_x_ys, label=r"$p_1 = p_2$") plt.vlines(c, 0, c, linestyle="dashed") plt.vlines(p_m, 0, p_m, linestyle="dashed") plt.hlines(p_m, 0, p_m, linestyle="dashed") plt.text(2, 6.5, r"$p'_1(p_2)$", size=16) plt.text(17, 20, r"$p_1 = p_2$", size=16) plt.xlim([0,22]) plt.ylim([0,22]) plt.xlabel(r"$p_2$", size=16) plt.ylabel(r"$p_1$", size=16) plt.xticks([c, p_m], [r"$c$", r"$p_m$"], size=14) plt.yticks([c, p_m], [r"$c$", r"$p_m$"], size=14) plt.legend(); ``` Because firm 2 has the same marginal cost $c$ as firm 1, its reaction function $p'_2(p_1)$ is symmetrical to firm 1's about the line $p_1 = p_2$: ```python p_m = 18 c = 6 dist = 0.4 # the distance from p_1 = p_2 to p'_1(p_2) xs1 = np.linspace(0, c, 100) ys1 = c * np.ones_like(xs1) xs2 = np.linspace(c + dist, p_m + dist, 100) ys2 = xs2.copy() - dist xs3 = np.linspace(p_m + dist, 25, 100) ys3 = p_m * np.ones_like(xs3) xs_1 = np.append(np.append(xs1, xs2), xs3) ys_1 = np.append(np.append(ys1, ys2), ys3) ys1 = np.linspace(0, c, 100) xs1 = c * np.ones_like(xs1) ys2 = np.linspace(c + dist, p_m + dist, 100) xs2 = xs2.copy() - dist ys3 = np.linspace(p_m + dist, 25, 100) xs3 = p_m * np.ones_like(xs3) xs_2 = np.append(np.append(xs1, xs2), xs3) ys_2 = np.append(np.append(ys1, ys2), ys3) plt.figure(figsize=[8,8]) plt.plot(xs_1, ys_1, label=r"$p'_1(p_2)$") plt.plot(xs_2, ys_2, label=r"$p'_2(p_1)$") y_equals_x_xs = np.linspace(0, 25, 100) y_equals_x_ys = y_equals_x_xs.copy() plt.plot(y_equals_x_xs, y_equals_x_ys, label=r"$p_1 = p_2$") plt.vlines(p_m, 0, p_m, linestyle="dashed") plt.hlines(p_m, 0, p_m, linestyle="dashed") plt.text(2, 6.5, r"$p'_1(p_2)$", size=16) plt.text(6.5, 2, r"$p'_2(p_1)$", size=16) plt.text(18.2, 21, r"$p_1 = p_2$", size=16) plt.xlim([0,22]) plt.ylim([0,22]) plt.xlabel(r"$p_2$", size=16) plt.ylabel(r"$p_1$", size=16) plt.xticks([c, p_m], [r"$c$", r"$p_m$"], size=14) plt.yticks([c, p_m], [r"$c$", r"$p_m$"], size=14) plt.legend(); ``` These two strategies form a Nash equilibrium because neither firm can increase profits by changing their own strategy unilaterally. The equilibrium occurs where $p_1 = p'_1(p_2)$ and $p_2 = p'_2(p_1)$, at the intersection of the two reaction curves. Notably, this means that the Bertrand equilibrium occurs when both firms are producing _at marginal cost_. This makes intuitive sense: say that the two firms both set equal prices at a price above $c$ where they split demand equally. Then both firms have incentive to reduce their price slightly and take the other half of the market share from their competitor. Thus, both firms are tempted to lower prices as much as possible, but lowering below the level of marginal cost makes no sense because then they're operating at a loss. Thus, both firms sell at the price level $c$. ## Implications The Bertrand model implies that even a duopoly in a market is enough to push prices down to the level of perfect competition. It does, however, rely on some serious assumptions. For example, there are many reasons why consumers might not buy the lowest-priced item (e.g. non-price competition, search costs). When these factors are included in the Bertrand model, the same result is no longer reached. It also ignores the fact that firms may not be able to supply the entire market demand; including these capacity constraints in the model can result in the system having no Nash equilibrium. Lastly, the Bertrand model demonstrates big incentives to cooperate and raise prices to the monopoly level; however, this state is not a Nash equilibrium, and in fact, the only Nash equilibrium of this model is the non-cooperative one with prices at marginal cost. ## Applying Bertrand Now that we have derived the Bertrand equilibrium, let's apply it to a problem. Consider the Coke-Pepsi duopoly we mentioned above. Suppose that the only product in the soft-drink market is the 12-oz. can, that the market demand for cans is given by $P = -0.05 Q + 5.05$, and that the marginal cost for Coke and Pepsi is constant at $c = 0.25$. To find the equilibrium price for Coke based in it's belief that Pepsi will sell at $p_2 = 1$, we need to start by finding the monopoly price level $p_m$; recall from Cournot that this occurs when the marginal revenue curve of the market demand intersects the marginal cost. The marginal revenue is $r(q) = -0.1 q + 5.05$: ```python P_fn = lambda x: -0.05 * x + 5.05 r_fn = lambda x: 2 * P_fn(x) - P_fn(0) Qs = np.linspace(-10, 1000, 1000) Ps = P_fn(Qs) rs = r_fn(Qs) plt.figure(figsize=[7,7]) plt.plot(Qs, Ps, label=r"$P(Q)$") plt.plot(Qs, rs, label=r"$r(Q)$") plt.hlines(.25, -10, 150, color="r", label=r"$c$") plt.xlim([0, 110]) plt.ylim([0, 5.5]) plt.xlabel(r"Quantity $Q$", size=16) plt.ylabel(r"Price $P$", size=16) plt.legend(); ``` Using SymPy, we can find the quantity $q$ at which $r(q) = c$. This value, denoted $q_m$, is the monopoly quantity. ```python c = 0.25 q = sympy.Symbol("q") r = -.1 * q + 5.05 q_m = solve(r, c) q_m ``` 48.0000000000000 The monopoly price $p_m$ is the price from the market demand curve that this level of output: ```python Q = sympy.Symbol("Q") P = -.05 * Q + 5.05 p_m = P.subs(Q, q_m) p_m ``` 2.65000000000000 Now that we have found $p_m$, we can use this to construct Coke's reaction function $p'_1(p_2)$ to Pepsi's choice of price. Assuming Coke selects $h=0.1$ (that is, Coke will sell at \$0.10 below Pepsi as long as they operate at a profit), the formula for $p'_1$ is $$ p'_1(p_2) = \begin{cases} 0.25 & \text{if } p_2 < 0.25 + 0.1 \\ p_2 - 0.1 & \text{if } 0.25 + 0.1 \le p_2 < 2.65 + 0.1 \\ 2.65 & \text{otherwise} \end{cases} $$ ```python c = 0.25 def p1_fn(p_2, h): if p_2 < c + h: return c elif c + h <= p_2 < p_m + h: return p_2 - h else: return p_m p1_fn = np.vectorize(p1_fn) xs = np.linspace(-1, 4, 1000) ys = xs.copy() p1s = p1_fn(xs, .1) plt.figure(figsize=[7,7]) plt.plot(xs, p1s, label=r"$p'_1(p_2)$") plt.plot(xs, ys, label=r"$p_1 = p_2$") plt.hlines(c, 0, 5, color="r", label=r"$c$") plt.vlines(c, 0, 5, color="r") plt.hlines(p_m, 0, 5, color="g", label=r"$p_m$") plt.vlines(p_m, 0, 5, color="g") plt.xlim([0,3]) plt.ylim([0,3]) plt.xlabel(r"$p_2$", size=16) plt.ylabel(r"$p_1$", size=16) plt.legend(); ``` Finally, to find Coke's selling price, we find $p'_1(1)$, since Coke believes Pepsi will sell at \$1. ```python c = 0.25 h = 0.1 p_2 = sympy.Symbol("p_2") p_1_prime = sympy.Piecewise( (c, p_2 < c + h), (p_2 - h, p_2 < p_m + h), (p_m, True) ) p_1_prime.subs(p_2, 1) ``` 0.900000000000000 Thus, if Coke believes that Pepsi will sell cans at \$1, it should sell at \$0.90. This should make intuitive sense: we showed that $p'_1(p_2)$ was below the line $p_1=p_2$ by a vertical distance of $h=0.1$, so it makes sense that Coke would sell at \$0.10 below Pepsi. If Coke had believed that Pepsi was going to sell at, say, \$2.70, then it would have been better for them to sell at the monopoly price level $p_m = 2.65$. If Pepsi was selling below margin cost, at \$0.20 maybe, then Coke's best bet would have been to sell at $c = 0.25$, although they would have sold 0 units of output because consumers buy from the lowest-priced vendor.
Two songs taken from the album ( " Mandatory Suicide " and " South of Heaven " ) have become near constant fixtures in the band 's live setlist , notching up appearances on the following : the live DVDs Live Intrusion , War at the Warfield , Still Reigning , Soundtrack to the Apocalypse 's deluxe edition 's bonus live disc , and the live double album Decade of Aggression . Lombardo guested with Finnish cellist group Apocalyptica on a live medley of the two tracks at 1998 's Headbanger 's Heaven festival in the Netherlands . Adrien Begrand of PopMatters described " South of Heaven " as " an unorthodox set opener in theory " , noting " the song went over like a megaton bomb detonating the place : dozens of inverted crosses projected behind the high drum riser , the sinewy opening notes kicked in , followed by an overture of bass , cymbal crashes , and tom fills , leading up to the slowly building crescendo " in a concert review . Lombardo remembers listening to a live rendition of " South of Heaven " and thinking " ‘ Man ! There 's just so much groove in that song . ’ To my kids I was saying , ‘ Listen to that ! Listen to how groovy that is ! ’ And it 's heavy . " A rare live version of the track featured on the <unk> Rarities 2004 promotional CD , given away to attendees at the Spring 2004 Jägermeister Music Tour . A live rendition of " South of Heaven " was also included on a bonus DVD which came with the group 's 2007 re @-@ release of ninth studio album Christ Illusion , shot in Vancouver , British Columbia during 2006 's Unholy Alliance tour .
From hahn Require Import Hahn. Require Import AuxDef. Require Import Events. Require Import Execution. Require Import Execution_eco. Require Import imm_bob imm_s_ppo. Require Import imm_s_hb. Require Import imm_s. Require Import TraversalConfig. Set Implicit Arguments. Remove Hints plus_n_O. Section TCCOH_ALT. Variable G : execution. Variable sc : relation actid. Notation "'acts'" := G.(acts). Notation "'sb'" := G.(sb). Notation "'rmw'" := G.(rmw). Notation "'data'" := G.(data). Notation "'addr'" := G.(addr). Notation "'ctrl'" := G.(ctrl). Notation "'rf'" := G.(rf). Notation "'co'" := G.(co). Notation "'coe'" := G.(coe). Notation "'fr'" := G.(fr). Notation "'eco'" := G.(eco). Notation "'bob'" := G.(bob). Notation "'fwbob'" := G.(fwbob). Notation "'ppo'" := G.(ppo). Notation "'ar'" := (ar G sc). Notation "'fre'" := G.(fre). Notation "'rfi'" := G.(rfi). Notation "'rfe'" := G.(rfe). Notation "'deps'" := G.(deps). Notation "'detour'" := G.(detour). Notation "'release'" := G.(release). Notation "'sw'" := G.(sw). Notation "'hb'" := G.(hb). Notation "'lab'" := G.(lab). Notation "'loc'" := (loc lab). Notation "'val'" := (val lab). Notation "'mod'" := (Events.mod lab). Notation "'same_loc'" := (same_loc lab). Notation "'E'" := G.(acts_set). Notation "'R'" := (fun x => is_true (is_r lab x)). Notation "'W'" := (fun x => is_true (is_w lab x)). Notation "'F'" := (fun x => is_true (is_f lab x)). Notation "'RW'" := (R ∪₁ W). Notation "'FR'" := (F ∪₁ R). Notation "'FW'" := (F ∪₁ W). Notation "'R_ex'" := (fun a => is_true (R_ex lab a)). Notation "'W_ex'" := (W_ex G). Notation "'W_ex_acq'" := (W_ex ∩₁ (fun a => is_true (is_xacq lab a))). Notation "'Init'" := (fun a => is_true (is_init a)). Notation "'Loc_' l" := (fun x => loc x = Some l) (at level 1). Notation "'Tid_' t" := (fun x => tid x = t) (at level 1). Notation "'W_' l" := (W ∩₁ Loc_ l) (at level 1). Notation "'Pln'" := (fun x => is_true (is_only_pln lab x)). Notation "'Rlx'" := (fun x => is_true (is_rlx lab x)). Notation "'Rel'" := (fun x => is_true (is_rel lab x)). Notation "'Acq'" := (fun x => is_true (is_acq lab x)). Notation "'Acqrel'" := (fun x => is_true (is_acqrel lab x)). Notation "'Sc'" := (fun x => is_true (is_sc lab x)). Notation "'Acq/Rel'" := (fun a => is_true (is_ra lab a)). Implicit Type WF : Wf G. Implicit Type WF_SC : wf_sc G sc. Record tc_coherent_alt T := { tc_init : Init ∩₁ E ⊆₁ covered T ; tc_C_in_E : covered T ⊆₁ E ; tc_sb_C : dom_rel ( sb ⨾ ⦗covered T⦘) ⊆₁ covered T ; tc_W_C_in_I : covered T ∩₁ W ⊆₁ issued T ; tc_rf_C : dom_rel ( rf ⨾ ⦗covered T⦘) ⊆₁ issued T ; tc_sc_C : dom_rel ( sc ⨾ ⦗covered T⦘) ⊆₁ covered T ; tc_I_in_E : issued T ⊆₁ E ; tc_I_in_W : issued T ⊆₁ W ; tc_fwbob_I : dom_rel ( fwbob ⨾ ⦗issued T⦘) ⊆₁ covered T ; tc_I_ar_rf_ppo_loc_I : dom_rel (⦗W⦘ ⨾ (ar ∪ rf ⨾ ppo ∩ same_loc)⁺ ⨾ ⦗issued T⦘) ⊆₁ issued T; }. Lemma tc_I_ar_rfrmw_I WF T (TCCOH : tc_coherent_alt T) : dom_rel (⦗W⦘ ⨾ (ar ∪ rf ⨾ rmw)⁺ ⨾ ⦗issued T⦘) ⊆₁ issued T. Proof using. rewrite WF.(rmw_in_ppo_loc). apply TCCOH. Qed. Lemma tc_I_ar_I WF T (TCCOH : tc_coherent_alt T) : dom_rel (⦗W⦘ ⨾ ar⁺ ⨾ ⦗issued T⦘) ⊆₁ issued T. Proof using. arewrite (ar ⊆ ar ∪ rf ⨾ ppo ∩ same_loc). apply TCCOH. Qed. Lemma tc_dr_pb_I WF T (TCCOH : tc_coherent_alt T) : dom_rel ( (detour ∪ rfe) ⨾ (ppo ∪ bob) ⨾ ⦗issued T⦘) ⊆₁ issued T. Proof using. rewrite (dom_l WF.(wf_detourD)). rewrite (dom_l WF.(wf_rfeD)). arewrite (detour ⊆ ar). arewrite (rfe ⊆ ar). rewrite ppo_in_ar, bob_in_ar. rewrite !unionK, !seqA. sin_rewrite ar_ar_in_ar_ct. by apply tc_I_ar_I. Qed. Lemma tc_coherent_alt_implies_tc_coherent T: tc_coherent_alt T -> tc_coherent G sc T. Proof using. intro H; destruct H. red; splits; eauto. 2: { unfold issuable. repeat (splits; try apply set_subset_inter_r); ins. { by eapply dom_rel_to_cond. } by eapply dom_rel_to_cond; rewrite !seqA. } unfold coverable. repeat (splits; try apply set_subset_inter_r); ins. { by eapply dom_rel_to_cond. } arewrite (covered T ⊆₁ covered T ∩₁ E). revert tc_C_in_E0; basic_solver. arewrite (E ⊆₁ R ∪₁ W ∪₁ F). unfolder; intro a; forward (apply (lab_rwf lab a)); tauto. rewrite !set_inter_union_r; unionL. { unionR left -> right. repeat (splits; try apply set_subset_inter_r); ins. basic_solver. eapply dom_rel_to_cond. revert tc_rf_C0; basic_solver 21. } { unionR left -> left. repeat (splits; try apply set_subset_inter_r); ins. basic_solver. } unionR right. repeat (splits; try apply set_subset_inter_r); ins. basic_solver. eapply dom_rel_to_cond. revert tc_sc_C0; basic_solver 21. Qed. Lemma tc_coherent_implies_tc_coherent_alt WF WF_SC T: tc_coherent G sc T -> tc_coherent_alt T. Proof using. intro H; red in H; desf. unfold coverable, issuable in *. apply set_subset_inter_r in CC; desf. apply set_subset_inter_r in CC; desf. apply set_subset_inter_r in II; desf. apply set_subset_inter_r in II; desf. apply set_subset_inter_r in II; desf. constructor; try done. { by apply dom_cond_to_rel. } { rewrite CC0. type_solver. } { rewrite CC0, !id_union; relsf; unionL; splits. { rewrite (dom_r (wf_rfD WF)); type_solver. } { apply dom_cond_to_rel; basic_solver 10. } rewrite (dom_r (wf_rfD WF)); type_solver. } { rewrite CC0 at 1; rewrite !id_union; relsf; unionL; splits. { rewrite (dom_r (wf_scD WF_SC)); type_solver. } { rewrite (dom_r (wf_scD WF_SC)); type_solver. } apply dom_cond_to_rel; basic_solver 10. } { by apply dom_cond_to_rel. } by rewrite <- seqA; apply dom_cond_to_rel. Qed. Lemma tc_W_ex_sb_I WF T (TCCOH : tc_coherent_alt T) : dom_rel (⦗W_ex_acq⦘ ⨾ sb ⨾ ⦗issued T⦘) ⊆₁ issued T. Proof using. assert (tc_coherent G sc T) as TCCOH'. { by apply tc_coherent_alt_implies_tc_coherent. } arewrite (⦗issued T⦘ ⊆ ⦗W⦘ ⨾ ⦗issued T⦘). { rewrite <- seq_eqvK at 1. rewrite issuedW at 1; edone. } arewrite (⦗W_ex_acq⦘ ⊆ ⦗W⦘ ⨾ ⦗W_ex_acq⦘). { rewrite <- seq_eqvK at 1. rewrite W_ex_acq_in_W at 1; done. } arewrite (⦗W_ex_acq⦘ ⨾ sb ⨾ ⦗W⦘ ⊆ ar). apply ar_I_in_I; auto. Qed. Lemma scCsbI_C WF T (IMMCON : imm_consistent G sc) (TCCOH : tc_coherent G sc T) : sc ⨾ ⦗covered T ∪₁ dom_rel (sb^? ⨾ ⦗issued T⦘)⦘ ⊆ ⦗covered T⦘ ⨾ sc. Proof using. rewrite id_union. rewrite seq_union_r. unionL. { eapply sc_covered; eauto. } unfolder. ins. desf. all: eapply wf_scD in H; [|by apply IMMCON]. all: destruct_seq H as [XX YY]. { eapply issuedW in H2; eauto. type_solver. } split; auto. assert (covered T y) as CY. 2: { eapply dom_sc_covered; eauto. eexists. apply seq_eqv_r. split; eauto. } eapply tc_fwbob_I. { apply tc_coherent_implies_tc_coherent_alt; eauto. apply IMMCON. } eexists. apply seq_eqv_r. split; eauto. eapply sb_from_f_in_fwbob. apply seq_eqv_l. split; auto. mode_solver. Qed. End TCCOH_ALT.
\chapter{{\tt BKL}: Block Kernighan-Lin Object} \label{chapter:BKL} \par Our {\tt BKL} object is used to find an initial separator of a graph. Its input is a {\tt BPG} bipartite graph object that represents the domain-segment graph of a domain decomposition of the graph. After a call to the {\tt BKL\_fidmat()} method, the object contains a two-color partition of the graph that is accessible via the {\tt colors[]} and {\tt cweights[]} vectors of the object.
The modulus of a complex number is less than or equal to the sum of the absolute values of its real and imaginary parts.
Summer Songs with Music ; Blackie , 1926
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov, Johannes Hölzl -/ import order.conditionally_complete_lattice import logic.function.iterate import order.rel_iso /-! # Order continuity We say that a function is *left order continuous* if it sends all least upper bounds to least upper bounds. The order dual notion is called *right order continuity*. For monotone functions `ℝ → ℝ` these notions correspond to the usual left and right continuity. We prove some basic lemmas (`map_sup`, `map_Sup` etc) and prove that an `rel_iso` is both left and right order continuous. -/ universes u v w x variables {α : Type u} {β : Type v} {γ : Type w} {ι : Sort x} open set function /-! ### Definitions -/ /-- A function `f` between preorders is left order continuous if it preserves all suprema. We define it using `is_lub` instead of `Sup` so that the proof works both for complete lattices and conditionally complete lattices. -/ def left_ord_continuous [preorder α] [preorder β] (f : α → β) := ∀ ⦃s : set α⦄ ⦃x⦄, is_lub s x → is_lub (f '' s) (f x) /-- A function `f` between preorders is right order continuous if it preserves all infima. We define it using `is_glb` instead of `Inf` so that the proof works both for complete lattices and conditionally complete lattices. -/ def right_ord_continuous [preorder α] [preorder β] (f : α → β) := ∀ ⦃s : set α⦄ ⦃x⦄, is_glb s x → is_glb (f '' s) (f x) namespace left_ord_continuous section preorder variables (α) [preorder α] [preorder β] [preorder γ] {g : β → γ} {f : α → β} protected lemma id : left_ord_continuous (id : α → α) := λ s x h, by simpa only [image_id] using h variable {α} protected lemma order_dual (hf : left_ord_continuous f) : @right_ord_continuous (order_dual α) (order_dual β) _ _ f := hf lemma map_is_greatest (hf : left_ord_continuous f) {s : set α} {x : α} (h : is_greatest s x): is_greatest (f '' s) (f x) := ⟨mem_image_of_mem f h.1, (hf h.is_lub).1⟩ lemma comp (hg : left_ord_continuous g) (hf : left_ord_continuous f) : left_ord_continuous (g ∘ f) := λ s x h, by simpa only [image_image] using hg (hf h) protected lemma iterate {f : α → α} (hf : left_ord_continuous f) (n : ℕ) : left_ord_continuous (f^[n]) := nat.rec_on n (left_ord_continuous.id α) $ λ n ihn, ihn.comp hf end preorder section semilattice_sup variables [semilattice_sup α] [semilattice_sup β] {f : α → β} lemma map_sup (hf : left_ord_continuous f) (x y : α) : f (x ⊔ y) = f x ⊔ f y := (hf is_lub_pair).unique $ by simp only [image_pair, is_lub_pair] lemma le_iff (hf : left_ord_continuous f) (h : injective f) {x y} : f x ≤ f y ↔ x ≤ y := by simp only [← sup_eq_right, ← hf.map_sup, h.eq_iff] lemma lt_iff (hf : left_ord_continuous f) (h : injective f) {x y} : f x < f y ↔ x < y := by simp only [lt_iff_le_not_le, hf.le_iff h] variable (f) /-- Convert an injective left order continuous function to an order embedding. -/ def to_order_embedding (hf : left_ord_continuous f) (h : injective f) : α ↪o β := ⟨⟨f, h⟩, λ x y, hf.le_iff h⟩ variable {f} @[simp] lemma coe_to_order_embedding (hf : left_ord_continuous f) (h : injective f) : ⇑(hf.to_order_embedding f h) = f := rfl end semilattice_sup section complete_lattice variables [complete_lattice α] [complete_lattice β] {f : α → β} lemma map_Sup' (hf : left_ord_continuous f) (s : set α) : f (Sup s) = Sup (f '' s) := (hf $ is_lub_Sup s).Sup_eq.symm lemma map_Sup (hf : left_ord_continuous f) (s : set α) : f (Sup s) = ⨆ x ∈ s, f x := by rw [hf.map_Sup', Sup_image] lemma map_supr (hf : left_ord_continuous f) (g : ι → α) : f (⨆ i, g i) = ⨆ i, f (g i) := by simp only [supr, hf.map_Sup', ← range_comp] end complete_lattice section conditionally_complete_lattice variables [conditionally_complete_lattice α] [conditionally_complete_lattice β] [nonempty ι] {f : α → β} lemma map_cSup (hf : left_ord_continuous f) {s : set α} (sne : s.nonempty) (sbdd : bdd_above s) : f (Sup s) = Sup (f '' s) := ((hf $ is_lub_cSup sne sbdd).cSup_eq $ sne.image f).symm lemma map_csupr (hf : left_ord_continuous f) {g : ι → α} (hg : bdd_above (range g)) : f (⨆ i, g i) = ⨆ i, f (g i) := by simp only [supr, hf.map_cSup (range_nonempty _) hg, ← range_comp] end conditionally_complete_lattice end left_ord_continuous namespace right_ord_continuous section preorder variables (α) [preorder α] [preorder β] [preorder γ] {g : β → γ} {f : α → β} protected lemma id : right_ord_continuous (id : α → α) := λ s x h, by simpa only [image_id] using h variable {α} protected lemma order_dual (hf : right_ord_continuous f) : @left_ord_continuous (order_dual α) (order_dual β) _ _ f := hf lemma map_is_least (hf : right_ord_continuous f) {s : set α} {x : α} (h : is_least s x): is_least (f '' s) (f x) := hf.order_dual.map_is_greatest h lemma mono (hf : right_ord_continuous f) : monotone f := hf.order_dual.mono.order_dual lemma comp (hg : right_ord_continuous g) (hf : right_ord_continuous f) : right_ord_continuous (g ∘ f) := hg.order_dual.comp hf.order_dual protected lemma iterate {f : α → α} (hf : right_ord_continuous f) (n : ℕ) : right_ord_continuous (f^[n]) := hf.order_dual.iterate n end preorder section semilattice_inf variables [semilattice_inf α] [semilattice_inf β] {f : α → β} lemma map_inf (hf : right_ord_continuous f) (x y : α) : f (x ⊓ y) = f x ⊓ f y := hf.order_dual.map_sup x y lemma le_iff (hf : right_ord_continuous f) (h : injective f) {x y} : f x ≤ f y ↔ x ≤ y := hf.order_dual.le_iff h lemma lt_iff (hf : right_ord_continuous f) (h : injective f) {x y} : f x < f y ↔ x < y := hf.order_dual.lt_iff h variable (f) /-- Convert an injective left order continuous function to a `order_embedding`. -/ def to_order_embedding (hf : right_ord_continuous f) (h : injective f) : α ↪o β := ⟨⟨f, h⟩, λ x y, hf.le_iff h⟩ variable {f} @[simp] lemma coe_to_order_embedding (hf : right_ord_continuous f) (h : injective f) : ⇑(hf.to_order_embedding f h) = f := rfl end semilattice_inf section complete_lattice variables [complete_lattice α] [complete_lattice β] {f : α → β} lemma map_Inf' (hf : right_ord_continuous f) (s : set α) : f (Inf s) = Inf (f '' s) := hf.order_dual.map_Sup' s lemma map_Inf (hf : right_ord_continuous f) (s : set α) : f (Inf s) = ⨅ x ∈ s, f x := hf.order_dual.map_Sup s lemma map_infi (hf : right_ord_continuous f) (g : ι → α) : f (⨅ i, g i) = ⨅ i, f (g i) := hf.order_dual.map_supr g end complete_lattice section conditionally_complete_lattice variables [conditionally_complete_lattice α] [conditionally_complete_lattice β] [nonempty ι] {f : α → β} lemma map_cInf (hf : right_ord_continuous f) {s : set α} (sne : s.nonempty) (sbdd : bdd_below s) : f (Inf s) = Inf (f '' s) := hf.order_dual.map_cSup sne sbdd lemma map_cinfi (hf : right_ord_continuous f) {g : ι → α} (hg : bdd_below (range g)) : f (⨅ i, g i) = ⨅ i, f (g i) := hf.order_dual.map_csupr hg end conditionally_complete_lattice end right_ord_continuous namespace order_iso section preorder variables [preorder α] [preorder β] (e : α ≃o β) {s : set α} {x : α} protected lemma left_ord_continuous : left_ord_continuous e := λ s x hx, ⟨monotone.mem_upper_bounds_image (λ x y, e.map_rel_iff.2) hx.1, λ y hy, e.rel_symm_apply.1 $ (is_lub_le_iff hx).2 $ λ x' hx', e.rel_symm_apply.2 $ hy $ mem_image_of_mem _ hx'⟩ protected lemma right_ord_continuous : right_ord_continuous e := order_iso.left_ord_continuous e.dual end preorder end order_iso
// Import a generic GeoTIFF (a projected GeoTIFF flavor), including // projection data from its metadata file (ERDAS MIF HFA .aux file) into // our own ASF Tools format (.img, .meta) // // NOTE: // 1. At this time, only supports Albers Equal Area Conic, Lambert Azimuthal // Equal Area, Lambert Conformal Conic, Polar Stereographic, and UTM // 2. There may be some data duplication between the GeoTIFF tag contents // in the TIFF file and the data contents of the metadata (.aux) file. // 3. Data and parameters found in the metadata (.aux) file supercede the // data and parameter values found in the TIFF file // #include <assert.h> #include <ctype.h> #include <stdarg.h> #include "float_image.h" #include "asf_tiff.h" #include <gsl/gsl_math.h> #include <uint8_image.h> #include <spheroids.h> #include <proj.h> #include <libasf_proj.h> #include "asf.h" #include "asf_meta.h" #include "asf_nan.h" #include "asf_import.h" #include "asf_raster.h" #include "asf_tiff.h" #include "geo_tiffp.h" #include "geo_keyp.h" #include "projected_image_import.h" #include "tiff_to_float_image.h" #include "tiff_to_byte_image.h" #include "write_meta_and_img.h" #include "import_generic_geotiff.h" #include "arcgis_geotiff_support.h" #include "geotiff_support.h" #define BAD_VALUE_SCAN_ON #define FLOAT_COMPARE_TOLERANCE(a, b, t) (fabs (a - b) <= t ? 1: 0) #define IMPORT_GENERIC_FLOAT_MICRON 0.000000001 #ifdef FLOAT_EQUIVALENT #undef FLOAT_EQUIVALENT #endif #define FLOAT_EQUIVALENT(a, b) (FLOAT_COMPARE_TOLERANCE \ (a, b, IMPORT_GENERIC_FLOAT_MICRON)) #define FLOAT_TOLERANCE 0.00001 #define DEFAULT_UTM_SCALE_FACTOR 0.9996 #define DEFAULT_SCALE_FACTOR 1.0 #define UNKNOWN_PROJECTION_TYPE -1 #define NAD27_DATUM_STR "NAD27" #define NAD83_DATUM_STR "NAD83" #define HARN_DATUM_STR "HARN" #define WGS84_DATUM_STR "WGS84" #define HUGHES_DATUM_STR "HUGHES" #define USER_DEFINED_PCS 32767 #define USER_DEFINED_KEY 32767 #define BAND_NAME_LENGTH 12 #define TIFFTAG_GDAL_NODATA 42113 #ifdef USHORT_MAX #undef USHORT_MAX #endif #define USHORT_MAX 65535 #ifdef MAX_RGB #undef MAX_RGB #endif #define MAX_RGB 255 // Do not change the BAND_ID_STRING. It will break ingest of legacy TIFFs exported with this // string in their citation strings. If you are changing the citation string to have some _other_ // identifying string, then use a _new_ definition rather than replace what is in this one. // Then, make sure that your code supports both the legacy string and the new string. // Also see the export library string definitions (which MUST match these here) and // for associated code that needs to reflect the changes you are making here. #define BAND_ID_STRING "Color Channel (Band) Contents in RGBA+ order" spheroid_type_t SpheroidName2spheroid(char *sphereName); void check_projection_parameters(meta_projection *mp); int band_float_image_write(FloatImage *oim, meta_parameters *meta_out, const char *outBaseName, int num_bands, int *ignore); int band_byte_image_write(UInt8Image *oim_b, meta_parameters *meta_out, const char *outBaseName, int num_bands, int *ignore); int check_for_vintage_asf_utm_geotiff(const char *citation, int *geotiff_data_exists, short *model_type, short *raster_type, short *linear_units); int check_for_datum_in_string(const char *citation, datum_type_t *datum); int check_for_ellipse_definition_in_geotiff(GTIF *input_gtif, spheroid_type_t *spheroid); int vintage_utm_citation_to_pcs(const char *citation, int *zone, char *hem, datum_type_t *datum, short *pcs); static int UTM_2_PCS(short *pcs, datum_type_t datum, unsigned long zone, char hem); void classify_geotiff(GTIF *input_gtif, short *model_type, short *raster_type, short *linear_units, short *angular_units, int *geographic_geotiff, int *geocentric_geotiff, int *map_projected_geotiff, int *geotiff_data_exists); char *angular_units_to_string(short angular_units); char *linear_units_to_string(short linear_units); void get_look_up_table_name(char *citation, char **look_up_table); // Import an ERDAS ArcGIS GeoTIFF (a projected GeoTIFF flavor), including // projection data from its metadata file (ERDAS MIF HFA .aux file) into // our own ASF Tools format (.img, .meta) // void import_generic_geotiff (const char *inFileName, const char *outBaseName, ...) { TIFF *input_tiff; meta_parameters *meta; data_type_t data_type; int is_scanline_format; int is_palette_color_tiff; short num_bands; short int bits_per_sample, sample_format, planar_config; va_list ap; char image_data_type[256]; char *pTmpChar; int ignore[MAX_BANDS]; // Array of band flags ...'1' if a band is to be ignored (empty band) // Do NOT allocate less than MAX_BANDS bands since other tools will // receive the 'ignore' array and may assume there are MAX_BANDS in // the array, e.g. read_tiff_meta() in the asf_view tool. // Open the input tiff file. TIFFErrorHandler oldHandler; oldHandler = TIFFSetWarningHandler(NULL); input_tiff = XTIFFOpen (inFileName, "r"); if (input_tiff == NULL) asfPrintError ("Error opening input TIFF file:\n %s\n", inFileName); if (get_tiff_data_config(input_tiff, &sample_format, // TIFF type (uint == 1, int == 2, float == 3) &bits_per_sample, // 8, 16, or 32 &planar_config, // Contiguous == 1 (RGB or RGBA) or separate == 2 (separate bands) &data_type, // ASF datatype, (BYTE, INTEGER16, INTEGER32, or REAL32 ...no complex) &num_bands, // Initial number of bands &is_scanline_format, &is_palette_color_tiff, REPORT_LEVEL_WARNING)) { // Failed to determine tiff info or tiff info was bad char msg[1024]; tiff_type_t t; get_tiff_type(input_tiff, &t); sprintf(msg, "FOUND TIFF tag data as follows:\n" " Sample Format: %s\n" " Bits per Sample: %d\n" " Planar Configuration: %s\n" " Number of Bands: %d\n" " Format: %s\n" " Colormap: %s\n", (sample_format == SAMPLEFORMAT_UINT) ? "Unsigned Integer" : (sample_format == SAMPLEFORMAT_INT) ? "Signed Integer" : (sample_format == SAMPLEFORMAT_IEEEFP) ? "Floating Point" : "Unknown or Unsupported", bits_per_sample, (planar_config == PLANARCONFIG_CONTIG) ? "Contiguous (chunky RGB or RGBA etc) / Interlaced" : (planar_config == PLANARCONFIG_SEPARATE) ? "Separate planes (band-sequential)" : "Unknown or unrecognized", num_bands, t.format == SCANLINE_TIFF ? "SCANLINE TIFF" : t.format == STRIP_TIFF ? "STRIP TIFF" : t.format == TILED_TIFF ? "TILED TIFF" : "UNKNOWN", is_palette_color_tiff ? "PRESENT" : "NOT PRESENT"); switch (t.format) { case STRIP_TIFF: sprintf(msg, "%s" " Rows per Strip: %d\n", msg, t.rowsPerStrip); break; case TILED_TIFF: sprintf(msg, "%s" " Tile Width: %d\n" " Tile Height: %d\n", msg, t.tileWidth, t.tileLength); break; case SCANLINE_TIFF: default: break; } asfPrintWarning(msg); XTIFFClose(input_tiff); asfPrintError(" Unsupported TIFF type found or required TIFF tags are missing\n" " in TIFF File \"%s\"\n\n" " TIFFs must contain the following:\n" " Sample format: Unsigned or signed integer or IEEE floating point data\n" " (ASF is not yet supporting TIFF files with complex number type data),\n" " Planar config: Contiguous (Greyscale, RGB, or RGBA) or separate planes (band-sequential.)\n" " Bits per sample: 8, 16, or 32\n" " Number of bands: 1 through %d bands allowed.\n" " Format: Scanline, strip, or tiled\n" " Colormap: Present or not present (only valid for 1-band images)\n", inFileName, MAX_BANDS); } XTIFFClose(input_tiff); // Get the image data type from the variable arguments list va_start(ap, outBaseName); pTmpChar = (char *)va_arg(ap, char *); va_end(ap); // Read the metadata (map-projection data etc) from the TIFF asfPrintStatus("\nImporting TIFF/GeoTIFF image to ASF Internal format...\n\n"); int i; for (i=0; i<MAX_BANDS; i++) ignore[i]=0; // Default to ignoring no bands if (pTmpChar != NULL) { strcpy(image_data_type, pTmpChar); meta = read_generic_geotiff_metadata(inFileName, ignore, image_data_type); } else { meta = read_generic_geotiff_metadata(inFileName, ignore, NULL); } // Write the Metadata file meta_write(meta, outBaseName); // Write the binary file input_tiff = XTIFFOpen (inFileName, "r"); if (input_tiff == NULL) asfPrintError ("Error opening input TIFF file:\n %s\n", inFileName); if (geotiff_band_image_write(input_tiff, meta, outBaseName, num_bands, ignore, bits_per_sample, sample_format, planar_config)) { XTIFFClose(input_tiff); meta_free(meta); meta=NULL; asfPrintError("Unable to write binary image...\n %s\n", outBaseName); } XTIFFClose(input_tiff); if (meta) meta_free(meta); } meta_parameters * read_generic_geotiff_metadata(const char *inFileName, int *ignore, ...) { int geotiff_data_exists; short num_bands; char *bands[MAX_BANDS]; // list of band IDs int band_num = 0; int count; int read_count; int ret; short model_type=-1; short raster_type=-1; short linear_units=-1; short angular_units=-1; double scale_factor; char no_data[25]; TIFF *input_tiff; GTIF *input_gtif; meta_parameters *meta_out; // Return value data_type_t data_type; datum_type_t datum; va_list ap; /***** INITIALIZE PARAMETERS *****/ /* */ // Create a new metadata object for the image. meta_out = raw_init (); meta_out->optical = NULL; meta_out->thermal = NULL; meta_out->projection = meta_projection_init (); meta_out->stats = NULL; //meta_stats_init (); meta_out->state_vectors = NULL; meta_out->location = meta_location_init (); meta_out->colormap = NULL; // Updated below if palette color TIFF // Don't set any of the deprecated structure elements. meta_out->stVec = NULL; meta_out->geo = NULL; meta_out->ifm = NULL; meta_out->info = NULL; datum = UNKNOWN_DATUM; // Set up convenience pointers meta_general *mg = meta_out->general; meta_projection *mp = meta_out->projection; meta_location *ml = meta_out->location; // FIXME: // The following function works perfectly fine when called from asf_view. // However, over here it resulted in a segmentation fault. Did not get the // time to find a solution before the release. - RG //meta_out->insar = populate_insar_metadata(inFileName); // Init mp->spheroid = UNKNOWN_SPHEROID; // meta_projection_init() 'should' initialize this, but doesn't // Open the input tiff file. input_tiff = XTIFFOpen (inFileName, "r"); if (input_tiff == NULL) { asfPrintError("Error opening input TIFF file:\n %s\n", inFileName); } // Open the structure that contains the geotiff keys. input_gtif = GTIFNew (input_tiff); if (input_gtif == NULL) { asfPrintError("Error reading GeoTIFF keys from input TIFF file:\n %s\n", inFileName); } /***** GET WHAT WE CAN FROM THE TIFF FILE *****/ /* */ // Malloc the band names and give them numeric names as defaults // (Updated from citation string later ...if the info exists) for (band_num = 0; band_num < MAX_BANDS; band_num++) { bands[band_num] = MALLOC(sizeof(char) * (BAND_NAME_LENGTH+1)); sprintf (bands[band_num], "%02d", band_num+1); } // The data type returned is an ASF data type, e.g. BYTE or REAL32 etc // // The number of bands returned is based on the samples (values) per // pixel stored in the TIFF tags ...but some bands may be blank or ignored. // Later on, band-by-band statistics will determine if individual bands should // be ignored (not imported to an img file) and if the citation string contains // a band ID list, then any band marked with the word 'Empty' will also be ignored. // the number of bands will be updated to reflect these findings. // short sample_format; // TIFFTAG_SAMPLEFORMAT short bits_per_sample; // TIFFTAG_BITSPERSAMPLE short planar_config; // TIFFTAG_PLANARCONFIG int is_scanline_format; // False if tiled or strips > 1 TIFF file format int is_palette_color_tiff; ret = get_tiff_data_config(input_tiff, &sample_format, // TIFF type (uint, int, float) &bits_per_sample, // 8, 16, or 32 &planar_config, // Contiguous (RGB or RGBA) or separate (band sequential, not interlaced) &data_type, // ASF datatype, (BYTE, INTEGER16, INTEGER32, or REAL32 ...no complex &num_bands, // Initial number of bands &is_scanline_format, &is_palette_color_tiff, REPORT_LEVEL_WARNING); if (ret != 0) { char msg[1024]; tiff_type_t t; get_tiff_type(input_tiff, &t); sprintf(msg, "FOUND TIFF tag data as follows:\n" " Sample Format: %s\n" " Bits per Sample: %d\n" " Planar Configuration: %s\n" " Number of Bands: %d\n" " Format: %s\n", (sample_format == SAMPLEFORMAT_UINT) ? "Unsigned Integer" : (sample_format == SAMPLEFORMAT_INT) ? "Signed Integer" : (sample_format == SAMPLEFORMAT_IEEEFP) ? "Floating Point" : "Unknown or Unsupported", bits_per_sample, (planar_config == PLANARCONFIG_CONTIG) ? "Contiguous (chunky RGB or RGBA etc) / Interlaced" : (planar_config == PLANARCONFIG_SEPARATE) ? "Separate planes (band-sequential)" : "Unknown or unrecognized", num_bands, t.format == SCANLINE_TIFF ? "SCANLINE TIFF" : t.format == STRIP_TIFF ? "STRIP TIFF" : t.format == TILED_TIFF ? "TILED TIFF" : "UNKNOWN"); switch (t.format) { case STRIP_TIFF: sprintf(msg, "%s" " Rows per Strip: %d\n", msg, t.rowsPerStrip); break; case TILED_TIFF: sprintf(msg, "%s" " Tile Width: %d\n" " Tile Height: %d\n", msg, t.tileWidth, t.tileLength); break; case SCANLINE_TIFF: default: break; } asfPrintWarning(msg); asfPrintError(" Unsupported TIFF type found or required TIFF tags are missing\n" " in TIFF File \"%s\"\n\n" " TIFFs must contain the following:\n" " Sample format: Unsigned or signed integer or IEEE floating point data\n" " (ASF is not yet supporting TIFF files with complex number type data),\n" " Planar config: Contiguous (Greyscale, RGB, or RGBA) or separate planes (band-sequential.)\n" " Bits per sample: 8, 16, or 32\n" " Number of bands: 1 through %d bands allowed.\n" " Format: Scanline, strip, or tiled\n", inFileName, MAX_BANDS); } asfPrintStatus("\n Found %d-banded Generic GeoTIFF with %d-bit %s type data\n" " (Note: Empty or missing bands will be ignored)\n", num_bands, bits_per_sample, (sample_format == SAMPLEFORMAT_UINT) ? "Unsigned Integer" : (sample_format == SAMPLEFORMAT_INT) ? "Signed Integer" : (sample_format == SAMPLEFORMAT_IEEEFP) ? "Floating Point" : "Unknown or Unsupported"); char *citation = NULL; int citation_length; int typeSize; tagtype_t citation_type; citation_length = GTIFKeyInfo(input_gtif, GTCitationGeoKey, &typeSize, &citation_type); if (citation_length > 0) { citation = MALLOC ((citation_length) * typeSize); GTIFKeyGet (input_gtif, GTCitationGeoKey, citation, 0, citation_length); asfPrintStatus("\nCitation: %s\n\n", citation); } else { citation_length = GTIFKeyInfo(input_gtif, PCSCitationGeoKey, &typeSize, &citation_type); if (citation_length > 0) { citation = MALLOC ((citation_length) * typeSize); GTIFKeyGet (input_gtif, PCSCitationGeoKey, citation, 0, citation_length); asfPrintStatus("\nCitation: %s\n\n", citation); } else { asfPrintStatus("\nCitation: The GeoTIFF citation string is MISSING (Not req'd)\n\n"); } } // If this is a single-band TIFF with an embedded RGB colormap, then // grab it for the metadata and write it out as an ASF LUT file if (is_palette_color_tiff) { // Produce metadata char *look_up_table = NULL; unsigned short *red = NULL; unsigned short *green = NULL; unsigned short *blue = NULL; int i; int map_size = 1<<bits_per_sample; asfRequire(map_size > 0 && map_size <= 256, "Invalid colormap size\n"); asfPrintStatus("\nFound single-band TIFF with embedded RGB colormap\n\n"); meta_colormap *mc = meta_out->colormap = meta_colormap_init(); get_look_up_table_name(citation, &look_up_table); strcpy(mc->look_up_table, look_up_table ? look_up_table : MAGIC_UNSET_STRING); FREE(look_up_table); read_count = TIFFGetField(input_tiff, TIFFTAG_COLORMAP, &red, &green, &blue); if (!read_count) { asfPrintWarning("TIFF appears to be a palette-color TIFF, but the embedded\n" "color map (TIFFTAG_COLORMAP) appears to be missing. Ingest\n" "will continue, but as a non-RGB single-band greyscale image.\n"); FREE(mc->look_up_table); FREE(mc); } else { // Populate the RGB colormap char band_str[255]; strcpy(band_str, bands[0]); for (i=1; i<num_bands; i++) sprintf(band_str, ",%s", bands[i]); strcpy(mc->band_id, band_str); mc->num_elements = map_size; mc->rgb = (meta_rgb *)CALLOC(map_size, sizeof(meta_rgb)); for (i=0; i<map_size; i++) { mc->rgb[i].red = (unsigned char)((red[i]/(float)USHORT_MAX)*(float)MAX_RGB); mc->rgb[i].green = (unsigned char)((green[i]/(float)USHORT_MAX)*(float)MAX_RGB); mc->rgb[i].blue = (unsigned char)((blue[i]/(float)USHORT_MAX)*(float)MAX_RGB); } } // NOTE: Do NOT free the red/green/blue arrays ...this will result in a // glib double-free error when the TIFF file is closed. // Now that we have good metadata, produce the LUT char *lut_file = appendExt(inFileName, ".lut"); asfPrintStatus("\nSTORING TIFF file embedded color map in look up table file:\n %s\n", lut_file); FILE *lutFP = (FILE *)FOPEN(lut_file, "wt"); fprintf(lutFP, "# Look up table type: %s\n", mc->look_up_table); fprintf(lutFP, "# Originating source: %s\n", inFileName); fprintf(lutFP, "# Index Red Green Blue\n"); for (i=0; i<map_size; i++) { fprintf(lutFP, "%03d %03d %03d %03d\n", i, mc->rgb[i].red, mc->rgb[i].green, mc->rgb[i].blue); } fprintf(lutFP, "\n"); FCLOSE(lutFP); FREE(lut_file); } // Get the tie point which defines the mapping between raster // coordinate space and geographic coordinate space. Although // geotiff theoretically supports multiple tie points, we don't // (rationale: ArcView currently doesn't either, and multiple tie // points don't make sense with the pixel scale option, which we // need). // NOTE: Since neither ERDAS or ESRI store tie points in the .aux // file associated with their geotiffs, it is _required_ that they // are found in their tiff files. double *tie_point = NULL; (input_gtif->gt_methods.get)(input_gtif->gt_tif, GTIFF_TIEPOINTS, &count, &tie_point); if (count != 6) { asfPrintError ("GeoTIFF file does not contain tie points\n"); } // Get the scale factors which define the scale relationship between // raster pixels and geographic coordinate space. double *pixel_scale = NULL; (input_gtif->gt_methods.get)(input_gtif->gt_tif, GTIFF_PIXELSCALE, &count, &pixel_scale); if (count != 3) { asfPrintError ("GeoTIFF file does not contain pixel scale parameters\n"); } if (pixel_scale[0] <= 0.0 || pixel_scale[1] <= 0.0) { asfPrintError ("GeoTIFF file contains invalid pixel scale parameters\n"); } // CHECK TO SEE IF THE GEOTIFF CONTAINS USEFUL DATA: // If the tiff file contains geocoded information, then the model type // will be ModelTypeProjected. // FIXME: Geographic (lat/long) type geotiffs with decimal degrees are // supported, but arc-sec are not yet ... int geographic_geotiff, map_projected_geotiff, geocentric_geotiff; classify_geotiff(input_gtif, &model_type, &raster_type, &linear_units, &angular_units, &geographic_geotiff, &geocentric_geotiff, &map_projected_geotiff, &geotiff_data_exists); asfPrintStatus ("Input GeoTIFF key GTModelTypeGeoKey is %s\n", (model_type == ModelTypeGeographic) ? "ModelTypeGeographic" : (model_type == ModelTypeGeocentric) ? "ModelTypeGeocentric" : (model_type == ModelTypeProjected) ? "ModelTypeProjected" : "Unknown"); asfPrintStatus ("Input GeoTIFF key GTRasterTypeGeoKey is %s\n", (raster_type == RasterPixelIsArea) ? "RasterPixelIsArea" : "(Unsupported type)"); if (map_projected_geotiff) { asfPrintStatus ("Input GeoTIFF key ProjLinearUnitsGeoKey is %s\n", (linear_units == Linear_Meter) ? "Linear_Meter" : (linear_units == Linear_Foot) ? "Linear_Foot" : (linear_units == Linear_Foot_US_Survey) ? "Linear_Foot_US_Survey" : (linear_units == Linear_Foot_Modified_American) ? "Linear_Foot_Modified_American" : (linear_units == Linear_Foot_Clarke) ? "Linear_Foot_Clarke" : (linear_units == Linear_Foot_Indian) ? "Linear_Foot_Indian" : "(Unsupported type of linear units)"); } else if (geographic_geotiff) { asfPrintStatus ("Input GeoTIFF key GeogAngularUnitsGeoKey is %s\n", (angular_units == Angular_Arc_Second) ? "Angular_Arc_Second" : (angular_units == Angular_Degree) ? "Angular_Degree" : "(Unsupported type of angular units)"); } else { asfPrintError ("Cannot determine type of linear or angular units in GeoTIFF\n"); } /***** READ PROJECTION PARAMETERS FROM TIFF IF GEO DATA EXISTS *****/ /***** THEN READ THEM FROM THE METADATA (.AUX) FILE TO SUPERCEDE IF THEY EXIST *****/ /* */ /* */ // import_arcgis_geotiff() would not be called (see detect_geotiff_flavor()) // unless the model_type is either unknown or is ModelTypeProjected. If // ModelTypeProjected, then there are projection parameters inside the // GeoTIFF file. If not, then they must be parsed from the complementary // ArcGIS metadata (.aux) file // Read the model type from the GeoTIFF file ...expecting that it is // unknown, but could possibly be ModelTypeProjection // // Start of reading projection parameters from geotiff if (model_type == ModelTypeProjected && geotiff_data_exists) { char hemisphere; projection_type_t projection_type=UNKNOWN_PROJECTION; unsigned long pro_zone; // UTM zone (UTM only) short proj_coords_trans = UNKNOWN_PROJECTION_TYPE; short pcs; short geokey_datum; double false_easting = MAGIC_UNSET_DOUBLE; double false_northing = MAGIC_UNSET_DOUBLE; double lonOrigin = MAGIC_UNSET_DOUBLE; double latOrigin = MAGIC_UNSET_DOUBLE; double stdParallel1 = MAGIC_UNSET_DOUBLE; double stdParallel2 = MAGIC_UNSET_DOUBLE; double lonPole = MAGIC_UNSET_DOUBLE; //////// ALL PROJECTIONS ///////// // Set the projection block data that we know at this point if (tie_point[0] != 0 || tie_point[1] != 0 || tie_point[2] != 0) { // NOTE: To support tie points at other locations, or a set of other locations, // then things rapidly get more complex ...and a transformation must either be // derived or provided (and utilized etc). We're not at that point yet... // asfPrintError("Unsupported initial tie point type. Initial tie point must be for\n" "raster location (0,0) in the image.\n"); } mp->startX = tie_point[3]; mp->startY = tie_point[4]; if (pixel_scale[0] < 0 || pixel_scale[1] < 0) { asfPrintWarning("Unexpected negative pixel scale values found in GeoTIFF file.\n" "Continuing ingest, but defaulting perX to fabs(x pixel scale) and\n" "perY to (-1)*fabs(y pixel scale)... Results may vary."); } mp->perX = fabs(pixel_scale[0]); mp->perY = -(fabs(pixel_scale[1])); mp->height = 0.0; if (linear_units == Linear_Meter) { strcpy(mp->units, "meters"); } else if (linear_units == Linear_Foot || linear_units == Linear_Foot_US_Survey || linear_units == Linear_Foot_Modified_American || linear_units == Linear_Foot_Clarke || linear_units == Linear_Foot_Indian) strcpy(mp->units, "feet"); else { asfPrintError("Unsupported linear unit found in map-projected GeoTIFF. Only meters and feet are currently supported.\n"); } ///////// STANDARD UTM (PCS CODE) ////////// // Get datum and zone as appropriate read_count = GTIFKeyGet (input_gtif, ProjectedCSTypeGeoKey, &pcs, 0, 1); // Quick hack for Rick's State Plane data // Only supports State Plane if (read_count && pcs >= 26931 && pcs <=26940) { mp->type = STATE_PLANE; projection_type = STATE_PLANE; proj_coords_trans = CT_TransverseMercator; datum = mp->datum = NAD83_DATUM; mp->spheroid = GRS1980_SPHEROID; } if (!read_count) { // Check to see if this is a vintage ASF UTM geotiff (they only had the UTM // description in the UTM string rather than in the ProejctedCSTypeGeoKey) int sleepy; datum_type_t dopey; char sneezy; read_count = vintage_utm_citation_to_pcs(citation, &sleepy, &sneezy, &dopey, &pcs); } if (read_count == 1 && PCS_2_UTM(pcs, &hemisphere, &datum, &pro_zone)) { mp->type = UNIVERSAL_TRANSVERSE_MERCATOR; mp->hem = hemisphere; mp->param.utm.zone = pro_zone; mp->param.utm.false_easting = 500000.0; if (hemisphere == 'N') { mp->param.utm.false_northing = 0.0; } else { mp->param.utm.false_northing = 10000000.0; } mp->param.utm.lat0 = 0.0; mp->param.utm.lon0 = utm_zone_to_central_meridian(pro_zone); if (datum != UNKNOWN_DATUM) { mp->datum = datum; } else { asfPrintError("Unsupported or unknown datum found in GeoTIFF file.\n"); } char msg[256]; sprintf(msg,"UTM scale factor defaulting to %0.4lf\n", DEFAULT_UTM_SCALE_FACTOR); asfPrintStatus(msg); mp->param.utm.scale_factor = DEFAULT_UTM_SCALE_FACTOR; } ////////// ALL OTHER PROJECTION TYPES - INCLUDING GCS/USER-DEFINED UTMS ///////// else if (projection_type != STATE_PLANE) { // Hack !!!! // Not recognized as a supported UTM PCS or was a user-defined or unknown type of PCS... // // The ProjCoordTransGeoKey will be true if the PCS was user-defined or if the PCS was // not in the geotiff file... or so the standard says. If the ProjCoordTransGeoKey is // false, it means that an unsupported (by us) UTM or State Plane projection was // discovered (above.) All other projection types make use of the ProjCoordTransGeoKey // geokey. ////// GCS-CODE DEFINED UTM /////// // Check for a user-defined UTM projection (A valid UTM code may be in // ProjectionGeoKey, although this is not typical) read_count = GTIFKeyGet (input_gtif, ProjectionGeoKey, &pcs, 0, 0); if (read_count == 1 && PCS_2_UTM(pcs, &hemisphere, &datum, &pro_zone)) { mp->type = UNIVERSAL_TRANSVERSE_MERCATOR; mp->hem = hemisphere; mp->param.utm.zone = pro_zone; mp->param.utm.false_easting = 500000.0; if (hemisphere == 'N') { mp->param.utm.false_northing = 0.0; } else { mp->param.utm.false_northing = 10000000.0; } mp->param.utm.lat0 = utm_zone_to_central_meridian(pro_zone); mp->param.utm.lon0 = 0.0; if (datum != UNKNOWN_DATUM) { mp->datum = datum; } else if (pcs/100 == 160 || pcs/100 == 161) { // With user-defined UTMs (16001-16060, 16101-16160 in ProjectionGeoKey // the zone and hemisphere is defined, but not the datum... We should try // to determine the datum as follows: // // Read GeographicTypeGeoKey: // // GeographicTypeGeoKey, If the code is recognized, assign as appropriate. // If the code is 32676 (user-defined ...which also often // means "undefined" rather than "user defined") then // check to see if the datum is specifically defined // elsewhere: // - Check GeogGeodeticDatumGeoKey // - Check PCSCitationGeoKey, GeogCitationGeoKey, and // GTCitationGeoKey to see if it is textually described // - Check to see if semi-major and inv. flattening (etc) // is defined and then do a best-fit to determine a // ellipsoid // - Default to WGS-84 (if GeographicTypeGeoKey is // 160xx or 161xx format), else error out // //asfPrintError("Unsupported or unknown datum found in GeoTIFF file.\n");https://rt/Ticket/Display.html?id=7763 short gcs; read_count = GTIFKeyGet (input_gtif, GeographicTypeGeoKey, &gcs, 0, 1); if (read_count == 1) { switch(geokey_datum){ case GCS_WGS_84: case GCSE_WGS84: datum = WGS84_DATUM; break; case GCS_NAD27: datum = NAD27_DATUM; break; case GCS_NAD83: datum = NAD83_DATUM; break; case GCS_ED50: datum = ED50_DATUM; break; case GCS_SAD69: datum = SAD69_DATUM; break; default: datum = UNKNOWN_DATUM; break; } } if (datum == UNKNOWN_DATUM) { // The datum is not typically stored in GeogGeodeticDatumGeoKey, but some s/w // does put it there read_count = GTIFKeyGet (input_gtif, GeogGeodeticDatumGeoKey, &geokey_datum, 0, 1); if (read_count == 1) { switch(geokey_datum){ case Datum_WGS84: datum = WGS84_DATUM; break; case Datum_North_American_Datum_1927: datum = NAD27_DATUM; break; case Datum_North_American_Datum_1983: datum = NAD83_DATUM; break; case 6655: // ITRF97 datum = ITRF97_DATUM; break; case 6054: // HUGHES80 datum = HUGHES_DATUM; break; default: datum = UNKNOWN_DATUM; break; } } } if (datum == UNKNOWN_DATUM) { // Try citation strings to see if the datum was textually described char *citation = NULL; int citation_length; int typeSize; tagtype_t citation_type; citation_length = GTIFKeyInfo(input_gtif, GeogCitationGeoKey, &typeSize, &citation_type); if (citation_length > 0) { citation = MALLOC ((citation_length) * typeSize); GTIFKeyGet (input_gtif, GeogCitationGeoKey, citation, 0, citation_length); check_for_datum_in_string(citation, &datum); FREE(citation); } if (datum == UNKNOWN_DATUM) { citation_length = GTIFKeyInfo(input_gtif, GTCitationGeoKey, &typeSize, &citation_type); if (citation_length > 0) { citation = MALLOC ((citation_length) * typeSize); GTIFKeyGet (input_gtif, GTCitationGeoKey, citation, 0, citation_length); check_for_datum_in_string(citation, &datum); FREE(citation); } } if (datum == UNKNOWN_DATUM) { citation_length = GTIFKeyInfo(input_gtif, PCSCitationGeoKey, &typeSize, &citation_type); if (citation_length > 0) { citation = MALLOC ((citation_length) * typeSize); GTIFKeyGet (input_gtif, PCSCitationGeoKey, citation, 0, citation_length); check_for_datum_in_string(citation, &datum); FREE(citation); } } if (datum == UNKNOWN_DATUM) { spheroid_type_t spheroid; check_for_ellipse_definition_in_geotiff(input_gtif, &spheroid); switch (spheroid) { case BESSEL_SPHEROID: case CLARKE1866_SPHEROID: case CLARKE1880_SPHEROID: case GEM6_SPHEROID: case GEM10C_SPHEROID: case GRS1980_SPHEROID: case INTERNATIONAL1924_SPHEROID: case INTERNATIONAL1967_SPHEROID: case WGS72_SPHEROID: case WGS84_SPHEROID: case HUGHES_SPHEROID: case UNKNOWN_SPHEROID: default: datum = UNKNOWN_DATUM; break; } } if (datum == UNKNOWN_DATUM) { // If all else fails, make it a WGS-84 and spit out a warning datum = WGS84_DATUM; mp->datum = datum; asfPrintWarning("Could not determine datum type from GeoTIFF, but since this\n" "is a EPSG 160xx/161xx type UTM projection (WGS84 typ.),\n" "a WGS84 datum type is assumed.\n"); } } } char msg[256]; sprintf(msg,"UTM scale factor defaulting to %0.4lf\n", DEFAULT_UTM_SCALE_FACTOR); asfPrintStatus(msg); mp->param.utm.scale_factor = DEFAULT_UTM_SCALE_FACTOR; } /////// OTHER PROJECTION DEFINITIONS - INCLUDING USER-DEFINED UTMS/////// else { // Some other type of projection may exist, including a projection-coordinate-transformation // UTM (although that is not typical) // Get the projection coordinate transformation key (identifies the projection type) read_count = GTIFKeyGet (input_gtif, ProjCoordTransGeoKey, &proj_coords_trans, 0, 1); if (read_count != 1 || proj_coords_trans == UNKNOWN_PROJECTION_TYPE) { asfPrintWarning("Unable to determine type of projection coordinate system in GeoTIFF file\n"); } // Attempt to find a defined datum (the standard says to store it in GeographicTypeGeoKey) read_count = GTIFKeyGet (input_gtif, GeographicTypeGeoKey, &geokey_datum, 0, 1); if (read_count == 1) { switch(geokey_datum){ case GCS_WGS_84: case GCSE_WGS84: datum = WGS84_DATUM; break; case GCS_NAD27: datum = NAD27_DATUM; break; case GCS_NAD83: datum = NAD83_DATUM; break; case GCS_ED50: datum = ED50_DATUM; break; case GCS_SAD69: datum = SAD69_DATUM; break; default: datum = UNKNOWN_DATUM; break; } } if (datum == UNKNOWN_DATUM) { // The datum is not typically stored in GeogGeodeticDatumGeoKey, but some s/w // does put it there read_count = GTIFKeyGet (input_gtif, GeogGeodeticDatumGeoKey, &geokey_datum, 0, 1); if (read_count == 1) { switch(geokey_datum){ case Datum_WGS84: datum = WGS84_DATUM; break; case Datum_North_American_Datum_1927: datum = NAD27_DATUM; break; case Datum_North_American_Datum_1983: datum = NAD83_DATUM; break; case 6655: // ITRF97 datum = ITRF97_DATUM; break; case 6054: // HUGHES80 datum = HUGHES_DATUM; break; default: datum = UNKNOWN_DATUM; break; } } } // Hughes datum support ...The Hughes-1980 datum is user-defined and the // typically defined by the major and inv-flattening // FIXME: There are several ways of representing otherwise-undefined datum // datum types ...maybe consider supporting those? (Probably not...) // FIXME: Found out that there is an EPSG GCS code for NSIDC SSM/I polar // stereo ...for PS using Hughes, we should write this numeric value out // and avoid using a user-defined datum (technically there is no such thing as // a 'hughes datum' ...it's an earth-centered reference spheroid and the datum // is undetermined. Sigh... works exactly the same either way blah blah blah.) if (datum == UNKNOWN_DATUM) { short int ellipsoid_key; read_count = GTIFKeyGet(input_gtif, GeogEllipsoidGeoKey, &ellipsoid_key, 0, 1); if (read_count && ellipsoid_key == USER_DEFINED_KEY) { double semi_major = 0.0; double semi_minor = 0.0; double inv_flattening = 0.0; double hughes_semiminor = HUGHES_SEMIMAJOR * (1.0 - 1.0/HUGHES_INV_FLATTENING); read_count = GTIFKeyGet(input_gtif, GeogSemiMajorAxisGeoKey, &semi_major, 0, 1); read_count += GTIFKeyGet(input_gtif, GeogInvFlatteningGeoKey, &inv_flattening, 0, 1); read_count += GTIFKeyGet(input_gtif, GeogSemiMinorAxisGeoKey, &semi_minor, 0, 1); if (read_count >= 2 && semi_major != USER_DEFINED_KEY && inv_flattening != USER_DEFINED_KEY && FLOAT_COMPARE_TOLERANCE(semi_major, HUGHES_SEMIMAJOR, FLOAT_TOLERANCE) && FLOAT_COMPARE_TOLERANCE(inv_flattening, HUGHES_INV_FLATTENING, FLOAT_TOLERANCE)) { datum = HUGHES_DATUM; } else if (read_count >= 2 && semi_major != USER_DEFINED_KEY && semi_minor != USER_DEFINED_KEY && FLOAT_COMPARE_TOLERANCE(semi_major, HUGHES_SEMIMAJOR, FLOAT_TOLERANCE) && FLOAT_COMPARE_TOLERANCE(semi_minor, hughes_semiminor, FLOAT_TOLERANCE)) { datum = HUGHES_DATUM; } else if (read_count >= 2 && semi_minor != USER_DEFINED_KEY && inv_flattening != USER_DEFINED_KEY && FLOAT_COMPARE_TOLERANCE(semi_minor, hughes_semiminor, FLOAT_TOLERANCE) && FLOAT_COMPARE_TOLERANCE(inv_flattening, HUGHES_INV_FLATTENING, FLOAT_TOLERANCE)) { datum = HUGHES_DATUM; } else if (read_count >=2 && FLOAT_COMPARE_TOLERANCE(semi_minor, semi_major, FLOAT_TOLERANCE)) { mp->spheroid = SPHERE; mp->re_major = semi_major; mp->re_minor = semi_minor; datum = UNKNOWN_DATUM; } else { datum = UNKNOWN_DATUM; } } else { datum = UNKNOWN_DATUM; } } if (datum == UNKNOWN_DATUM && mp->spheroid != SPHERE) { asfPrintWarning("Unable to determine datum type from GeoTIFF file\n" "Defaulting to WGS-84 ...This may result in projection errors\n"); datum = WGS84_DATUM; } // Take whatever datum we have at this point mp->datum = datum; // Base on the type of projection coordinate transformation, e.g. type of projection, // retrieve the rest of the projection parameters projection_type = UNKNOWN_PROJECTION; scale_factor = DEFAULT_SCALE_FACTOR; switch(proj_coords_trans) { case CT_TransverseMercator: case CT_TransvMercator_Modified_Alaska: case CT_TransvMercator_SouthOriented: read_count = GTIFKeyGet (input_gtif, ProjFalseEastingGeoKey, &false_easting, 0, 1); if (read_count != 1) { asfPrintStatus("No false easting in ProjFalseEastingGeoKey ...OK for a UTM\n"); } read_count = GTIFKeyGet (input_gtif, ProjFalseNorthingGeoKey, &false_northing, 0, 1); if (read_count != 1) { asfPrintStatus("No false northing in ProjFalseNorthingGeoKey ...OK for a UTM\n"); } read_count = GTIFKeyGet (input_gtif, ProjNatOriginLongGeoKey, &lonOrigin, 0, 1); if (read_count != 1) { asfPrintStatus("No center longitude in ProjNatOriginLongGeoKey ...OK for a UTM\n"); } read_count = GTIFKeyGet (input_gtif, ProjNatOriginLatGeoKey, &latOrigin, 0, 1); if (read_count != 1) { asfPrintStatus("No center latitude in ProjNatOriginLatGeoKey ...OK for a UTM\n"); } else { latOrigin = 0.0; } read_count = GTIFKeyGet (input_gtif, ProjScaleAtNatOriginGeoKey, &scale_factor, 0, 1); if (read_count == 0) { scale_factor = DEFAULT_UTM_SCALE_FACTOR; char msg[256]; sprintf(msg,"UTM scale factor defaulting to %0.4lf ...OK for a UTM\n", scale_factor); asfPrintStatus(msg); } mp->type = UNIVERSAL_TRANSVERSE_MERCATOR; mp->hem = (false_northing == 0.0) ? 'N' : (false_northing == 10000000.0) ? 'S' : '?'; mp->param.utm.zone = utm_zone(lonOrigin); mp->param.utm.false_easting = false_easting; mp->param.utm.false_northing = false_northing; mp->param.utm.lat0 = latOrigin; mp->param.utm.lon0 = lonOrigin; mp->param.utm.scale_factor = scale_factor; check_projection_parameters(mp); break; // Albers Conical Equal Area case IS tested case CT_AlbersEqualArea: read_count = GTIFKeyGet (input_gtif, ProjStdParallel1GeoKey, &stdParallel1, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine first standard parallel from GeoTIFF file\n" "using ProjStdParallel1GeoKey\n"); } read_count = GTIFKeyGet (input_gtif, ProjStdParallel2GeoKey, &stdParallel2, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine second standard parallel from GeoTIFF file\n" "using ProjStdParallel2GeoKey\n"); } read_count = GTIFKeyGet (input_gtif, ProjFalseEastingGeoKey, &false_easting, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine false easting from GeoTIFF file\n" "using ProjFalseEastingGeoKey\n"); } read_count = GTIFKeyGet (input_gtif, ProjFalseNorthingGeoKey, &false_northing, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine false northing from GeoTIFF file\n" "using ProjFalseNorthingGeoKey\n"); } read_count = GTIFKeyGet (input_gtif, ProjNatOriginLongGeoKey, &lonOrigin, 0, 1); if (read_count != 1) { asfPrintWarning("Unable to determine center longitude from GeoTIFF file\n" "using ProjNatOriginLongGeoKey. Trying ProjCenterLongGeoKey...\n"); read_count = GTIFKeyGet (input_gtif, ProjCenterLongGeoKey, &lonOrigin, 0, 1); if (read_count != 1) { asfPrintWarning("Unable to determine center longitude from GeoTIFF file\n" "using ProjCenterLongGeoKey as well...\n"); } else { asfPrintStatus("\nFound center longitude from ProjCenterLongGeoKey in GeoTIFF" "file...\n\n"); } } read_count = GTIFKeyGet (input_gtif, ProjNatOriginLatGeoKey, &latOrigin, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine center latitude from GeoTIFF file\n" "using ProjNatOriginLatGeoKey\n"); } mp->type = ALBERS_EQUAL_AREA; mp->hem = (latOrigin > 0.0) ? 'N' : 'S'; mp->param.albers.std_parallel1 = stdParallel1; mp->param.albers.std_parallel2 = stdParallel2; mp->param.albers.center_meridian = lonOrigin; mp->param.albers.orig_latitude = latOrigin; mp->param.albers.false_easting = false_easting; mp->param.albers.false_northing = false_northing; check_projection_parameters(mp); break; // FIXME: The Lambert Conformal Conic 1-Std Parallel case is UNTESTED case CT_LambertConfConic_1SP: read_count = GTIFKeyGet (input_gtif, ProjFalseEastingGeoKey, &false_easting, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine false easting from GeoTIFF file\n" "using ProjFalseEastingGeoKey. Assuming 0.0 meters and continuing...\n"); false_easting = 0.0; } read_count = GTIFKeyGet (input_gtif, ProjFalseNorthingGeoKey, &false_northing, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine false northing from GeoTIFF file\n" "using ProjFalseNorthingGeoKey. Assuming 0.0 meters and continuing...\n"); false_northing = 0.0; } read_count = GTIFKeyGet (input_gtif, ProjNatOriginLongGeoKey, &lonOrigin, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine center longitude from GeoTIFF file\n" "using ProjNatOriginLongGeoKey\n"); } read_count = GTIFKeyGet (input_gtif, ProjNatOriginLatGeoKey, &latOrigin, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine center latitude from GeoTIFF file\n" "using ProjNatOriginLatGeoKey\n"); } read_count = GTIFKeyGet (input_gtif, ProjScaleAtNatOriginGeoKey, &scale_factor, 0, 1); if (read_count != 1) { scale_factor = DEFAULT_SCALE_FACTOR; char msg[256]; sprintf(msg, "Lambert Conformal Conic scale factor from ProjScaleAtNatOriginGeoKey not found in GeoTIFF ...defaulting to %0.4lf\n", scale_factor); asfPrintWarning(msg); } mp->type = LAMBERT_CONFORMAL_CONIC; mp->hem = (latOrigin > 0.0) ? 'N' : 'S'; mp->param.lamcc.plat1 = latOrigin; mp->param.lamcc.plat2 = latOrigin; mp->param.lamcc.lat0 = latOrigin; mp->param.lamcc.lon0 = lonOrigin; mp->param.lamcc.false_easting = false_easting; mp->param.lamcc.false_northing = false_northing; mp->param.lamcc.scale_factor = scale_factor; check_projection_parameters(mp); break; case CT_LambertConfConic_2SP: read_count = GTIFKeyGet (input_gtif, ProjStdParallel1GeoKey, &stdParallel1, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine first standard parallel from GeoTIFF file\n" "using ProjStdParallel1GeoKey\n"); } read_count = GTIFKeyGet (input_gtif, ProjStdParallel2GeoKey, &stdParallel2, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine second standard parallel from GeoTIFF file\n" "using ProjStdParallel2GeoKey\n"); } read_count = GTIFKeyGet (input_gtif, ProjFalseEastingGeoKey, &false_easting, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine false easting from GeoTIFF file\n" "using ProjFalseEastingGeoKey. Assuming 0.0 meters and continuing...\n"); false_easting = 0.0; } read_count = GTIFKeyGet (input_gtif, ProjFalseNorthingGeoKey, &false_northing, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine false northing from GeoTIFF file\n" "using ProjFalseNorthingGeoKey. Assuming 0.0 meters and continuing...\n"); false_northing = 0.0; } read_count = GTIFKeyGet (input_gtif, ProjFalseOriginLongGeoKey, &lonOrigin, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine center longitude from GeoTIFF file\n" "using ProjFalseOriginLongGeoKey\n"); } read_count = GTIFKeyGet (input_gtif, ProjFalseOriginLatGeoKey, &latOrigin, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine center latitude from GeoTIFF file\n" "using ProjFalseOriginLatGeoKey\n"); } mp->type = LAMBERT_CONFORMAL_CONIC; mp->hem = (latOrigin > 0.0) ? 'N' : 'S'; mp->param.lamcc.plat1 = stdParallel1; mp->param.lamcc.plat2 = stdParallel2; mp->param.lamcc.lat0 = latOrigin; mp->param.lamcc.lon0 = lonOrigin; mp->param.lamcc.false_easting = false_easting; mp->param.lamcc.false_northing = false_northing; mp->param.lamcc.scale_factor = scale_factor; check_projection_parameters(mp); break; case CT_PolarStereographic: read_count = GTIFKeyGet (input_gtif, ProjNatOriginLatGeoKey, &latOrigin, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine center latitude from GeoTIFF file\n" "using ProjNatOriginLatGeoKey\n"); } read_count = GTIFKeyGet (input_gtif, ProjStraightVertPoleLongGeoKey, &lonPole, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine vertical pole longitude from GeoTIFF file\n" "using ProjStraightVertPoleLongGeoKey\n"); } read_count = GTIFKeyGet (input_gtif, ProjFalseEastingGeoKey, &false_easting, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine false easting from GeoTIFF file\n" "using ProjFalseEastingGeoKey\n"); } read_count = GTIFKeyGet (input_gtif, ProjFalseNorthingGeoKey, &false_northing, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine false northing from GeoTIFF file\n" "using ProjFalseNorthingGeoKey\n"); } // NOTE: The scale_factor exists in the ProjScaleAtNatOriginGeoKey, but we do not // use it, e.g. it is not current written to the meta data file with meta_write(). mp->type = POLAR_STEREOGRAPHIC; mp->hem = (latOrigin > 0) ? 'N' : 'S'; mp->param.ps.slat = latOrigin; mp->param.ps.slon = lonPole; mp->param.ps.is_north_pole = (mp->hem == 'N') ? 1 : 0; mp->param.ps.false_easting = false_easting; mp->param.ps.false_northing = false_northing; check_projection_parameters(mp); break; case CT_LambertAzimEqualArea: read_count = GTIFKeyGet (input_gtif, ProjFalseEastingGeoKey, &false_easting, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine false easting from GeoTIFF file\n" "using ProjFalseEastingGeoKey\n"); } read_count = GTIFKeyGet (input_gtif, ProjFalseNorthingGeoKey, &false_northing, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine false northing from GeoTIFF file\n" "using ProjFalseNorthingGeoKey\n"); } read_count = GTIFKeyGet (input_gtif, ProjCenterLongGeoKey, &lonOrigin, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine center longitude from GeoTIFF file\n" "using ProjCenterLongGeoKey\n"); } read_count = GTIFKeyGet (input_gtif, ProjCenterLatGeoKey, &latOrigin, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine center latitude from GeoTIFF file\n" "using ProjCenterLatGeoKey\n"); } mp->type = LAMBERT_AZIMUTHAL_EQUAL_AREA; mp->hem = (latOrigin > 0) ? 'N' : 'S'; mp->param.lamaz.center_lon = lonOrigin; mp->param.lamaz.center_lat = latOrigin; mp->param.lamaz.false_easting = false_easting; mp->param.lamaz.false_northing = false_northing; check_projection_parameters(mp); break; case CT_Equirectangular: read_count = GTIFKeyGet (input_gtif, ProjNatOriginLatGeoKey, &latOrigin, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine center latitude from GeoTIFF file\n" "using ProjNatOriginLatGeoKey\n"); } read_count = GTIFKeyGet (input_gtif, ProjNatOriginLongGeoKey, &lonOrigin, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine center longitude from GeoTIFF file\n" "using ProjNatOriginLongGeoKey\n"); } read_count = GTIFKeyGet (input_gtif, ProjFalseEastingGeoKey, &false_easting, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine false easting from GeoTIFF file\n" "using ProjFalseEastingGeoKey\n"); } read_count = GTIFKeyGet (input_gtif, ProjFalseNorthingGeoKey, &false_northing, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine false northing from GeoTIFF file\n" "using ProjFalseNorthingGeoKey\n"); } mp->type = EQUI_RECTANGULAR; mp->hem = (latOrigin > 0.0) ? 'N' : 'S'; mp->param.eqr.orig_latitude = latOrigin; mp->param.eqr.central_meridian = lonOrigin; mp->param.eqr.false_easting = false_easting; mp->param.eqr.false_northing = false_northing; check_projection_parameters(mp); break; case CT_Mercator: read_count = GTIFKeyGet (input_gtif, ProjNatOriginLatGeoKey, &latOrigin, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine center latitude from GeoTIFF file\n" "using ProjNatOriginLatGeoKey\n"); } read_count = GTIFKeyGet (input_gtif, ProjNatOriginLongGeoKey, &lonOrigin, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine center longitude from GeoTIFF file\n" "using ProjNatOriginLongGeoKey\n"); } read_count = GTIFKeyGet (input_gtif, ProjFalseEastingGeoKey, &false_easting, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine false easting from GeoTIFF file\n" "using ProjFalseEastingGeoKey\n"); } read_count = GTIFKeyGet (input_gtif, ProjFalseNorthingGeoKey, &false_northing, 0, 1); if (read_count != 1) { asfPrintWarning( "Unable to determine false northing from GeoTIFF file\n" "using ProjFalseNorthingGeoKey\n"); } // FIXME: convert scale factor into standard parallel mp->type = MERCATOR; mp->hem = (latOrigin > 0.0) ? 'N' : 'S'; mp->param.mer.orig_latitude = latOrigin; mp->param.mer.central_meridian = lonOrigin; mp->param.mer.false_easting = false_easting; mp->param.mer.false_northing = false_northing; check_projection_parameters(mp); break; case CT_Sinusoidal: read_count = GTIFKeyGet (input_gtif, ProjCenterLongGeoKey, &lonOrigin, 0, 1); if (read_count != 1) { asfPrintWarning("Unable to determine center longitude from " "GeoTIFF file\nusing ProjCenterLongGeoKey\n"); } read_count = GTIFKeyGet (input_gtif, ProjFalseEastingGeoKey, &false_easting, 0, 1); if (read_count != 1) { asfPrintWarning("Unable to determine false easting from GeoTIFF " "file\nusing ProjFalseEastingGeoKey\n"); } read_count = GTIFKeyGet (input_gtif, ProjFalseNorthingGeoKey, &false_northing, 0, 1); if (read_count != 1) { asfPrintWarning("Unable to determine false northing from GeoTIFF" " file\nusing ProjFalseNorthingGeoKey\n"); } mp->type = SINUSOIDAL; mp->hem = mg->center_latitude > 0.0 ? 'N' : 'S'; mp->param.sin.longitude_center = lonOrigin; mp->param.sin.false_easting = false_easting; mp->param.sin.false_northing = false_northing; mp->param.sin.sphere = mp->re_major; check_projection_parameters(mp); break; default: asfPrintWarning( "Unable to determine projection type from GeoTIFF file\n" "using ProjectedCSTypeGeoKey or ProjCoordTransGeoKey\n"); asfPrintWarning("Projection parameters missing in the GeoTIFF\n" "file. Projection parameters may be incomplete unless\n" "they are found in the associated .aux file (if it exists.)\n"); break; } } } // End of if UTM else OTHER projection type } // End of reading projection parameters from geotiff ...if it existed else if (model_type == ModelTypeGeographic && geotiff_data_exists) { // Set the projection block data that we know at this point if (tie_point[0] != 0 || tie_point[1] != 0 || tie_point[2] != 0) { // NOTE: To support tie points at other locations, or a set of other locations, // then things rapidly get more complex ...and a transformation must either be // derived or provided (and utilized etc). We're not at that point yet... // asfPrintError("Unsupported initial tie point type. Initial tie point must be for\n" "raster location (0,0) in the image.\n"); } short geographic_type; read_count = GTIFKeyGet (input_gtif, GeographicTypeGeoKey, &geographic_type, 0, 1); asfRequire (read_count == 1, "GTIFKeyGet failed.\n"); datum = UNKNOWN_DATUM; switch ( geographic_type ) { case GCS_WGS_84: datum = WGS84_DATUM; break; case GCS_NAD27: datum = NAD27_DATUM; break; case GCS_NAD83: datum = NAD83_DATUM; break; default: asfPrintError ("Unsupported GeographicTypeGeoKey value in GeoTIFF file"); break; } spheroid_type_t spheroid = datum_spheroid (datum); // NOTE: For geographic geotiffs, all angular units are converted to decimal // degrees upon ingest, hence the setting of mp->units to "degrees" here. // the angular_units variable contains, at this point, the type of unit that is // used within the geotiff itself, i.e. Angular_Arc_Second, Angular_Degree, etc. strcpy (mp->units, "degrees"); mp->type = LAT_LONG_PSEUDO_PROJECTION; mp->hem = mg->center_latitude > 0.0 ? 'N' : 'S'; mp->spheroid = spheroid; // These fields should be the same as the ones in the general block. mp->re_major = mg->re_major; mp->re_minor = mg->re_minor; mp->datum = datum; mp->height = 0.0; // Set to the mean from the statistics later (for DEMs) } else if (!geotiff_data_exists) { asfPrintWarning("Projection parameters missing in the GeoTIFF\n" "file. Projection parameters may be incomplete unless.\n" "they are found in the associated .aux file (if it exists.)\n"); } /*****************************************************/ /***** CHECK TO SEE IF THIS IS AN ARCGIS GEOTIFF *****/ /* */ if (model_type == ModelTypeProjected && isArcgisGeotiff(inFileName)) { // If the TIFF is an ArcGIS / IMAGINE GeoTIFF, then read the // projection parameters from the aux file (if it exists) asfPrintStatus("Checking ArcGIS GeoTIFF auxiliary file (.aux) for\n" "projection parameters...\n"); int ret = readArcgisAuxProjectionParameters(inFileName, mp); if (mp->datum != UNKNOWN_DATUM) { datum = mp->datum; } if (ret == 0) { asfPrintStatus("\nSUCCESS ...Found projection parameters in the .aux file.\n" "(These will supercede any found in the TIFF - which should have been\n" " the same anyway.)\n\n"); } } /* */ /*****************************************************/ asfPrintStatus("\nLoading input TIFF/GeoTIFF file into %d-banded %s image structure...\n\n", num_bands, (data_type == BYTE) ? "8-bit byte" : (data_type == INTEGER16) ? "16-bit integer" : (data_type == INTEGER32) ? "32-bit integer" : (data_type == REAL32) ? "32-bit float" : "unknown(?)"); // Get the raster width and height of the image. uint32 width; uint32 height; TIFFGetField(input_tiff, TIFFTAG_IMAGELENGTH, &height); TIFFGetField(input_tiff, TIFFTAG_IMAGEWIDTH, &width); if (height <= 0 || width <= 0) { asfPrintError("Invalid height and width parameters in TIFF file,\n" "Height = %ld, Width = %ld\n", height, width); } /***** FILL IN THE REST OF THE META DATA (Projection parms should already exist) *****/ /* */ char image_data_type[256]; mg->data_type = data_type; int is_usgs_seamless_geotiff = 0; if (angular_units == Angular_Degree && citation && strncmp(citation, "IMAGINE GeoTIFF Support", 23) == 0) { // This is a good guess since the only source of lat/long geotiffs that I know of // are the USGS Seamless Server geotiffs. Note that the image_data_type setting // will be overridden by the parameter list if the caller specified something. // // Note that even if this guess is wrong, it should still work fine for other // angular degree geotiffs except that the image_data_type and sensor string may // be misleading ...this won't affect processing by any of our tools. asfPrintStatus("\nGeoTIFF contains lat/long in decimal degrees. Assuming this is a\n" "USGS Seamless Server (or compatible) type of DEM GeoTIFF with pixel\n" "size of 30, 60, 90, or 190 meters, i.e. SRTM, NED, DTED, etcetera...\n"); strcpy(mg->sensor, "USGS Seamless data (e.g., NED, SRTM)"); strcpy(image_data_type, "DEM"); mg->image_data_type = DEM; is_usgs_seamless_geotiff = 1; } else if (angular_units == Angular_Degree || angular_units == Angular_Arc_Second) { // All other angular units asfPrintStatus("\nGeoTIFF contains lat/long in %s. Assuming this is a\n" "USGS Seamless Server (or compatible) type of DEM GeoTIFF with pixel\n" "size of 30, 60, 90, 190 meters, i.e. SRTM, NED, DTED, etcetera...\n", angular_units_to_string(angular_units)); strcpy(mg->sensor, "USGS Seamless data (e.g., NED, SRTM)"); is_usgs_seamless_geotiff = 1; // This will turn on conversion of pixel size from degrees to meters } else { strcpy(mg->sensor, "GEOTIFF"); strcpy(mg->sensor_name, "GEOTIFF"); } strcpy(mg->basename, inFileName); // Get the image data type from the variable arguments list char *pTmpChar=NULL; va_start(ap, ignore); // 'ignore' is the last argument before ", ..." pTmpChar = (char *)va_arg(ap, char *); if (pTmpChar != NULL && strlen(pTmpChar) >= 3 && (strncmp(uc(pTmpChar), "DEM", 3) == 0 || strncmp(uc(pTmpChar), "MASK", 4) == 0)) { strcpy(image_data_type, uc(pTmpChar)); } else { if (is_usgs_seamless_geotiff) { strcpy(image_data_type, "DEM"); } else if (geotiff_data_exists) { strcpy(image_data_type, "GEOCODED_IMAGE"); } else { strcpy(image_data_type, "IMAGE"); } } va_end(ap); if (strncmp(image_data_type, "DEM", 3) == 0) { mg->image_data_type = DEM; } else if (strncmp(image_data_type, "MASK", 4) == 0) { mg->image_data_type = MASK; } else if (strncmp(image_data_type, "AMPLITUDE_IMAGE", 15) == 0) { mg->image_data_type = AMPLITUDE_IMAGE; } else if (strncmp(image_data_type, "GEOCODED_IMAGE", 15) == 0) { mg->image_data_type = GEOCODED_IMAGE; } else if (strncmp(image_data_type, "IMAGE", 5) == 0) { mg->image_data_type = IMAGE; } mg->line_count = height; mg->sample_count = width; mg->start_line = 0; mg->start_sample = 0; float base_x_pixel_scale = pixel_scale[0]; float base_y_pixel_scale = pixel_scale[1]; if (is_usgs_seamless_geotiff) { int x_pixel_size_meters = MAGIC_UNSET_INT; int y_pixel_size_meters = MAGIC_UNSET_INT; // Convert angular units to decimal degrees if necessary switch(angular_units) { case Angular_Arc_Second: base_x_pixel_scale *= ARCSECONDS2DEGREES; base_y_pixel_scale *= ARCSECONDS2DEGREES; break; case Angular_Degree: default: break; } // Convert decimal degrees to (approximate) pixel resolution in meters // (per STRM & DTED standards) // 30m = 1 arcsec = 0.0002777777 degrees, // 60m = 2 arcsec = 0.0005555555 degrees, // 90m = 3 arcsec = 0.0008333333 degrees, // 180m = 6 arcsec = 0.0016666667 degrees, if (FLOAT_COMPARE_TOLERANCE(base_x_pixel_scale, 0.0002777, 0.000001)) { x_pixel_size_meters = 30.0; } else if (FLOAT_COMPARE_TOLERANCE(base_x_pixel_scale, 0.0005555, 0.000001)) { x_pixel_size_meters = 60.0; } else if (FLOAT_COMPARE_TOLERANCE(base_x_pixel_scale, 0.0008333, 0.000001)) { x_pixel_size_meters = 90.0; } else if (FLOAT_COMPARE_TOLERANCE(base_x_pixel_scale, 0.0016667, 0.000001)) { x_pixel_size_meters = 180.0; } else { // If not a standard size, then hack-calc it... // // We are supposed to put {x,y}_pixel_size in meters, so we need to convert // the pixel scale in degrees to meters ...and we don't have platform position // or height information! // // So, we are cheating a bit here, forcing the result to be to the nearest // 10m. This is ok since USGS DEMs are in 30, 60, or 90 meters. And if this // cheat is wrong ...it should still be ok since the one where accuracy is // important is the value in the projection block, this one is used by geocode // when deciding how large the pixels should be in the output. x_pixel_size_meters = 10*(int)(11131.95 * pixel_scale[0] + .5); // Sanity check on the pixel size cheat... if (x_pixel_size_meters != 30 && x_pixel_size_meters != 60 && x_pixel_size_meters != 90 && x_pixel_size_meters != 180) { asfPrintWarning("Unexpected x pixel size: %dm.\n" "USGS Seamless/NED/DTED data should be 30, 60, 90, or 180m\n", x_pixel_size_meters); } } if (FLOAT_COMPARE_TOLERANCE(base_y_pixel_scale, 0.0002777, 0.000001)) { y_pixel_size_meters = 30.0; } else if (FLOAT_COMPARE_TOLERANCE(base_y_pixel_scale, 0.0005555, 0.000001)) { y_pixel_size_meters = 60.0; } else if (FLOAT_COMPARE_TOLERANCE(base_y_pixel_scale, 0.0008333, 0.000001)) { y_pixel_size_meters = 90.0; } else if (FLOAT_COMPARE_TOLERANCE(base_y_pixel_scale, 0.0016667, 0.000001)) { y_pixel_size_meters = 180.0; } else { y_pixel_size_meters = 10*(int)(11131.95 * pixel_scale[1] + .5); if (y_pixel_size_meters != 30 && y_pixel_size_meters != 60 && y_pixel_size_meters != 90 && y_pixel_size_meters != 180) { asfPrintWarning("Unexpected y pixel size: %dm.\n" "USGS Seamless/NED/DTED data should be 30, 60, 90, or 180m\n", y_pixel_size_meters); } } mg->x_pixel_size = x_pixel_size_meters; mg->y_pixel_size = y_pixel_size_meters; } else if (linear_units == Linear_Foot || linear_units == Linear_Foot_US_Survey || linear_units == Linear_Foot_Modified_American || linear_units == Linear_Foot_Clarke || linear_units == Linear_Foot_Indian) { // Hack: The exact number for unit 'ft' needs to be extracted from the file base_x_pixel_scale *= 0.3048; base_y_pixel_scale *= 0.3048; mg->x_pixel_size = base_x_pixel_scale; mg->y_pixel_size = base_y_pixel_scale; asfPrintWarning("Units converted from feet to meters by adjusting the pixel size.\n" "Azimuth pixel size changed from %.3lf ft to %.3lf m.\n" "Range pixel size changed from %.3lf ft to %.3lf m.\n", pixel_scale[0], base_x_pixel_scale, pixel_scale[1], base_y_pixel_scale); } else { mg->x_pixel_size = pixel_scale[0]; mg->y_pixel_size = pixel_scale[1]; } // For now we are going to insist that the meters per pixel in the // X and Y directions are identical(ish). I believe asf_geocode at // least would work for non-square pixel dimensions, with the // caveats that output pixels would still be square, and would have // default size derived solely from the input pixel size if (fabs(mg->x_pixel_size - mg->y_pixel_size) > 0.0001) { char msg[256]; sprintf(msg, "Pixel size is (x,y): (%lf, %lf)\n", mg->x_pixel_size, mg->y_pixel_size); asfPrintStatus(msg); asfPrintWarning("Found non-square pixels: x versus y pixel size differs\n" "by more than 0.0001 <units>\n"); } // Image raster coordinates of tie point. double raster_tp_x = tie_point[0]; double raster_tp_y = tie_point[1]; // Note: [2] is zero for 2D space // Coordinates of tie point in projection space. // NOTE: These are called tp_lon and tp_lat ...but the tie points // will be in either linear units (meters typ.) *OR* lat/long depending // on what type of image data is in the file, e.g. map-projected geographic or // geocentric respectively (but we only support map-projected at this point.) double tp_lon = tie_point[3]; // x double tp_lat = tie_point[4]; // y, Note: [5] is zero for 2D space // Calculate center of image data ...using linear meters or decimal degrees double center_x = MAGIC_UNSET_DOUBLE; double center_y = MAGIC_UNSET_DOUBLE; if (linear_units == Linear_Meter || linear_units == Linear_Foot || linear_units == Linear_Foot_US_Survey || linear_units == Linear_Foot_Modified_American || linear_units == Linear_Foot_Clarke || linear_units == Linear_Foot_Indian) { // NOTE: center_x and center_y are in meters (map projection coordinates) // and are converted to lat/lon for center latitude/longitude below. Therefore, // since geographic geotiffs already contain angular measure, they don't need // a center_x, center_y calculated. // FIXME: Is tp_lon and tp_lat in degrees or meters for this case? center_x = (width / 2.0 - raster_tp_x) * base_x_pixel_scale + tp_lon; center_y = (height / 2.0 - raster_tp_y) * (-base_y_pixel_scale) + tp_lat; } // If the datum and/or spheroid are unknown at this point, then fill // them out, and the major/minor axis, as best we can. if (datum != UNKNOWN_DATUM && mp->spheroid == UNKNOWN_SPHEROID) { // Guess the spheroid from the type of datum (a fairly safe guess) mp->spheroid = datum_spheroid(mp->datum); } if (datum == UNKNOWN_DATUM && mp->spheroid != UNKNOWN_SPHEROID) { // Can't guess a datum, so leave it be datum = spheroid_datum(mp->spheroid); } if (datum == UNKNOWN_DATUM && mp->spheroid == UNKNOWN_SPHEROID && mp && mp->re_major != MAGIC_UNSET_DOUBLE && mp->re_minor != MAGIC_UNSET_DOUBLE) { // If neither the datum nor spheroid are known, try to derive them from // the axis lengths in the map projection record mp->spheroid = axis_to_spheroid(mp->re_major, mp->re_minor); datum = spheroid_datum(mp->spheroid); } if (mp->spheroid != UNKNOWN_SPHEROID) { spheroid_axes_lengths (mp->spheroid, &mg->re_major, &mg->re_minor); } if (isArcgisGeotiff(inFileName) && mp->re_major != MAGIC_UNSET_DOUBLE && mp->re_minor != MAGIC_UNSET_DOUBLE) { // The ArcGIS metadata reader sets the projection parms, not the general // block parms, so copy them over... mg->re_major = mp->re_major; mg->re_minor = mp->re_minor; } if (!isArcgisGeotiff(inFileName) && (mp->startX == MAGIC_UNSET_DOUBLE || mp->startY == MAGIC_UNSET_DOUBLE || mp->perX == MAGIC_UNSET_DOUBLE || mp->perY == MAGIC_UNSET_DOUBLE)) { mp->startX = (0.0 - raster_tp_x) * mg->x_pixel_size + tp_lon; mp->startY = (0.0 - raster_tp_y) * (-mg->y_pixel_size) + tp_lat; mp->perX = mg->x_pixel_size; mp->perY = -mg->y_pixel_size; } else if (is_usgs_seamless_geotiff) { if (linear_units == Linear_Meter) { // FIXME: Is tp_lon and tp_lat in degrees or meters for this case? mp->startX = (0.0 - raster_tp_x) * base_x_pixel_scale + tp_lon; mp->startY = (0.0 - raster_tp_y) * (-base_y_pixel_scale) + tp_lat; } else if (angular_units == Angular_Degree) { mp->startX = (0.0 - raster_tp_x) * base_x_pixel_scale + tp_lon; mp->startY = (0.0 - raster_tp_y) * (-base_y_pixel_scale) + tp_lat; } else if (angular_units == Angular_Arc_Second) { mp->startX = (0.0 - raster_tp_x) * (base_x_pixel_scale * ARCSECONDS2DEGREES) + tp_lon; mp->startY = (0.0 - raster_tp_y) * (-(base_y_pixel_scale * ARCSECONDS2DEGREES)) + tp_lat; } mp->perX = pixel_scale[0]; mp->perY = -pixel_scale[1]; } // These fields should be the same as the ones in the general block. mp->re_major = mg->re_major; mp->re_minor = mg->re_minor; // Fill out the number of bands and the band names strcpy(mg->bands, ""); mg->band_count = num_bands; int *empty = (int*)CALLOC(num_bands, sizeof(int)); // Defaults to 'no empty bands' char *band_str; band_str = (char*)MALLOC(100*sizeof(char)); // '100' is the array length of mg->bands (see asf_meta.h) ...yes, I know. int num_found_bands; char *tmp_citation = (citation != NULL) ? STRDUP(citation) : NULL; int is_asf_geotiff = 0; if (tmp_citation) is_asf_geotiff = strstr(tmp_citation, "Alaska Satellite Fac") ? 1 : 0; get_bands_from_citation(&num_found_bands, &band_str, empty, tmp_citation, num_bands); meta_statistics *stats = NULL; double mask_value = MAGIC_UNSET_DOUBLE; if (!is_asf_geotiff) { asfPrintStatus("\nNo ASF-exported band names found in GeoTIFF citation tag.\n" "Band names will be assigned in numerical order.\n"); // Look for a non-standard GDAL tag that contains the no data value void *data; uint16 *counter; int ret = TIFFGetField(input_tiff, TIFFTAG_GDAL_NODATA, &counter, &data); if (ret) mg->no_data = atof((char *)data); else mg->no_data = MAGIC_UNSET_DOUBLE; } else { // This is an ASF GeoTIFF so we must check to see if any bands are empty (blank) // Since some blank-band GeoTIFFs exported by ASF tools do NOT have the list of // bands placed in the citation string, we will need to make a best-guess based // on band statistics... but only if the citation isn't cooperating. if (num_found_bands < 1) { asfPrintStatus("\nGathering image statistics (per available band)...\n"); switch(meta_out->general->data_type) { case BYTE: case INTEGER16: case INTEGER32: mask_value = UINT8_IMAGE_DEFAULT_MASK; break; case REAL32: mask_value = FLOAT_IMAGE_DEFAULT_MASK; break; default: mask_value = 0.0; break; } mg->no_data = mask_value; // If there are no band names in the citation, then collect stats and check for empty // bands that way stats = meta_statistics_init(num_bands); int is_dem = (mg->image_data_type == DEM) ? 1 : 0; if(!stats) asfPrintError("Out of memory. Cannot allocate statistics struct.\n"); int ii, nb; for (ii=0, nb=num_bands; ii<num_bands; ii++) { int ret; ret = tiff_image_band_statistics(input_tiff, meta_out, &stats->band_stats[ii], is_dem, num_bands, ii, bits_per_sample, sample_format, planar_config, 0, mask_value); if (ret != 0 || (stats->band_stats[ii].mean == stats->band_stats[ii].min && stats->band_stats[ii].mean == stats->band_stats[ii].max && stats->band_stats[ii].mean == stats->band_stats[ii].std_deviation)) { // Band data is blank, e.g. no variation ...all pixels the same asfPrintStatus("\nFound empty band (see statistics below):\n" " min = %f\n" " max = %f\n" " mean = %f\n" " sdev = %f\n\n", stats->band_stats[ii].min, stats->band_stats[ii].max, stats->band_stats[ii].mean, stats->band_stats[ii].std_deviation); ignore[ii] = 1; // EMPTY BAND FOUND nb--; } else { ignore[ii] = 0; asfPrintStatus("\nBand Statistics:\n" " min = %f\n" " max = %f\n" " mean = %f\n" " sdev = %f\n\n", stats->band_stats[ii].min, stats->band_stats[ii].max, stats->band_stats[ii].mean, stats->band_stats[ii].std_deviation); } } } } if (is_usgs_seamless_geotiff) { // USGS Seamless geotiffs are DEMs, which means they are one-banded and the mean // data value is the average height in the image ...we need to calculate the stats // in this case, so we can populate mp->mean properly. // NOTE: Even though USGS DEMs are one-banded, this code is written generically for // any number of bands in an arcsec or angular degrees lat/long geotiff asfPrintStatus("\nCalculating average height for USGS Seamless (SRTM, NED, etc) or DTED DEM...\n\n"); stats = meta_statistics_init(num_bands); int is_dem = (mg->image_data_type == DEM) ? 1 : 0; if(!stats) asfPrintError("Out of memory. Cannot allocate statistics struct.\n"); int ii, nb; int ret = 0; for (ii=0, nb=num_bands; ii<num_bands; ii++) { ret = tiff_image_band_statistics(input_tiff, meta_out, &stats->band_stats[ii], is_dem, num_bands, ii, bits_per_sample, sample_format, planar_config, 0, mask_value); asfPrintStatus("\nBand Statistics:\n" " min = %f\n" " max = %f\n" " mean = %f\n" " sdev = %f\n\n", stats->band_stats[ii].min, stats->band_stats[ii].max, stats->band_stats[ii].mean, stats->band_stats[ii].std_deviation); // Empty band? if (ret != 0) { asfPrintWarning("USGS Seamless (NED, SRTM, etc) or DTED DEM band %d appears to have no data.\n" "Setting the average height to 0.0m and continuing...\n", ii+1); mp->height = 0.0; ignore[ii] = 1; } else { mp->height = stats->band_stats[0].mean; ignore[ii] = 0; } } } if ( num_found_bands > 0 && strlen(band_str) > 0) { // If a valid list of bands were in the citation string, then let the empty[] array, // which indicates which bands in the TIFF were listed as 'empty' overrule the // ignore[] array since it was just a best-guess based on band statistics // // Note: The ignore[] array will be used when writing the binary file so that empty // bands in the TIFF won't be written to the output file int band_no, num_empty = 0; for (band_no=0; band_no<num_bands; band_no++) { ignore[band_no] = empty[band_no]; num_empty += ignore[band_no] ? 1 : 0; } // Note: mg->band_count is set to the number of found bands after the // binary file is written ...if you do it before, then put_band_float_line() // will fail. strcpy(mg->bands, band_str); mg->band_count -= num_empty; } else { // Use the default band names if none were found in the citation string // Note: For the case where there is no list of band names // in the citation string, we are either importing somebody // else's geotiff, or we are importing one of our older ones. // The only way, in that case, to know if a band is empty is // to rely on the band statistics from above. The results // of this analysis is stored in the 'ignore[<band_no>]' array. // Note: num_bands is from the samples per pixel TIFF tag and is // the maximum number of valid (non-ignored) bands in the file int band_no, tmp_num_bands = num_bands; for (band_no=0; band_no<tmp_num_bands; band_no++) { if (ignore[band_no]) { // Decrement the band count for each ignored band num_bands--; } else { // Band is not ignored, so give it a band name if (band_no == 0) { sprintf(mg->bands, "%s", bands[band_no]); } else { sprintf(mg->bands, "%s,%s", mg->bands, bands[band_no]); } } } mg->band_count = num_bands; } FREE(band_str); if (mg->band_count <= 0 || strlen(mg->bands) <= 0) { asfPrintError("GeoTIFF file must contain at least one non-empty color channel (band)\n"); } // Populate band stats if it makes sense if (((is_asf_geotiff && num_found_bands < 1) || is_usgs_seamless_geotiff) && stats) { // If this is an ASF GeoTIFF and no band names were found in the citation string, // then we HAD to have tried to identify blank bands with statistics ...if so, then // we may as well save the stats results in the metadata so some other processing // step can use them if it needs them (without having to recalculate them) // char **band_names=NULL; if (strlen(mg->bands) && strncmp(mg->bands, MAGIC_UNSET_STRING, strlen(MAGIC_UNSET_STRING)) != 0) { band_names = extract_band_names(mg->bands, mg->band_count); } int bn; meta_out->stats = meta_statistics_init(num_bands); meta_statistics *mst = meta_out->stats; if (mst) { int ii; for (ii=0, bn=0; ii<num_bands; ii++) { if (!ignore[ii]) { if (band_names && band_names[bn] != NULL) { strcpy(mst->band_stats[bn].band_id, band_names[bn]); } else { sprintf(mst->band_stats[bn].band_id, "%02d", bn + 1); } mst->band_stats[bn].min = stats->band_stats[ii].min; mst->band_stats[bn].max = stats->band_stats[ii].max; mst->band_stats[bn].mean = stats->band_stats[ii].mean; mst->band_stats[bn].rmse = meta_is_valid_double(stats->band_stats[ii].rmse) ? stats->band_stats[ii].rmse : stats->band_stats[ii].std_deviation; mst->band_stats[bn].std_deviation = stats->band_stats[ii].std_deviation; mst->band_stats[bn].mask = mask_value; bn++; } } } else asfPrintError("Out of memory. Cannot allocate statistics struct.\n"); } // Calculate the center latitude and longitude now that the projection // parameters are stored. double center_latitude; double center_longitude; double dummy_var; meta_projection proj; // Copy all fields just in case of future code rearrangements... if (!is_usgs_seamless_geotiff) { copy_proj_parms (&proj, mp); proj_to_latlon(&proj,center_x, center_y, 0.0, &center_latitude, &center_longitude, &dummy_var); mg->center_latitude = R2D*center_latitude; mg->center_longitude = R2D*center_longitude; } else { mg->center_latitude = (height / 2.0 - raster_tp_y) * mp->perY + tp_lat; mg->center_longitude = (width / 2.0 - raster_tp_x) * mp->perX + tp_lon; mp->hem = (mg->center_latitude > 0.0) ? 'N' : 'S'; } // Set up the location block if (is_usgs_seamless_geotiff) { ml->lon_start_near_range = mp->startX; ml->lat_start_near_range = mp->startY; ml->lon_start_far_range = mp->startX + mp->perX * width; ml->lat_start_far_range = mp->startY; ml->lon_end_near_range = mp->startX; ml->lat_end_near_range = mp->startY + mp->perY * height; ml->lon_end_far_range = mp->startX + mp->perX * width; ml->lat_end_far_range = mp->startY + mp->perY * height; } else { double lat, lon; proj_to_latlon(&proj, mp->startX, mp->startY, 0.0, &lat, &lon, &dummy_var); ml->lat_start_near_range = R2D*lat; ml->lon_start_near_range = R2D*lon; proj_to_latlon(&proj, mp->startX + mp->perX * width, mp->startY, 0.0, &lat, &lon, &dummy_var); ml->lat_start_far_range = R2D*lat; ml->lon_start_far_range = R2D*lon; proj_to_latlon(&proj, mp->startX, mp->startY + mp->perY * height, 0.0, &lat, &lon, &dummy_var); ml->lat_end_near_range = R2D*lat; ml->lon_end_near_range = R2D*lon; proj_to_latlon(&proj, mp->startX + mp->perX * width, mp->startY + mp->perY * height, 0.0, &lat, &lon, &dummy_var); ml->lat_end_far_range = R2D*lat; ml->lon_end_far_range = R2D*lon; } // Clean up GTIFFree(input_gtif); XTIFFClose(input_tiff); if(stats)FREE(stats); FREE (tmp_citation); FREE (citation); FREE (tie_point); FREE (pixel_scale); for (band_num = 0; band_num < MAX_BANDS; band_num++) { FREE(bands[band_num]); } return meta_out; } // Checking routine for projection parameter input. void check_projection_parameters(meta_projection *mp) { project_parameters_t *pp = &mp->param; // FIXME: Hughes datum stuff commented out for now ...until Hughes is implemented in the trunk if (mp->datum == HUGHES_DATUM && mp->type != POLAR_STEREOGRAPHIC) { asfPrintError("Hughes ellipsoid is only supported for polar stereographic projections.\n"); } switch (mp->type) { case UNIVERSAL_TRANSVERSE_MERCATOR: // Tests for outside of allowed ranges errors: // // Valid UTM projections: // // WGS84 + zone 1 thru 60 + N or S hemisphere // NAD83 + zone 2 thru 23 + N hemisphere // NAD27 + zone 2 thru 22 + N hemisphere // if (!meta_is_valid_int(pp->utm.zone)) { asfPrintError("Invalid zone number found (%d).\n", pp->utm.zone); } if (!meta_is_valid_double(pp->utm.lat0) || pp->utm.lat0 != 0.0) { asfPrintWarning("Invalid Latitude of Origin found (%.4f).\n" "Setting Latitude of Origin to 0.0\n", pp->utm.lat0); pp->utm.lat0 = 0.0; } if (pp->utm.lon0 != utm_zone_to_central_meridian(pp->utm.zone)) { asfPrintWarning("Invalid Longitude of Origin (%.4f) found\n" "for the given zone (%d).\n" "Setting Longitude of Origin to %f for zone %d\n", utm_zone_to_central_meridian(pp->utm.zone), pp->utm.zone); pp->utm.lon0 = utm_zone_to_central_meridian(pp->utm.zone); } switch(mp->datum) { case NAD27_DATUM: if (pp->utm.zone < 2 || pp->utm.zone > 22) { asfPrintError("Zone '%d' outside the supported range (2 to 22) for NAD27...\n" " WGS 84, Zone 1 thru 60, Latitudes between -90 and +90\n" " NAD83, Zone 2 thru 23, Latitudes between 0 and +90\n" " NAD27, Zone 2 thru 22, Latitudes between 0 and +90\n\n", pp->utm.zone); } break; case NAD83_DATUM: if (pp->utm.zone < 2 || pp->utm.zone > 23) { asfPrintError("Zone '%d' outside the supported range (2 to 23) for NAD83...\n" " WGS 84, Zone 1 thru 60, Latitudes between -90 and +90\n" " NAD83, Zone 2 thru 23, Latitudes between 0 and +90\n" " NAD27, Zone 2 thru 22, Latitudes between 0 and +90\n\n", pp->utm.zone); } break; case WGS84_DATUM: if (pp->utm.zone < 1 || pp->utm.zone > 60) { asfPrintError("Zone '%d' outside the valid range of (1 to 60) for WGS-84\n", pp->utm.zone); } break; case ITRF97_DATUM: if (pp->utm.zone < 1 || pp->utm.zone > 60) { asfPrintError("Zone '%d' outside the valid range of (1 to 60) for ITRF-97\n", pp->utm.zone); } break; default: asfPrintError("Unrecognized or unsupported datum found in projection parameters.\n"); break; } if (!meta_is_valid_double(pp->utm.lon0) || pp->utm.lon0 < -180 || pp->utm.lon0 > 180) { asfPrintError("Longitude of Origin (%.4f) undefined or outside the defined range " "(-180 deg to 180 deg)\n", pp->utm.lon0); } if (!meta_is_valid_double(pp->utm.lat0) || pp->utm.lat0 != 0.0) { asfPrintError("Latitude of Origin (%.4f) undefined or invalid (should be 0.0)\n", pp->utm.lat0); } if (!meta_is_valid_double(pp->utm.scale_factor) || !FLOAT_EQUIVALENT(pp->utm.scale_factor, 0.9996)) { asfPrintError("Scale factor (%.4f) undefined or different from default value (0.9996)\n", pp->utm.scale_factor); } if (!meta_is_valid_double(pp->utm.false_easting) || !FLOAT_EQUIVALENT(pp->utm.false_easting, 500000)) { asfPrintError("False easting (%.1f) undefined or different from default value (500000)\n", pp->utm.false_easting); } if (mp->hem == 'N') { if (!meta_is_valid_double(pp->utm.false_northing) || !FLOAT_EQUIVALENT(pp->utm.false_northing, 0)) { asfPrintError("False northing (%.1f) undefined or different from default value (0)\n", pp->utm.false_northing); } } else { if (!meta_is_valid_double(pp->utm.false_northing) || !FLOAT_EQUIVALENT(pp->utm.false_northing, 10000000)) { asfPrintError("False northing (%.1f) undefined or different from default value (10000000)\n", pp->utm.false_northing); } } break; case POLAR_STEREOGRAPHIC: // Outside range tests if (!meta_is_valid_double(pp->ps.slat) || pp->ps.slat < -90 || pp->ps.slat > 90) { asfPrintError("Latitude of origin (%.4f) undefined or outside the defined range " "(-90 deg to 90 deg)\n", pp->ps.slat); } if (!meta_is_valid_double(pp->ps.slon) || pp->ps.slon < -180 || pp->ps.slon > 180) { asfPrintError("Central meridian (%.4f) undefined or outside the defined range " "(-180 deg to 180 deg)\n", pp->ps.slon); } // Distortion test - only areas with a latitude above 60 degrees North or // below -60 degrees South are permitted if (!meta_is_valid_int(pp->ps.is_north_pole) || (pp->ps.is_north_pole != 0 && pp->ps.is_north_pole != 1)) { asfPrintError("Invalid north pole flag (%s) found.\n", pp->ps.is_north_pole == 0 ? "SOUTH" : pp->ps.is_north_pole == 1 ? "NORTH" : "UNKNOWN"); } break; case ALBERS_EQUAL_AREA: // Outside range tests if (!meta_is_valid_double(pp->albers.std_parallel1) || pp->albers.std_parallel1 < -90 || pp->albers.std_parallel1 > 90) { asfPrintError("First standard parallel (%.4f) undefined or outside the defined range " "(-90 deg to 90 deg)\n", pp->albers.std_parallel1); } if (!meta_is_valid_double(pp->albers.std_parallel2) || pp->albers.std_parallel2 < -90 || pp->albers.std_parallel2 > 90) { asfPrintError("Second standard parallel (%.4f) undefined or outside the defined range " "(-90 deg to 90 deg)\n", pp->albers.std_parallel2); } if (!meta_is_valid_double(pp->albers.center_meridian) || pp->albers.center_meridian < -180 || pp->albers.center_meridian > 180) { asfPrintError("Central meridian (%.4f) undefined or outside the defined range " "(-180 deg to 180 deg)\n", pp->albers.center_meridian); } if (!meta_is_valid_double(pp->albers.orig_latitude) || pp->albers.orig_latitude < -90 || pp->albers.orig_latitude > 90) { asfPrintError("Latitude of origin (%.4f) undefined or outside the defined range " "(-90 deg to 90 deg)\n", pp->albers.orig_latitude); } break; case LAMBERT_CONFORMAL_CONIC: // Outside range tests if (!meta_is_valid_double(pp->lamcc.plat1) || pp->lamcc.plat1 < -90 || pp->lamcc.plat1 > 90) { asfPrintError("First standard parallel (%.4f) undefined or outside the defined range " "(-90 deg to 90 deg)\n", pp->lamcc.plat1); } if (!meta_is_valid_double(pp->lamcc.plat2) || pp->lamcc.plat2 < -90 || pp->lamcc.plat2 > 90) { asfPrintError("Second standard parallel '%.4f' outside the defined range " "(-90 deg to 90 deg)\n", pp->lamcc.plat2); } if (!meta_is_valid_double(pp->lamcc.lon0) || pp->lamcc.lon0 < -180 || pp->lamcc.lon0 > 180) { asfPrintError("Central meridian '%.4f' outside the defined range " "(-180 deg to 180 deg)\n", pp->lamcc.lon0); } if (!meta_is_valid_double(pp->lamcc.lat0) || pp->lamcc.lat0 < -90 || pp->lamcc.lat0 > 90) { asfPrintError("Latitude of origin '%.4f' outside the defined range " "(-90 deg to 90 deg)\n", pp->lamcc.lat0); } break; case LAMBERT_AZIMUTHAL_EQUAL_AREA: // Outside range tests if (!meta_is_valid_double(pp->lamaz.center_lon) || pp->lamaz.center_lon < -180 || pp->lamaz.center_lon > 180) { asfPrintError("Central meridian '%.4f' outside the defined range " "(-180 deg to 180 deg)\n", pp->lamaz.center_lon); } if (!meta_is_valid_double(pp->lamaz.center_lat) || pp->lamaz.center_lat < -90 || pp->lamaz.center_lat > 90) { asfPrintError("Latitude of origin '%.4f' outside the defined range " "(-90 deg to 90 deg)\n", pp->lamaz.center_lat); } break; case SINUSOIDAL: if (!meta_is_valid_double(pp->sin.longitude_center) || pp->sin.longitude_center < -180 || pp->sin.longitude_center > 180) { asfPrintError("Longitude center '%.4f' outside the defined range " "(-180 deg to 180 deg)\n", pp->lamaz.center_lon); } break; default: break; } } int band_float_image_write(FloatImage *oim, meta_parameters *omd, const char *outBaseName, int num_bands, int *ignore) { char *outName; int row, col, band, offset; float *buf; buf = (float*)MALLOC(sizeof(float)*omd->general->sample_count); outName = (char*)MALLOC(sizeof(char)*strlen(outBaseName) + 5); strcpy(outName, outBaseName); append_ext_if_needed(outName, ".img", ".img"); offset = omd->general->line_count; for (band=0; band < num_bands; band++) { if (num_bands > 1) { asfPrintStatus("Writing band %02d...\n", band+1); } else { asfPrintStatus("Writing binary image...\n"); } FILE *fp=(FILE*)FOPEN(outName, band > 0 ? "ab" : "wb"); if (fp == NULL) return 1; if (!ignore[band]) { for (row=0; row < omd->general->line_count; row++) { asfLineMeter(row, omd->general->line_count); for (col=0; col < omd->general->sample_count; col++) { buf[col] = float_image_get_pixel(oim, col, row+(offset*band)); } put_float_line(fp, omd, row, buf); } } else { asfPrintStatus(" Empty band found ...ignored\n"); } FCLOSE(fp); } FREE(buf); FREE(outName); return 0; } int band_byte_image_write(UInt8Image *oim_b, meta_parameters *omd, const char *outBaseName, int num_bands, int *ignore) { char *outName; int row, col, band, offset; float *buf; buf = (float*)MALLOC(sizeof(float)*omd->general->sample_count); outName = (char*)MALLOC(sizeof(char)*strlen(outBaseName) + 5); strcpy(outName, outBaseName); append_ext_if_needed(outName, ".img", ".img"); offset = omd->general->line_count; for (band=0; band < num_bands; band++) { if (num_bands > 1) { asfPrintStatus("Writing band %02d...\n", band+1); } else { asfPrintStatus("Writing binary image...\n"); } FILE *fp=(FILE*)FOPEN(outName, band > 0 ? "ab" : "wb"); if (fp == NULL) return 1; if (!ignore[band]) { for (row=0; row < omd->general->line_count; row++) { asfLineMeter(row, omd->general->line_count); for (col=0; col < omd->general->sample_count; col++) { int curr_row = row+(offset*band); buf[col] = (float)uint8_image_get_pixel(oim_b, col, curr_row); //row+(offset*band)); } put_float_line(fp, omd, row, buf); } } else { asfPrintStatus(" Empty band found ...ignored\n"); } FCLOSE(fp); } FREE(buf); FREE(outName); return 0; } int tiff_image_band_statistics (TIFF *tif, meta_parameters *omd, meta_stats *stats, int is_dem, int num_bands, int band_no, short bits_per_sample, short sample_format, short planar_config, int use_mask_value, double mask_value) { tiff_type_t tiffInfo; // Determine what type of TIFF this is (scanline/strip/tiled) get_tiff_type(tif, &tiffInfo); if (tiffInfo.imageCount > 1) { asfPrintWarning("Found multi-image TIFF file. Statistics will only be\n" "calculated from the bands in the first image in the file\n"); } if (tiffInfo.imageCount < 1) { asfPrintError ("TIFF file contains zero images\n"); } if (tiffInfo.format != SCANLINE_TIFF && tiffInfo.format != STRIP_TIFF && tiffInfo.format != TILED_TIFF) { asfPrintError("Unrecognized TIFF type\n"); } if (tiffInfo.volume_tiff) { asfPrintError("Multi-dimensional TIFF found ...only 2D TIFFs are supported.\n"); } // Minimum and maximum sample values as integers. double fmin = FLT_MAX; double fmax = -FLT_MAX; double cs=0.0; // Current sample value stats->mean = 0.0; double s = 0.0; uint32 scanlineSize = 0; uint32 sample_count = 0; // Samples considered so far. uint32 ii, jj; scanlineSize = TIFFScanlineSize(tif); if (scanlineSize <= 0) { return 1; } if (num_bands > 1 && planar_config != PLANARCONFIG_CONTIG && planar_config != PLANARCONFIG_SEPARATE) { return 1; } tdata_t *buf = _TIFFmalloc(scanlineSize); // If there is a mask value we are supposed to ignore, if ( use_mask_value ) { // iterate over all rows in the TIFF for ( ii = 0; ii < omd->general->line_count; ii++ ) { asfPercentMeter((double)ii/(double)omd->general->line_count); // Get a data line from the TIFF switch (tiffInfo.format) { case SCANLINE_TIFF: if (planar_config == PLANARCONFIG_CONTIG || num_bands == 1) { TIFFReadScanline(tif, buf, ii, 0); } else { // Planar configuration is band-sequential TIFFReadScanline(tif, buf, ii, band_no); } break; case STRIP_TIFF: ReadScanline_from_TIFF_Strip(tif, buf, ii, band_no); break; case TILED_TIFF: // if (planar_config == PLANARCONFIG_CONTIG || num_bands == 1) { // ReadScanline_from_TIFF_TileRow(tif, buf, ii, 0); // } // else { // Planar configuration is band-sequential ReadScanline_from_TIFF_TileRow(tif, buf, ii, band_no); // } break; default: asfPrintError("Invalid TIFF format found.\n"); break; } for (jj = 0 ; jj < omd->general->sample_count; jj++ ) { // iterate over each pixel sample in the scanline switch(bits_per_sample) { case 8: switch(sample_format) { case SAMPLEFORMAT_UINT: if (planar_config == PLANARCONFIG_CONTIG && num_bands > 1) { cs = (double)(((uint8*)(buf))[(jj*num_bands)+band_no]); // Current sample. } else { // Planar configuration is band-sequential or single-banded cs = (double)(((uint8*)(buf))[jj]); } break; case SAMPLEFORMAT_INT: if (planar_config == PLANARCONFIG_CONTIG && num_bands > 1) { cs = (double)(((int8*)(buf))[(jj*num_bands)+band_no]); // Current sample. } else { // Planar configuration is band-sequential or single-banded cs = (double)(((int8*)(buf))[jj]); // Current sample. } break; default: // There is no such thing as an IEEE 8-bit floating point asfPrintError("Unexpected data type in GeoTIFF ...Cannot calculate statistics.\n"); return 1; break; } if ( !isnan(mask_value) && (gsl_fcmp (cs, mask_value, 0.00000000001) == 0 ) ) { continue; } break; case 16: switch(sample_format) { case SAMPLEFORMAT_UINT: if (planar_config == PLANARCONFIG_CONTIG && num_bands > 1) { cs = (double)(((uint16*)(buf))[(jj*num_bands)+band_no]); // Current sample. } else { // Planar configuration is band-sequential or single-banded cs = (double)(((uint16*)(buf))[jj]); // Current sample. } break; case SAMPLEFORMAT_INT: if (planar_config == PLANARCONFIG_CONTIG && num_bands > 1) { cs = (double)(((int16*)(buf))[(jj*num_bands)+band_no]); // Current sample. } else { // Planar configuration is band-sequential or single-banded cs = (double)(((uint16*)(buf))[jj]); // Current sample. } break; default: // There is no such thing as an IEEE 16-bit floating point asfPrintError("Unexpected data type in TIFF/GeoTIFF ...Cannot calculate statistics.\n"); return 1; break; } if ( !isnan(mask_value) && (gsl_fcmp (cs, mask_value, 0.00000000001) == 0 ) ) { continue; } break; case 32: switch(sample_format) { case SAMPLEFORMAT_UINT: if (planar_config == PLANARCONFIG_CONTIG && num_bands > 1) { cs = (double)(((uint32*)(buf))[(jj*num_bands)+band_no]); // Current sample. } else { // Planar configuration is band-sequential or single-banded cs = (double)(((uint32*)(buf))[jj]); // Current sample. } break; case SAMPLEFORMAT_INT: if (planar_config == PLANARCONFIG_CONTIG && num_bands > 1) { cs = (double)(((long*)(buf))[(jj*num_bands)+band_no]); // Current sample. } else { // Planar configuration is band-sequential or single-banded cs = (double)(((long*)(buf))[jj]); // Current sample. } break; case SAMPLEFORMAT_IEEEFP: if (planar_config == PLANARCONFIG_CONTIG && num_bands > 1) { cs = (double)(((float*)(buf))[(jj*num_bands)+band_no]); // Current sample. } else { // Planar configuration is band-sequential or single-banded cs = (double)(((float*)(buf))[jj]); // Current sample. } if (is_dem && cs < -10e10) { // Bad value removal for DEMs (really an adjustment, not a removal) // -> This only applies to USGS Seamless DEMs and REAL32 data type <- cs = -999.0; } break; default: asfPrintError("Unexpected data type in GeoTIFF ...Cannot calculate statistics.\n"); return 1; break; } if ( !isnan(mask_value) && (gsl_fcmp (cs, mask_value, 0.00000000001) == 0 ) ) { continue; } break; } if ( G_UNLIKELY (cs < fmin) ) { fmin = cs; } if ( G_UNLIKELY (cs > fmax) ) { fmax = cs; } double old_mean = stats->mean; stats->mean += (cs - stats->mean) / (sample_count + 1); s += (cs - old_mean) * (cs - stats->mean); sample_count++; } } asfPercentMeter(1.0); } else { // There is no mask value to ignore, so we do the same as the // above loop, but without the possible continue statement. for ( ii = 0; ii < omd->general->line_count; ii++ ) { asfPercentMeter((double)ii/(double)omd->general->line_count); // Get a data line from the TIFF switch (tiffInfo.format) { case SCANLINE_TIFF: if (planar_config == PLANARCONFIG_CONTIG || num_bands == 1) { TIFFReadScanline(tif, buf, ii, 0); } else { // Planar configuration is band-sequential TIFFReadScanline(tif, buf, ii, band_no); } break; case STRIP_TIFF: ReadScanline_from_TIFF_Strip(tif, buf, ii, band_no); break; case TILED_TIFF: // Planar configuration is band-sequential ReadScanline_from_TIFF_TileRow(tif, buf, ii, band_no); break; default: asfPrintError("Invalid TIFF format found.\n"); break; } for (jj = 0 ; jj < omd->general->sample_count; jj++ ) { // iterate over each pixel sample in the scanline switch(bits_per_sample) { case 8: switch(sample_format) { case SAMPLEFORMAT_UINT: if (planar_config == PLANARCONFIG_CONTIG && num_bands > 1) { cs = (double)(((uint8*)(buf))[(jj*num_bands)+band_no]); // Current sample. } else { // Planar configuration is band-sequential or single-banded cs = (double)(((uint8*)(buf))[jj]); } break; case SAMPLEFORMAT_INT: if (planar_config == PLANARCONFIG_CONTIG && num_bands > 1) { cs = (double)(((int8*)(buf))[(jj*num_bands)+band_no]); // Current sample. } else { // Planar configuration is band-sequential or single-banded cs = (double)(((int8*)(buf))[jj]); // Current sample. } break; default: // There is no such thing as an IEEE 8-bit floating point asfPrintError("Unexpected data type in GeoTIFF ...Cannot calculate statistics.\n"); return 1; break; } break; case 16: switch(sample_format) { case SAMPLEFORMAT_UINT: if (planar_config == PLANARCONFIG_CONTIG && num_bands > 1) { cs = (double)(((uint16*)(buf))[(jj*num_bands)+band_no]); // Current sample. } else { // Planar configuration is band-sequential or single-banded cs = (double)(((uint16*)(buf))[jj]); // Current sample. } break; case SAMPLEFORMAT_INT: if (planar_config == PLANARCONFIG_CONTIG && num_bands > 1) { cs = (double)(((int16*)(buf))[(jj*num_bands)+band_no]); // Current sample. } else { // Planar configuration is band-sequential or single-banded cs = (double)(((uint16*)(buf))[jj]); // Current sample. } break; default: // There is no such thing as an IEEE 16-bit floating point asfPrintError("Unexpected data type in GeoTIFF ...Cannot calculate statistics.\n"); return 1; break; } break; case 32: switch(sample_format) { case SAMPLEFORMAT_UINT: if (planar_config == PLANARCONFIG_CONTIG && num_bands > 1) { cs = (double)(((uint32*)(buf))[(jj*num_bands)+band_no]); // Current sample. } else { // Planar configuration is band-sequential or single-banded cs = (double)(((uint32*)(buf))[jj]); // Current sample. } break; case SAMPLEFORMAT_INT: if (planar_config == PLANARCONFIG_CONTIG && num_bands > 1) { cs = (double)(((long*)(buf))[(jj*num_bands)+band_no]); // Current sample. } else { // Planar configuration is band-sequential or single-banded cs = (double)(((long*)(buf))[jj]); // Current sample. } break; case SAMPLEFORMAT_IEEEFP: if (planar_config == PLANARCONFIG_CONTIG && num_bands > 1) { cs = (double)(((float*)(buf))[(jj*num_bands)+band_no]); // Current sample. } else { // Planar configuration is band-sequential or single-banded cs = (double)(((float*)(buf))[jj]); // Current sample. } if (is_dem && cs < -10e10) { // Bad value removal for DEMs (really an adjustment, not a removal) // -> This only applies to USGS Seamless DEMs and REAL32 data type <- cs = -999.0; } break; default: asfPrintError("Unexpected data type in GeoTIFF ...Cannot calculate statistics.\n"); return 1; break; } break; default: asfPrintError("Unexpected data type in GeoTIFF ...Cannot calculate statistics.\n"); return 1; break; } if ( G_UNLIKELY (cs < fmin) ) { fmin = cs; } if ( G_UNLIKELY (cs > fmax) ) { fmax = cs; } double old_mean = stats->mean; stats->mean += (cs - stats->mean) / (sample_count + 1); s += (cs - old_mean) * (cs - stats->mean); sample_count++; } } asfPercentMeter(1.0); } if (buf) _TIFFfree(buf); // Verify the new extrema have been found. //if (fmin == FLT_MAX || fmax == -FLT_MAX) if (gsl_fcmp (fmin, FLT_MAX, 0.00000000001) == 0 || gsl_fcmp (fmax, -FLT_MAX, 0.00000000001) == 0) return 1; stats->min = fmin; stats->max = fmax; stats->std_deviation = sqrt (s / (sample_count - 1)); // The new extrema had better be in the range supported range if (fabs(stats->mean) > FLT_MAX || fabs(stats->std_deviation) > FLT_MAX) return 1; return 0; } int geotiff_band_image_write(TIFF *tif, meta_parameters *omd, const char *outBaseName, int num_bands, int *ignore, short bits_per_sample, short sample_format, short planar_config) { char *outName; int num_ignored; uint32 row, col, band; float *buf; tsize_t scanlineSize; // Determine what type of TIFF this is (scanline/strip/tiled) tiff_type_t tiffInfo; get_tiff_type(tif, &tiffInfo); if (tiffInfo.imageCount > 1) { asfPrintWarning("Found multi-image TIFF file. Only the first image in the file\n" "will be exported.\n"); } if (tiffInfo.imageCount < 1) { asfPrintError ("TIFF file contains zero images\n"); } if (tiffInfo.format != SCANLINE_TIFF && tiffInfo.format != STRIP_TIFF && tiffInfo.format != TILED_TIFF) { asfPrintError("Unrecognized TIFF type\n"); } if (tiffInfo.volume_tiff) { asfPrintError("Multi-dimensional TIFF found ...only 2D TIFFs are supported.\n"); } buf = (float*)MALLOC(sizeof(float)*omd->general->sample_count); outName = (char*)MALLOC(sizeof(char)*strlen(outBaseName) + 5); strcpy(outName, outBaseName); append_ext_if_needed(outName, ".img", ".img"); if (num_bands > 1 && planar_config != PLANARCONFIG_CONTIG && planar_config != PLANARCONFIG_SEPARATE) { asfPrintError("Unexpected planar configuration found in TIFF file\n"); } scanlineSize = TIFFScanlineSize(tif); if (scanlineSize <= 0) { return 1; } tdata_t *tif_buf = _TIFFmalloc(scanlineSize); if (!tif_buf) { asfPrintError("Cannot allocate buffer for reading TIFF lines\n"); } for (band=0, num_ignored=0; band < num_bands; band++) { if (num_bands > 1) { asfPrintStatus("\nWriting band %02d...\n", band+1); } else { asfPrintStatus("\nWriting binary image...\n"); } FILE *fp=(FILE*)FOPEN(outName, band > 0 ? "ab" : "wb"); if (fp == NULL) return 1; if (!ignore[band]) { for (row=0; row < omd->general->line_count; row++) { asfLineMeter(row, omd->general->line_count); switch (tiffInfo.format) { case SCANLINE_TIFF: if (planar_config == PLANARCONFIG_CONTIG || num_bands == 1) { TIFFReadScanline(tif, tif_buf, row, 0); } else { // Planar configuration is band-sequential TIFFReadScanline(tif, tif_buf, row, band); } break; case STRIP_TIFF: ReadScanline_from_TIFF_Strip(tif, tif_buf, row, band); break; case TILED_TIFF: // Planar configuration is band-sequential ReadScanline_from_TIFF_TileRow(tif, tif_buf, row, band); break; default: asfPrintError("Invalid TIFF format found.\n"); break; } for (col=0; col < omd->general->sample_count; col++) { switch (bits_per_sample) { case 8: switch(sample_format) { case SAMPLEFORMAT_UINT: ((float*)buf)[col] = (float)(((uint8*)tif_buf)[col]); break; case SAMPLEFORMAT_INT: ((float*)buf)[col] = (float)(((int8*)tif_buf)[col]); break; default: // No such thing as an 8-bit IEEE float asfPrintError("Unexpected data type in TIFF file ...cannot write ASF-internal\n" "format file.\n"); break; } break; case 16: switch(sample_format) { case SAMPLEFORMAT_UINT: ((float*)buf)[col] = (float)(((uint16*)tif_buf)[col]); break; case SAMPLEFORMAT_INT: ((float*)buf)[col] = (float)(((int16*)tif_buf)[col]); break; default: // No such thing as an 16-bit IEEE float asfPrintError("Unexpected data type in TIFF file ...cannot write ASF-internal\n" "format file.\n"); break; } break; case 32: switch(sample_format) { case SAMPLEFORMAT_UINT: ((float*)buf)[col] = (float)(((uint32*)tif_buf)[col]); break; case SAMPLEFORMAT_INT: ((float*)buf)[col] = (float)(((long*)tif_buf)[col]); break; case SAMPLEFORMAT_IEEEFP: ((float*)buf)[col] = (float)(((float*)tif_buf)[col]); break; default: asfPrintError("Unexpected data type in TIFF file ...cannot write ASF-internal\n" "format file.\n"); break; } break; default: asfPrintError("Unexpected data type in TIFF file ...cannot write ASF-internal\n" "format file.\n"); break; } } put_band_float_line(fp, omd, band - num_ignored, (int)row, buf); } } else { asfPrintStatus(" Empty band found ...ignored\n"); num_ignored++; } FCLOSE(fp); } FREE(buf); FREE(outName); if (tif_buf) _TIFFfree(tif_buf); return 0; } void ReadScanline_from_TIFF_Strip(TIFF *tif, tdata_t buf, unsigned long row, int band) { int read_count; tiff_type_t t; tdata_t sbuf=NULL; tstrip_t strip; uint32 strip_row; // The row within the strip that contains the requested data row if (tif == NULL) { asfPrintError("TIFF file not open for read\n"); } get_tiff_type(tif, &t); uint32 strip_size = TIFFStripSize(tif); sbuf = _TIFFmalloc(strip_size); short planar_config; // TIFFTAG_PLANARCONFIG read_count = TIFFGetField(tif, TIFFTAG_PLANARCONFIG, &planar_config); if (read_count < 1) { asfPrintError("Cannot determine planar configuration from TIFF file.\n"); } short samples_per_pixel; read_count = TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &samples_per_pixel); // Number of bands if (read_count < 1) { asfPrintError("Could not read the number of samples per pixel from TIFF file.\n"); } if (band < 0 || band > samples_per_pixel - 1) { asfPrintError("Invalid band number (%d). Band number should range from %d to %d.\n", 0, samples_per_pixel - 1); } uint32 height; read_count = TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &height); // Number of rows if (read_count < 1) { asfPrintError("Could not read the number of lines from TIFF file.\n"); } uint32 width; read_count = TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &width); // Number of pixels per row if (read_count < 1) { asfPrintError("Could not read the number of pixels per line from TIFF file.\n"); } short bits_per_sample; read_count = TIFFGetField(tif, TIFFTAG_BITSPERSAMPLE, &bits_per_sample); if (read_count < 1) { asfPrintError("Could not read the bits per sample from TIFF file.\n"); } short sample_format; read_count = TIFFGetField(tif, TIFFTAG_SAMPLEFORMAT, &sample_format); // int or float, signed or unsigned if (read_count < 1) { switch(bits_per_sample) { case 8: sample_format = SAMPLEFORMAT_UINT; break; case 16: sample_format = SAMPLEFORMAT_INT; break; case 32: sample_format = SAMPLEFORMAT_IEEEFP; break; default: asfPrintError("Could not read the sample format (data type) from TIFF file.\n"); break; } } short orientation; read_count = TIFFGetField(tif, TIFFTAG_ORIENTATION, &orientation); // top-left, left-top, bot-right, etc if (read_count < 1) { orientation = ORIENTATION_TOPLEFT; read_count = 1; } if (read_count && orientation != ORIENTATION_TOPLEFT) { asfPrintError("Unsupported orientation found (%s)\n", orientation == ORIENTATION_TOPRIGHT ? "TOP RIGHT" : orientation == ORIENTATION_BOTRIGHT ? "BOTTOM RIGHT" : orientation == ORIENTATION_BOTLEFT ? "BOTTOM LEFT" : orientation == ORIENTATION_LEFTTOP ? "LEFT TOP" : orientation == ORIENTATION_RIGHTTOP ? "RIGHT TOP" : orientation == ORIENTATION_RIGHTBOT ? "RIGHT BOTTOM" : orientation == ORIENTATION_LEFTBOT ? "LEFT BOTTOM" : "UNKNOWN"); } // Check for valid row number if (row < 0 || row >= height) { asfPrintError("Invalid row number (%d) found. Valid range is 0 through %d\n", row, height - 1); } // Reading a contiguous RGB strip results in a strip (of several rows) with rgb data // in each row, but reading a strip from a file with separate color planes results in // a strip with just the one color in each strip (and row) strip = TIFFComputeStrip(tif, row, band); strip_row = row - (strip * t.rowsPerStrip); tsize_t stripSize = TIFFStripSize(tif); uint32 bytes_per_sample = (bits_per_sample / 8); // This returns a decoded strip which contains 1 or more rows. The index calculated // below needs to take the row into account ...the strip_row is the row within a strip // assuming the first row in a strip is '0'. tsize_t bytes_read = TIFFReadEncodedStrip(tif, strip, sbuf, (tsize_t) -1); if (read_count && bytes_read > 0) { uint32 col; uint32 idx = 0; for (col = 0; col < width && (idx * bytes_per_sample) < stripSize; col++) { // NOTE: t.scanlineSize is in bytes (not pixels) if (planar_config == PLANARCONFIG_SEPARATE) { idx = strip_row * (t.scanlineSize / bytes_per_sample) + col*samples_per_pixel; } else { // PLANARCONFIG_CONTIG idx = strip_row * (t.scanlineSize / bytes_per_sample) + col*samples_per_pixel + band; } if (idx * bytes_per_sample >= stripSize) continue; // Prevents over-run if last strip or scanline (within a strip) is not complete switch (bits_per_sample) { case 8: switch (sample_format) { case SAMPLEFORMAT_UINT: ((uint8*)buf)[col] = (uint8)(((uint8*)sbuf)[idx]); break; case SAMPLEFORMAT_INT: ((int8*)buf)[col] = (int8)(((int8*)sbuf)[idx]); break; default: asfPrintError("Unexpected data type in TIFF file\n"); break; } break; case 16: switch (sample_format) { case SAMPLEFORMAT_UINT: ((uint16*)buf)[col] = (uint16)(((uint16*)sbuf)[idx]); break; case SAMPLEFORMAT_INT: ((int16*)buf)[col] = (int16)(((int16*)sbuf)[idx]); break; default: asfPrintError("Unexpected data type in TIFF file\n"); break; } break; case 32: switch (sample_format) { case SAMPLEFORMAT_UINT: ((uint32*)buf)[col] = (uint32)(((uint32*)sbuf)[idx]); break; case SAMPLEFORMAT_INT: ((long*)buf)[col] = (long)(((long*)sbuf)[idx]); break; case SAMPLEFORMAT_IEEEFP: ((float*)buf)[col] = (float)(((float*)sbuf)[idx]); break; default: asfPrintError("Unexpected data type in TIFF file\n"); break; } break; default: asfPrintError("Usupported bits per sample found in TIFF file\n"); break; } } } if (sbuf) _TIFFfree(sbuf); } void ReadScanline_from_TIFF_TileRow(TIFF *tif, tdata_t buf, unsigned long row, int band) { int read_count; tiff_type_t t; tdata_t tbuf=NULL; if (tif == NULL) { asfPrintError("TIFF file not open for read\n"); } get_tiff_type(tif, &t); if (t.format != TILED_TIFF) { asfPrintError("Programmer error: ReadScanline_from_TIFF_TileRow() called when the TIFF file\n" "was not a tiled TIFF.\n"); } tsize_t tileSize = TIFFTileSize(tif); if (tileSize > 0) { tbuf = _TIFFmalloc(tileSize); if (tbuf == NULL) { asfPrintError("Unable to allocate tiled TIFF scanline buffer\n"); } } else { asfPrintError("Invalid TIFF tile size in tiled TIFF.\n"); } short planar_config; // TIFFTAG_PLANARCONFIG read_count = TIFFGetField(tif, TIFFTAG_PLANARCONFIG, &planar_config); if (read_count < 1) { asfPrintError("Cannot determine planar configuration from TIFF file.\n"); } short samples_per_pixel; read_count = TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &samples_per_pixel); // Number of bands if (read_count < 1) { asfPrintError("Could not read the number of samples per pixel from TIFF file.\n"); } if (band < 0 || band > samples_per_pixel - 1) { asfPrintError("Invalid band number (%d). Band number should range from %d to %d.\n", 0, samples_per_pixel - 1); } uint32 height; read_count = TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &height); // Number of bands if (read_count < 1) { asfPrintError("Could not read the number of lines from TIFF file.\n"); } uint32 width; read_count = TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &width); // Number of bands if (read_count < 1) { asfPrintError("Could not read the number of pixels per line from TIFF file.\n"); } short bits_per_sample; read_count = TIFFGetField(tif, TIFFTAG_BITSPERSAMPLE, &bits_per_sample); // Number of bands if (read_count < 1) { asfPrintError("Could not read the bits per sample from TIFF file.\n"); } short sample_format; read_count = TIFFGetField(tif, TIFFTAG_SAMPLEFORMAT, &sample_format); // Number of bands if (read_count < 1) { switch(bits_per_sample) { case 8: sample_format = SAMPLEFORMAT_UINT; break; case 16: sample_format = SAMPLEFORMAT_INT; break; case 32: sample_format = SAMPLEFORMAT_IEEEFP; break; default: asfPrintError("Could not read the sample format (data type) from TIFF file.\n"); break; } } short orientation; read_count = TIFFGetField(tif, TIFFTAG_ORIENTATION, &orientation); // top-left, left-top, bot-right, etc if (read_count < 1) { orientation = ORIENTATION_TOPLEFT; } if (read_count && orientation != ORIENTATION_TOPLEFT) { asfPrintError("Unsupported orientation found (%s)\n", orientation == ORIENTATION_TOPRIGHT ? "TOP RIGHT" : orientation == ORIENTATION_BOTRIGHT ? "BOTTOM RIGHT" : orientation == ORIENTATION_BOTLEFT ? "BOTTOM LEFT" : orientation == ORIENTATION_LEFTTOP ? "LEFT TOP" : orientation == ORIENTATION_RIGHTTOP ? "RIGHT TOP" : orientation == ORIENTATION_RIGHTBOT ? "RIGHT BOTTOM" : orientation == ORIENTATION_LEFTBOT ? "LEFT BOTTOM" : "UNKNOWN"); } // Check for valid row number if (row < 0 || row >= height) { asfPrintError("Invalid row number (%d) found. Valid range is 0 through %d\n", row, height - 1); } // Develop a buffer with a line of data from a single band in it // ttile_t tile; uint32 bytes_per_sample = bits_per_sample / 8; uint32 row_in_tile; if (width > 0 && height > 0 && samples_per_pixel > 0 && bits_per_sample % 8 == 0 && t.tileWidth > 0 && t.tileLength > 0) { uint32 tile_col; uint32 buf_col; uint32 bytes_read; for (tile_col = 0, buf_col = 0; tile_col < width; tile_col += t.tileWidth) { // NOTE: t.tileLength and t.tileWidth are in pixels (not bytes) // NOTE: TIFFReadTile() is a wrapper over TIFFComputeTile() and // TIFFReadEncodedTile() ...in other words, it automatically // takes into account whether the file has contigious (interlaced) // color bands or separate color planes, and automagically // decompresses the tile during the read. The return below, // is an uncompressed tile in raster format (row-order 2D array // in memory.) bytes_read = TIFFReadTile(tif, tbuf, tile_col, row, 0, band); uint32 num_preceding_tile_rows = floor(row / t.tileLength); row_in_tile = row - (num_preceding_tile_rows * t.tileLength); uint32 i; uint32 idx = 0; for (i = 0; i < t.tileWidth && buf_col < width && (idx * bytes_per_sample) < tileSize; i++) { if (planar_config == PLANARCONFIG_SEPARATE) { idx = row_in_tile * t.tileWidth + i; } else { // PLANARCONFIG_CONTIG idx = row_in_tile * (t.tileWidth * samples_per_pixel) + i * samples_per_pixel + band; } switch (bits_per_sample) { case 8: switch (sample_format) { case SAMPLEFORMAT_UINT: ((uint8*)buf)[buf_col] = ((uint8*)tbuf)[idx]; buf_col++; break; case SAMPLEFORMAT_INT: ((int8*)buf)[buf_col] = ((int8*)tbuf)[idx]; buf_col++; break; default: asfPrintError("Unexpected data type in TIFF file\n"); break; } break; case 16: switch (sample_format) { case SAMPLEFORMAT_UINT: ((uint16*)buf)[buf_col] = ((uint16*)tbuf)[idx]; buf_col++; break; case SAMPLEFORMAT_INT: ((int16*)buf)[buf_col] = ((int16*)tbuf)[idx]; buf_col++; break; default: asfPrintError("Unexpected data type in TIFF file\n"); break; } break; case 32: switch (sample_format) { case SAMPLEFORMAT_UINT: ((uint32*)buf)[buf_col] = ((uint32*)tbuf)[idx]; buf_col++; break; case SAMPLEFORMAT_INT: ((int32*)buf)[buf_col] = ((int32*)tbuf)[idx]; buf_col++; break; case SAMPLEFORMAT_IEEEFP: ((float*)buf)[buf_col] = ((float*)tbuf)[idx]; buf_col++; break; default: asfPrintError("Unexpected data type in TIFF file\n"); break; } break; default: asfPrintError("Usupported bits per sample found in TIFF file\n"); break; } } } } if (tbuf) _TIFFfree(tbuf); } int check_for_vintage_asf_utm_geotiff(const char *citation, int *geotiff_data_exists, short *model_type, short *raster_type, short *linear_units) { int ret=0; int zone=0, is_utm=0; datum_type_t datum=UNKNOWN_DATUM; char hem='\0'; if (citation && strstr(citation, "Alaska Satellite Facility")) { short pcs=0; is_utm = vintage_utm_citation_to_pcs(citation, &zone, &hem, &datum, &pcs); } if (is_utm && zone >=1 && zone <= 60 && (hem == 'N' || hem == 'S') && datum == WGS84_DATUM) { *model_type = ModelTypeProjected; *raster_type = RasterPixelIsArea; *linear_units = Linear_Meter; *geotiff_data_exists = 1; ret = 3; // As though the three geokeys were read successfully } return ret; } // Copied from libasf_import:keys.c ...Didn't want to introduce a dependency on // the export library or vice versa static int UTM_2_PCS(short *pcs, datum_type_t datum, unsigned long zone, char hem) { // The GeoTIFF standard defines the UTM zones numerically in a way that // let's us pick off the data mathematically (NNNzz where zz is the zone // number): // // For NAD83 datums, Zones 3N through 23N, NNN == 269 // For NAD27 datums, Zones 3N through 22N, NNN == 267 // For WGS72 datums, Zones 1N through 60N, NNN == 322 // For WGS72 datums, Zones 1S through 60S, NNN == 323 // For WGS84 datums, Zones 1N through 60N, NNN == 326 // For WGS84 datums, Zones 1S through 60S, NNN == 327 // For user-defined and unsupported UTM projections, NNN can be // a variety of other numbers (see the GeoTIFF Standard) // // NOTE: For NAD27 and NAD83, only the restricted range of zones // above is supported by the GeoTIFF standard. // // NOTE: For ALOS's ITRF97 datum, note that it is based on // WGS84 and subsituting WGS84 for ITRF97 because the GeoTIFF // standard does not contain a PCS for ITRF97 (or any ITRFxx) // will result in errors of less than one meter. So when // writing GeoTIFFs, we choose to use WGS84 when ITRF97 is // desired. // const short NNN_NAD27N = 267; const short NNN_NAD83N = 269; //const short NNN_WGS72N = 322; // Currently unsupported //const short NNN_WGS72S = 323; // Currently unsupported const short NNN_WGS84N = 326; const short NNN_WGS84S = 327; char uc_hem; int supportedUTM; int valid_Zone_and_Datum_and_Hemisphere; // Substitute WGS84 for ITRF97 per comment above if (datum == ITRF97_DATUM) { datum = WGS84_DATUM; } // Check for valid datum, hemisphere, and zone combination uc_hem = toupper(hem); valid_Zone_and_Datum_and_Hemisphere = ( (datum == NAD27_DATUM && uc_hem == 'N' && zone >= 3 && zone <= 22) || (datum == NAD83_DATUM && uc_hem == 'N' && zone >= 3 && zone <= 23) || (datum == WGS84_DATUM && zone >= 1 && zone <= 60) ) ? 1 : 0; // Build the key for ProjectedCSTypeGeoKey, GCS_WGS84 etc if (valid_Zone_and_Datum_and_Hemisphere) { supportedUTM = 1; switch (datum) { case NAD27_DATUM: *pcs = (short)zone + NNN_NAD27N * 100; break; case NAD83_DATUM: *pcs = (short)zone + NNN_NAD83N * 100; break; case WGS84_DATUM: if (uc_hem == 'N') { *pcs = (short)zone + NNN_WGS84N * 100; } else { *pcs = (short)zone + NNN_WGS84S * 100; } break; default: supportedUTM = 0; *pcs = 0; break; } } else { supportedUTM = 0; *pcs = 0; } return supportedUTM; } // If the UTM description is in citation, then pick the data out and return it int vintage_utm_citation_to_pcs(const char *citation, int *zone, char *hem, datum_type_t *datum, short *pcs) { int is_utm=0; int found_zone=0, found_utm=0; *zone=0; *hem='\0'; *datum=UNKNOWN_DATUM; *pcs=0; if (citation && strstr(citation, "Alaska Satellite Facility")) { char *s = STRDUP(citation); char *tokp; tokp = strtok(s, " "); do { if (strncmp(uc(tokp),"UTM",3) == 0) { found_utm = 1; found_zone=0; } else if (strncmp(uc(tokp),"ZONE",1) == 0) { if (*zone == 0) found_zone=1; } else if (found_zone && isdigit((int)*tokp)) { *zone = (int)strtol(tokp,(char**)NULL,10); found_zone=0; } else if (strlen(tokp) == 1 && (*(uc(tokp)) == 'N' || *(uc(tokp)) == 'S')) { *hem = *(uc(tokp)) == 'N' ? 'N' : 'S'; found_zone=0; } else if (strncmp(uc(tokp),"WGS84",5) == 0) { *datum = WGS84_DATUM; found_zone=0; } } while (tokp && (tokp = strtok(NULL, " "))); if (s) FREE (s); } if (found_utm && *zone >=1 && *zone <= 60 && (*hem == 'N' || *hem == 'S') && *datum == WGS84_DATUM) { is_utm=1; UTM_2_PCS(pcs, *datum, *zone, *hem); } else { is_utm = 0; *zone=0; *hem='\0'; *datum=UNKNOWN_DATUM; *pcs=0; } return is_utm; } void classify_geotiff(GTIF *input_gtif, short *model_type, short *raster_type, short *linear_units, short *angular_units, int *geographic_geotiff, int *geocentric_geotiff, int *map_projected_geotiff, int *geotiff_data_exists) { int read_count, vintage_asf_utm; char *citation = NULL; int citation_length; int typeSize; tagtype_t citation_type; ////// Defaults ////// *model_type = *raster_type = *linear_units = *angular_units = -1; // Invalid value *geographic_geotiff = *geocentric_geotiff = *map_projected_geotiff = *geotiff_data_exists = 0; // Fails //////////////////////////////////////////////////////////////////////////////////////// // Check for a vintage ASF type of geotiff (all projection info is in the citation, and the // normal projection geokeys are left unpopulated) citation_length = GTIFKeyInfo(input_gtif, GTCitationGeoKey, &typeSize, &citation_type); if (citation_length > 0) { citation = MALLOC ((citation_length) * typeSize); GTIFKeyGet (input_gtif, GTCitationGeoKey, citation, 0, citation_length); } else { citation_length = GTIFKeyInfo(input_gtif, PCSCitationGeoKey, &typeSize, &citation_type); if (citation_length > 0) { citation = MALLOC ((citation_length) * typeSize); GTIFKeyGet (input_gtif, PCSCitationGeoKey, citation, 0, citation_length); } } if (citation != NULL && strlen(citation) > 0) { vintage_asf_utm = check_for_vintage_asf_utm_geotiff(citation, geotiff_data_exists, model_type, raster_type, linear_units); if (vintage_asf_utm) { // Found a vintage ASF UTM geotiff *geographic_geotiff = *geocentric_geotiff = 0; *map_projected_geotiff = *geotiff_data_exists = 1; return; } } FREE(citation); //////////////////////////////////////////////////////////////////////////////////////// // Check for other types of geotiffs... // // Read the basic (normally required) classification parameters ...bail if we hit any // unsupported types int m = 0, r = 0, l = 0, a = 0; m = GTIFKeyGet (input_gtif, GTModelTypeGeoKey, model_type, 0, 1); if (m && *model_type == ModelTypeGeocentric) { asfPrintError("Geocentric (x, y, z) GeoTIFFs are unsupported (so far.)\n"); } if (m && *model_type != ModelTypeProjected && *model_type != ModelTypeGeographic) { asfPrintError("Unrecognized type of GeoTIFF encountered. Must be map-projected\n" "or geogaphic (lat/long)\n"); } r = GTIFKeyGet (input_gtif, GTRasterTypeGeoKey, raster_type, 0, 0); if (r && *raster_type != RasterPixelIsArea) { asfPrintWarning("GeoTIFFs with 'point' type raster pixels are unsupported (so far.)\nContinuing, however geolocations may be off by up to a pixel.\n"); } if (m && *model_type == ModelTypeProjected) { l = GTIFKeyGet (input_gtif, ProjLinearUnitsGeoKey, linear_units, 0, 1); } if (m && *model_type == ModelTypeGeographic) { a = GTIFKeyGet (input_gtif, GeogAngularUnitsGeoKey, angular_units, 0, 1); } if (a && *angular_units != Angular_Arc_Second && *angular_units != Angular_Degree) { // Temporarily choose not to support arcsec geotiffs ...needs more testing asfPrintError("Found a Geographic (lat/lon) GeoTIFF with an unsupported type of angular\n" "units (%s) in it.\n", angular_units_to_string(*angular_units)); } if (l && (*linear_units != Linear_Meter && *linear_units != Linear_Foot && *linear_units != Linear_Foot_US_Survey && *linear_units != Linear_Foot_Modified_American && *linear_units != Linear_Foot_Clarke && *linear_units != Linear_Foot_Indian)) { // Linear units was populated but wasn't a supported type... asfPrintError("Found a map-projected GeoTIFF with an unsupported type of linear\n" "units (%s) in it.\n", linear_units_to_string(*linear_units)); } read_count = m + r + l + a; ////////////////////////////////////////////////////////////////////////////////////////// // Attempt to classify the geotiff as a geographic, geocentric, or map-projected geotiff // and try to fill in missing information if necessary // Case: 3 valid keys found if (read_count == 3) { // Check for map-projected geotiff if (m && *model_type == ModelTypeProjected) { //////// // GeoTIFF is map-projected if (!r || (r && *raster_type != RasterPixelIsArea && *raster_type != RasterPixelIsPoint)) { asfPrintWarning("Invalid raster type found.\n" "Guessing RasterPixelIsArea and continuing...\n"); r = 1; *raster_type = RasterPixelIsArea; } if (r && *raster_type != RasterPixelIsArea) { asfPrintError("Only map-projected GeoTIFFs with pixels that represent area are supported."); } if (a && !l) { asfPrintWarning("Invalid map-projected GeoTIFF found ...angular units set to %s and\n" "linear units were not set. Guessing Linear_Meter units and continuing...\n", angular_units_to_string(*angular_units)); l = 1; *linear_units = Linear_Meter; a = 0; *angular_units = -1; } if (l && (*linear_units == Linear_Meter || *linear_units == Linear_Foot || *linear_units == Linear_Foot_US_Survey || *linear_units == Linear_Foot_Modified_American || *linear_units == Linear_Foot_Clarke || *linear_units == Linear_Foot_Indian)) { *geographic_geotiff = *geocentric_geotiff = 0; *map_projected_geotiff = *geotiff_data_exists = 1; return; } else { asfPrintError("Only map-projected GeoTIFFs with linear meters or with a linear foot unit are supported.\n"); } } else if (m && *model_type == ModelTypeGeographic) { //////// // GeoTIFF is geographic (lat/long, degrees or arc-seconds (typ)) // Ignore *raster_type ...it might be set to 'area', but that would be meaningless // *raster_type has no meaning in a lat/long GeoTIFF if (l && !a) { asfPrintWarning("Invalid Geographic (lat/lon) GeoTIFF found ...linear units set to %s and\n" "angular units were not set. Guessing Angular_Degree units and continuing...\n", linear_units_to_string(*linear_units)); a = 1; *angular_units = Angular_Degree; l = 0; *linear_units = -1; } if (a && (*angular_units == Angular_Degree || *angular_units == Angular_Arc_Second)) { *geographic_geotiff = *geotiff_data_exists = 1; *map_projected_geotiff = *geocentric_geotiff = 0; return; } else { asfPrintError("Found Geographic GeoTIFF with invalid or unsupported angular units (%s)\n" "Only geographic GeoTIFFs with angular degrees are supported.\n", angular_units_to_string(*angular_units)); } } else { // Should not get here asfPrintError("Invalid or unsupported model type\n"); } } // Case: 2 valid keys found, 1 key missing else if (read_count == 2) { // Only found 2 of 3 necessary parameters ...let's try to guess the 3rd if (*model_type != ModelTypeProjected && *model_type != ModelTypeGeographic) { // The model type is unknown, raster_type and linear_units are both known and // valid for their types if (*raster_type == RasterPixelIsArea && *linear_units == Linear_Meter) { // Guess map-projected asfPrintWarning("Missing model type definition in GeoTIFF. GeoTIFF contains area-type\n" "pixels and linear meters ...guessing the GeoTIFF is map-projected and\n" "attempting to continue...\n"); *model_type = ModelTypeProjected; *geographic_geotiff = *geocentric_geotiff = 0; *map_projected_geotiff = *geotiff_data_exists = 1; return; } else if (*angular_units == Angular_Degree || *angular_units == Angular_Arc_Second) { // Guess geographic asfPrintWarning("Missing model type definition in GeoTIFF. GeoTIFF contains angular\n" "units ...guessing the GeoTIFF is geographic (lat/long) and\n" "attempting to continue...\n"); *model_type = ModelTypeGeographic; *geographic_geotiff = *geotiff_data_exists = 1; *map_projected_geotiff = *geocentric_geotiff = 0; return; } else { asfPrintError("Found unsupported type of GeoTIFF or a GeoTIFF with too many missing keys.\n"); } } // End of guessing because the ModelType was unknown - Check unknown raster_type case else if (*raster_type != RasterPixelIsArea && *raster_type != RasterPixelIsPoint) { // Raster type is missing ...let's take a guess. Model type and linear // units are both known and valid for their types if (*model_type == ModelTypeProjected) { if (*linear_units != Linear_Meter) { asfPrintError("Only meters are supported for map-projected GeoTIFFs\n"); } // Guess pixel type is area asfPrintWarning("Missing raster type in GeoTIFF, but since the GeoTIFF is map-projected,\n" "guessing RasterPixelIsArea and attempting to continue...\n"); *raster_type = RasterPixelIsArea; *geographic_geotiff = *geocentric_geotiff = 0; *map_projected_geotiff = *geotiff_data_exists = 1; return; } else if (*model_type == ModelTypeGeographic) { // Guess pixel type is area if (*angular_units != Angular_Degree && *angular_units != Angular_Arc_Second) { asfPrintError("Only angular degrees are supported for geographic GeoTIFFs\n"); } *geographic_geotiff = *geotiff_data_exists = 1; *map_projected_geotiff = *geocentric_geotiff = 0; return; } else { asfPrintError("Found geocentric (x, y, z) type of GeoTIFF ...currently unsupported.\n"); } } // End of guessing because the RasterType was unknown else if (*linear_units != Linear_Meter && *angular_units != Angular_Degree && *angular_units != Angular_Arc_Second) { // Pixel unit type is missing ...let's take a guess. Model type and raster type are // known and valid for their types if (*model_type == ModelTypeProjected) { if (*raster_type != RasterPixelIsArea) { asfPrintError("Map projected GeoTIFFs with pixels that represent something\n" "other than area (meters etc) are not supported.\n"); } // Looks like a valid map projection. Guess linear meters for the units asfPrintWarning("Missing linear units in GeoTIFF. The GeoTIFF is map-projected and\n" "pixels represent area. Guessing linear meters for the units and attempting\n" "to continue...\n"); *linear_units = Linear_Meter; *angular_units = -1; *geographic_geotiff = *geocentric_geotiff = 0; *map_projected_geotiff = *geotiff_data_exists = 1; return; } else if (*model_type == ModelTypeGeographic) { // Looks like a valid geographic (lat/long) geotiff asfPrintWarning("Found geographic type GeoTIFF with missing linear units setting.\n" "Guessing angular degrees and attempting to continue...\n"); *angular_units = Angular_Degree; *linear_units = -1; *geographic_geotiff = *geotiff_data_exists = 1; *map_projected_geotiff = *geocentric_geotiff = 0; return; } else { asfPrintError("Found geocentric (x, y, z) GeoTIFF... Geographic GeoTIFFs are\n" "unsupported at this time.\n"); } } } // Case: 1 valid key found, 2 keys missing else if (read_count == 1) { // Only found 1 of 3 necessary parameters ...let's try to guess the other 2 (dangerous ground!) if (*model_type == ModelTypeProjected) { // Only the model type is known ...guess the rest asfPrintWarning("Both the raster type and linear units is missing in the GeoTIFF. The model\n" "type is map-projected, so guessing that the raster type is RasterPixelIsArea and\n" "that the linear units are in meters ...attempting to continue\n"); *raster_type = RasterPixelIsArea; *linear_units = Linear_Meter; *angular_units = -1; *geographic_geotiff = *geocentric_geotiff = 0; *map_projected_geotiff = *geotiff_data_exists = 1; return; } else if (*model_type == ModelTypeGeographic) { // Only the model type is known ...guess the rest asfPrintWarning("Both the raster type and linear units is missing in the GeoTIFF. The model\n" "type is geographic (lat/long), so guessing that the angular units are in decimal\n" "degrees ...attempting to continue\n"); *angular_units = Angular_Degree; *linear_units = -1; *geographic_geotiff = *geotiff_data_exists = 1; *map_projected_geotiff = *geocentric_geotiff = 0; return; } else if (*model_type == ModelTypeGeocentric) { asfPrintError("Geocentric (x, y, z) GeoTIFFs are not supported (yet.)\n"); } else if (*raster_type == RasterPixelIsArea) { // Only the raster type is known ...guess the rest asfPrintWarning("Both the model type and linear units is missing in the GeoTIFF. The raster\n" "type is RasterPixelIsArea, so guessing that the model type is map-projected and\n" "that the linear units are in meters ...attempting to continue\n"); *model_type = ModelTypeProjected; *linear_units = Linear_Meter; *angular_units = -1; *geographic_geotiff = *geocentric_geotiff = 0; *map_projected_geotiff = *geotiff_data_exists = 1; return; } else if (*raster_type == RasterPixelIsPoint) { // Only the raster type is known, but cannot guess the rest... bail. asfPrintError("Found invalid or unsupported GeoTIFF. Raster type is 'point' rather than\n" "area. The model type (map projected, geographic, geocentric) is unknown.\n" "And the linear units are unknown. Cannot guess what type of GeoTIFF this\n" "is. Aborting.\n"); } else if (*linear_units == Linear_Meter) { // Only linear units is known and it's meters. Guess map projected and pixels are // area pixels. asfPrintWarning("Found GeoTIFF with undefined model and raster type. Linear units\n" "is defined to be meters. Guessing that the GeoTIFF is map-projected and\n" "that pixels represent area. Attempting to continue...\n"); *model_type = ModelTypeProjected; *raster_type = RasterPixelIsArea; *geographic_geotiff = *geocentric_geotiff = 0; *map_projected_geotiff = *geotiff_data_exists = 1; return; } else if (*angular_units == Angular_Degree) { // Only linear units is known and it's angular degrees. Guess geographic and pixels // type is 'who cares' asfPrintWarning("Found GeoTIFF with undefined model and raster type. Linear units\n" "is defined to be angular degrees. Guessing that the GeoTIFF is geographic.\n" "Attempting to continue...\n"); *model_type = ModelTypeGeographic; *geographic_geotiff = *geotiff_data_exists = 1; *map_projected_geotiff = *geocentric_geotiff = 0; return; } else if (*angular_units == Angular_Arc_Second) { // Only linear units is known and it's angular degrees. Guess geographic and pixels // type is 'who cares' asfPrintWarning("Found GeoTIFF with undefined model and raster type. Linear units\n" "is defined to be angular degrees. Guessing that the GeoTIFF is geographic.\n" "Attempting to continue...\n"); *model_type = ModelTypeGeographic; *linear_units = -1; *geographic_geotiff = *geotiff_data_exists = 1; *map_projected_geotiff = *geocentric_geotiff = 0; return; } else { asfPrintError("Found unsupported or invalid GeoTIFF. Model type and raster type\n" "is undefined, and linear units are either undefined or of an unsupported\n" "type. Aborting...\n"); } } // Case: No valid keys found else { // All classification parameters are missing! *geographic_geotiff = *geocentric_geotiff = 0; *map_projected_geotiff = *geotiff_data_exists = 0; return; } } int check_for_datum_in_string(const char *citation, datum_type_t *datum) { int ret = 0; // not found return ret; } int check_for_ellipse_definition_in_geotiff(GTIF *input_gtif, spheroid_type_t *spheroid) { int ret = 0; // failure return ret; } char *angular_units_to_string(short angular_units) { return (angular_units == Angular_Radian) ? "Angular_Radian" : (angular_units == Angular_Degree) ? "Angular_Degree" : (angular_units == Angular_Arc_Minute) ? "Angular_Arc_Minute" : (angular_units == Angular_Arc_Second) ? "Angular_Arc_Second" : (angular_units == Angular_Grad) ? "Angular_Grad" : (angular_units == Angular_Gon) ? "Angular_Gon" : (angular_units == Angular_DMS) ? "Angular_DMS" : (angular_units == Angular_DMS_Hemisphere) ? "Angular_DMS_Hemisphere" : "Unrecognized unit"; } char *linear_units_to_string(short linear_units) { return (linear_units == Linear_Foot) ? "Linear_Foot" : (linear_units == Linear_Foot_US_Survey) ? "Linear_Foot_US_Survey" : (linear_units == Linear_Foot_Modified_American) ? "Linear_Foot_Modified_American" : (linear_units == Linear_Foot_Clarke) ? "Linear_Foot_Clarke" : (linear_units == Linear_Foot_Indian) ? "Linear_Foot_Indian" : (linear_units == Linear_Link) ? "Linear_Link" : (linear_units == Linear_Link_Benoit) ? "Linear_Link_Benoit" : (linear_units == Linear_Link_Sears) ? "Linear_Link_Sears" : (linear_units == Linear_Chain_Benoit) ? "Linear_Chain_Benoit" : (linear_units == Linear_Chain_Sears) ? "Linear_Chain_Sears" : (linear_units == Linear_Yard_Sears) ? "Linear_Yard_Sears" : (linear_units == Linear_Yard_Indian) ? "Linear_Yard_Indian" : (linear_units == Linear_Fathom) ? "Linear_Fathom" : (linear_units == Linear_Mile_International_Nautical) ? "Linear_Mile_International_Nautical" : "Unrecognized unit"; } void get_look_up_table_name(char *citation, char **look_up_table) { *look_up_table = (char *)MALLOC(256 * sizeof(char)); strcpy(*look_up_table, "UNKNOWN"); }
# <center> ЛАБОРАТОРНАЯ РАБОТА 8 </center> # <center> ЧИСЛЕНННОЕ ИНТЕГРИРОВАНИЕ </center> Теоретический материал к данной теме содержится в [1, глава 13]. ```python from sympy.solvers import solve from sympy import exp, sin, cos, sqrt, log, ln, pi from sympy import Rational as syR from sympy import Symbol, diff from scipy.misc import derivative import numpy as np import matplotlib.pyplot as plt %matplotlib inline ``` ## Задача 1. Вычислить значение интеграла $I=\int_1^{1.44} P_n(x) dx$, где $P_n(x)=\sum_{i=0}^n c_ix^i$, с помощью квадратурных формул трапеций и Симпсона для элементарного отрезка интегрирования. Оценить величину погрешности. Применяя те же квадратурные формулы для составного отрезка интегрирования, вычислить интеграл I с точностью 0.0001. Предварительно оценить шаг интегрирования, при котором достигается заданная точность. ## ПОРЯДОК РЕШЕНИЯ ЗАДАЧИ: 1. Вычислить значение интеграла I аналитически. 2. Задать многочлен $P_n(x)$. Вычислить значение интеграла I по формулам трапеций и Симпсона, считая отрезок $[1,1.44]$ элементарным отрезком интегрирования. 3. Найти абсолютные погрешности результатов. 4. Используя выражение для остаточных членов интегрирования, оценить шаги интегрирования, при которых величина погрешности каждой квадратурной формулы будет меньше 0.0001. 5. Вычислить значения интеграла по составной квадратурной формуле с найденным шагом. 6. Найти абсолютные погрешности результатов. Ваша коэффциенты при стеменях х: $co = {Task1[TASK_VARIANT][c0_latex]}$ $c1 = {Task1[TASK_VARIANT][c1_latex]}$ $c2 = {Task1[TASK_VARIANT][c2_latex]}$ $c3 = {Task1[TASK_VARIANT][c3_latex]}$ $c4 = {Task1[TASK_VARIANT][c4_latex]}$ ```python epsilon=10**(-4) #коэффициенты co = {Task1[TASK_VARIANT][c0_latex]} c1 = {Task1[TASK_VARIANT][c1_latex]} c2 = {Task1[TASK_VARIANT][c2_latex]} c3 = {Task1[TASK_VARIANT][c3_latex]} c4 = {Task1[TASK_VARIANT][c4_latex]} ``` Вычислите полученный интеграл аналитически. ```python #решение ``` Реализуйте метод трапеции. Если отрезок ${\displaystyle \left[a,b\right]}$ является элементарным и не подвергается дальнейшему разбиению, значение интеграла можно найти по формуле: $$\int _{a}^{b}f(x)\,dx={\frac {f(a)+f(b)}{2}}(b-a)$$ ```python #значение по методу трапеции ``` Реализуйте метод Симпсона. Формулой Симпсона называется интеграл от интерполяционного многочлена второй степени на отрезке [a,b]: $${\displaystyle {\int \limits _{a}^{b}f(x)dx}\approx {\int \limits _{a}^{b}{p_{2}(x)}dx}={\frac {b-a}{6}}{\left(f(a)+4f\left({\frac {a+b}{2}}\right)+f(b)\right)},} {\int \limits _{a}^{b}f(x)dx}\approx {\int \limits _{{a}}^{{b}}{p_{2}(x)}dx}={\frac {b-a}{6}}{\left(f(a)+4f\left({\frac {a+b}{2}}\right)+f(b)\right)},$$ ```python #решение методом Симпсона ``` Оцените погрешность в методе трапеций по следующей формуле: $$|R|=\frac{M_2(b-a)}{12}h^2, \quad M_2=max|f''(x)|, x \in [x,b]$$ ```python #код ``` ```python #код ``` ```python #ответ-погрешность ``` Оцените погрешность для метода Симпсона по формуле: $$|R|=\dfrac{M_4}{2880}(b - a)h^4$$ ```python #код ``` ```python #код ``` ```python #ответ-погрешность ``` Найдите асболютные значение погрености для метода трапеций. ```python #ответ-погрешнрость ``` Найдите асболютные значение погрености для метода Симпсона. ```python #ответ ``` Оцените шаги интегрирования, при которых величина погрешности каждой квадратурной формулы будет меньше 0.0001. ### Указание. Для метода трапеции: $R = \frac{M_2(b-a)h^2}{12}$, следовательно $h = \sqrt{\frac{12R}{M2(b-a)}}$ Для формулы Симпсона: $R = \frac{M_4(b-a)h^4}{2880}$, следовательно $h = \sqrt[4]{\frac{2880R}{M_4(b-a)}}$ ```python #ответ для трапеции ``` ```python #ответ для Сипмсона ``` Вычислите значения интеграла по составной квадратурной формуле с найденным шагом. Найдите абсолютные погрешности результатов ```python #код ``` ```python #код ``` ```python #код ``` ## Задача 3. Вычислить значение интеграла $\int_a^b f(x) dx$ аналитически и, используя формулу центральных прямоугольников, с шагами $h:\dfrac{b-a}{2}, \dfrac{b-a}{3}, ..., \dfrac{b-a}{20}$. При указанных значениях h найти абсолютную погрешность и оценки теоретической абсолютной погрешности. На одном чертеже построить графики найденных погрешностей. Ваши функции и отрезок интегрирования: $f3 = {Task1[TASK_VARIANT][f3_latex]}$ $[a;b] = [Task1[TASK_VARIANT][a];Task1[TASK_VARIANT][b]] $ ```python f3 = {Task1[TASK_VARIANT][f3_latex]} [a;b] = [Task1[TASK_VARIANT][a];Task1[TASK_VARIANT][b]] ``` Вычислите интеграл аналитически. ```python ``` Вычислите абсолютную погрешность при указанных значениях h. ```python # ``` ```python # ``` Найдите оценки теоретической абсолютной погрешности при указанных значениях h. ```python # ``` ```python # ``` Постройте графики найденных погрешностей на одном чертеже. ```python #график ``` #### ЛИТЕРАТУРА: 1. Амосов А.А., Дубинский Ю.А., Копченова Н.В. Вычислительные методы для инженеров. М.: Высшая школа, 1994. ```python ```
After Foliot 's failed candidacy as bishop , in February 1216 John appointed him to the benefice of Colwall in Herefordshire , the king having the ability to make the appointment because Giles de Braose , the Bishop of Hereford , who would normally have made the appointment , had recently died . Also from this time comes Foliot 's patronage of Robert Grosseteste , the theologian and future Bishop of Lincoln .
[STATEMENT] lemma is_rts: shows "rts resid" [PROOF STATE] proof (prove) goal (1 subgoal): 1. rts (\) [PROOF STEP] ..
(******************************************************************************) (* Project: Isabelle/UTP Toolkit *) (* File: Sequence.thy *) (* Authors: Simon Foster and Frank Zeyda *) (* Emails: [email protected] and [email protected] *) (******************************************************************************) section \<open> Infinite Sequences \<close> theory Infinite_Sequence imports HOL.Real List_Extra "HOL-Library.Sublist" "HOL-Library.Nat_Bijection" begin typedef 'a infseq = "UNIV :: (nat \<Rightarrow> 'a) set" by (auto) setup_lifting type_definition_infseq definition ssubstr :: "nat \<Rightarrow> nat \<Rightarrow> 'a infseq \<Rightarrow> 'a list" where "ssubstr i j xs = map (Rep_infseq xs) [i ..< j]" lift_definition nth_infseq :: "'a infseq \<Rightarrow> nat \<Rightarrow> 'a" (infixl "!\<^sub>s" 100) is "\<lambda> f i. f i" . abbreviation sinit :: "nat \<Rightarrow> 'a infseq \<Rightarrow> 'a list" where "sinit i xs \<equiv> ssubstr 0 i xs" lemma sinit_len [simp]: "length (sinit i xs) = i" by (simp add: ssubstr_def) lemma sinit_0 [simp]: "sinit 0 xs = []" by (simp add: ssubstr_def) lemma prefix_upt_0 [intro]: "i \<le> j \<Longrightarrow> prefix [0..<i] [0..<j]" by (induct i, auto, metis append_prefixD le0 prefix_order.lift_Suc_mono_le prefix_order.order_refl upt_Suc) lemma sinit_prefix: "i \<le> j \<Longrightarrow> prefix (sinit i xs) (sinit j xs)" by (simp add: map_mono_prefix prefix_upt_0 ssubstr_def) lemma sinit_strict_prefix: "i < j \<Longrightarrow> strict_prefix (sinit i xs) (sinit j xs)" by (metis sinit_len sinit_prefix le_less nat_neq_iff prefix_order.dual_order.strict_iff_order) lemma nth_sinit: "i < n \<Longrightarrow> sinit n xs ! i = xs !\<^sub>s i" apply (auto simp add: ssubstr_def) apply (transfer, auto) done lemma sinit_append_split: assumes "i < j" shows "sinit j xs = sinit i xs @ ssubstr i j xs" proof - have "[0..<i] @ [i..<j] = [0..<j]" by (metis assms le0 le_add_diff_inverse le_less upt_add_eq_append) thus ?thesis by (auto simp add: ssubstr_def, transfer, simp add: map_append[THEN sym]) qed lemma sinit_linear_asym_lemma1: assumes "asym R" "i < j" "(sinit i xs, sinit i ys) \<in> lexord R" "(sinit j ys, sinit j xs) \<in> lexord R" shows False proof - have sinit_xs: "sinit j xs = sinit i xs @ ssubstr i j xs" by (metis assms(2) sinit_append_split) have sinit_ys: "sinit j ys = sinit i ys @ ssubstr i j ys" by (metis assms(2) sinit_append_split) from sinit_xs sinit_ys assms(4) have "(sinit i ys, sinit i xs) \<in> lexord R \<or> (sinit i ys = sinit i xs \<and> (ssubstr i j ys, ssubstr i j xs) \<in> lexord R)" by (auto dest: lexord_append) with assms lexord_asymmetric show False by (force) qed lemma sinit_linear_asym_lemma2: assumes "asym R" "(sinit i xs, sinit i ys) \<in> lexord R" "(sinit j ys, sinit j xs) \<in> lexord R" shows False proof (cases i j rule: linorder_cases) case less with assms show ?thesis by (auto dest: sinit_linear_asym_lemma1) next case equal with assms show ?thesis by (simp add: lexord_asymmetric) next case greater with assms show ?thesis by (auto dest: sinit_linear_asym_lemma1) qed lemma range_ext: assumes "\<forall>i :: nat. \<forall>x\<in>{0..<i}. f(x) = g(x)" shows "f = g" proof (rule ext) fix x :: nat obtain i :: nat where "i > x" by (metis lessI) with assms show "f(x) = g(x)" by (auto) qed lemma sinit_ext: "(\<forall> i. sinit i xs = sinit i ys) \<Longrightarrow> xs = ys" by (simp add: ssubstr_def, transfer, auto intro: range_ext) definition infseq_lexord :: "'a rel \<Rightarrow> ('a infseq) rel" where "infseq_lexord R = {(xs, ys). (\<exists> i. (sinit i xs, sinit i ys) \<in> lexord R)}" lemma infseq_lexord_irreflexive: "\<forall>x. (x, x) \<notin> R \<Longrightarrow> (xs, xs) \<notin> infseq_lexord R" by (auto dest: lexord_irreflexive simp add: irrefl_def infseq_lexord_def) lemma infseq_lexord_irrefl: "irrefl R \<Longrightarrow> irrefl (infseq_lexord R)" by (simp add: irrefl_def infseq_lexord_irreflexive) lemma infseq_lexord_transitive: assumes "trans R" shows "trans (infseq_lexord R)" unfolding infseq_lexord_def proof (rule transI, clarify) fix xs ys zs :: "'a infseq" and m n :: nat assume las: "(sinit m xs, sinit m ys) \<in> lexord R" "(sinit n ys, sinit n zs) \<in> lexord R" hence inz: "m > 0" using gr0I by force from las(1) obtain i where sinitm: "(sinit m xs!i, sinit m ys!i) \<in> R" "i < m" "\<forall> j<i. sinit m xs!j = sinit m ys!j" using lexord_eq_length by force from las(2) obtain j where sinitn: "(sinit n ys!j, sinit n zs!j) \<in> R" "j < n" "\<forall> k<j. sinit n ys!k = sinit n zs!k" using lexord_eq_length by force show "\<exists>i. (sinit i xs, sinit i zs) \<in> lexord R" proof (cases "i \<le> j") case True note lt = this with sinitm sinitn have "(sinit n xs!i, sinit n zs!i) \<in> R" by (metis assms le_eq_less_or_eq le_less_trans nth_sinit transD) moreover from lt sinitm sinitn have "\<forall> j<i. sinit m xs!j = sinit m zs!j" by (metis less_le_trans less_trans nth_sinit) ultimately have "(sinit n xs, sinit n zs) \<in> lexord R" using sinitm(2) sinitn(2) lt apply (rule_tac lexord_intro_elems) apply (auto) apply (metis less_le_trans less_trans nth_sinit) done thus ?thesis by auto next case False then have ge: "i > j" by auto with assms sinitm sinitn have "(sinit n xs!j, sinit n zs!j) \<in> R" by (metis less_trans nth_sinit) moreover from ge sinitm sinitn have "\<forall> k<j. sinit m xs!k = sinit m zs!k" by (metis dual_order.strict_trans nth_sinit) ultimately have "(sinit n xs, sinit n zs) \<in> lexord R" using sinitm(2) sinitn(2) ge apply (rule_tac lexord_intro_elems) apply (auto) apply (metis less_trans nth_sinit) done thus ?thesis by auto qed qed lemma infseq_lexord_trans: "\<lbrakk> (xs, ys) \<in> infseq_lexord R; (ys, zs) \<in> infseq_lexord R; trans R \<rbrakk> \<Longrightarrow> (xs, zs) \<in> infseq_lexord R" by (meson infseq_lexord_transitive transE) lemma infseq_lexord_antisym: "\<lbrakk> asym R; (a, b) \<in> infseq_lexord R \<rbrakk> \<Longrightarrow> (b, a) \<notin> infseq_lexord R" by (auto dest: sinit_linear_asym_lemma2 simp add: infseq_lexord_def) lemma infseq_lexord_asym: assumes "asym R" shows "asym (infseq_lexord R)" by (meson assms asym.simps infseq_lexord_antisym infseq_lexord_irrefl) lemma infseq_lexord_total: assumes "total R" shows "total (infseq_lexord R)" using assms by (auto simp add: total_on_def infseq_lexord_def, meson lexord_linear sinit_ext) lemma infseq_lexord_strict_linear_order: assumes "strict_linear_order R" shows "strict_linear_order (infseq_lexord R)" using assms by (auto simp add: strict_linear_order_on_def partial_order_on_def preorder_on_def intro: infseq_lexord_transitive infseq_lexord_irrefl infseq_lexord_total) lemma infseq_lexord_linear: assumes "(\<forall> a b. (a,b)\<in> R \<or> a = b \<or> (b,a) \<in> R)" shows "(x,y) \<in> infseq_lexord R \<or> x = y \<or> (y,x) \<in> infseq_lexord R" proof - have "total R" using assms total_on_def by blast hence "total (infseq_lexord R)" using infseq_lexord_total by blast thus ?thesis by (auto simp add: total_on_def) qed instantiation infseq :: (ord) ord begin definition less_infseq :: "'a infseq \<Rightarrow> 'a infseq \<Rightarrow> bool" where "less_infseq xs ys \<longleftrightarrow> (xs, ys) \<in> infseq_lexord {(xs, ys). xs < ys}" definition less_eq_infseq :: "'a infseq \<Rightarrow> 'a infseq \<Rightarrow> bool" where "less_eq_infseq xs ys = (xs = ys \<or> xs < ys)" instance .. end instance infseq :: (order) order proof fix xs :: "'a infseq" show "xs \<le> xs" by (simp add: less_eq_infseq_def) next fix xs ys zs :: "'a infseq" assume "xs \<le> ys" and "ys \<le> zs" then show "xs \<le> zs" by (force dest: infseq_lexord_trans simp add: less_eq_infseq_def less_infseq_def trans_def) next fix xs ys :: "'a infseq" assume "xs \<le> ys" and "ys \<le> xs" then show "xs = ys" apply (auto simp add: less_eq_infseq_def less_infseq_def) apply (rule infseq_lexord_irreflexive [THEN notE]) defer apply (rule infseq_lexord_trans) apply (auto intro: transI) done next fix xs ys :: "'a infseq" show "xs < ys \<longleftrightarrow> xs \<le> ys \<and> \<not> ys \<le> xs" apply (auto simp add: less_infseq_def less_eq_infseq_def) defer apply (rule infseq_lexord_irreflexive [THEN notE]) apply auto apply (rule infseq_lexord_irreflexive [THEN notE]) defer apply (rule infseq_lexord_trans) apply (auto intro: transI) apply (simp add: infseq_lexord_irreflexive) done qed instance infseq :: (linorder) linorder proof fix xs ys :: "'a infseq" have "(xs, ys) \<in> infseq_lexord {(u, v). u < v} \<or> xs = ys \<or> (ys, xs) \<in> infseq_lexord {(u, v). u < v}" by (rule infseq_lexord_linear) auto then show "xs \<le> ys \<or> ys \<le> xs" by (auto simp add: less_eq_infseq_def less_infseq_def) qed lemma infseq_lexord_mono [mono]: "(\<And> x y. f x y \<longrightarrow> g x y) \<Longrightarrow> (xs, ys) \<in> infseq_lexord {(x, y). f x y} \<longrightarrow> (xs, ys) \<in> infseq_lexord {(x, y). g x y}" apply (auto simp add: infseq_lexord_def) apply (metis case_prodD case_prodI lexord_take_index_conv mem_Collect_eq) done fun insort_rel :: "'a rel \<Rightarrow> 'a \<Rightarrow> 'a list \<Rightarrow> 'a list" where "insort_rel R x [] = [x]" | "insort_rel R x (y # ys) = (if (x = y \<or> (x,y) \<in> R) then x # y # ys else y # insort_rel R x ys)" inductive sorted_rel :: "'a rel \<Rightarrow> 'a list \<Rightarrow> bool" where Nil_rel [iff]: "sorted_rel R []" | Cons_rel: "\<forall> y \<in> set xs. (x = y \<or> (x, y) \<in> R) \<Longrightarrow> sorted_rel R xs \<Longrightarrow> sorted_rel R (x # xs)" definition list_of_set :: "'a rel \<Rightarrow> 'a set \<Rightarrow> 'a list" where "list_of_set R = folding_on.F (insort_rel R) []" lift_definition infseq_inj :: "'a infseq infseq \<Rightarrow> 'a infseq" is "\<lambda> f i. f (fst (prod_decode i)) (snd (prod_decode i))" . lift_definition infseq_proj :: "'a infseq \<Rightarrow> 'a infseq infseq" is "\<lambda> f i j. f (prod_encode (i, j))" . lemma infseq_inj_inverse: "infseq_proj (infseq_inj x) = x" by (transfer, simp) lemma infseq_proj_inverse: "infseq_inj (infseq_proj x) = x" by (transfer, simp) lemma infseq_inj: "inj infseq_inj" by (metis injI infseq_inj_inverse) lemma infseq_inj_surj: "bij infseq_inj" apply (rule bijI) apply (auto simp add: infseq_inj) apply (metis rangeI infseq_proj_inverse) done end
function [ value, en ] = wew_a ( x ) %*****************************************************************************80 % %% WEW_A estimates Lambert's W function. % % Discussion: % % For a given X, this routine estimates the solution W of Lambert's % equation: % % X = W * EXP ( W ) % % This routine has higher accuracy than WEW_B. % % Modified: % % 11 June 2014 % % Reference: % % Fred Fritsch, R Shafer, W Crowley, % Algorithm 443: Solution of the transcendental equation w e^w = x, % Communications of the ACM, % October 1973, Volume 16, Number 2, pages 123-124. % % Parameters: % % Input, real X, the argument of W(X) % % Output, real VALUE, the estimated value of W(X). % % Output, real EN, the last relative correction to W(X). % c1 = 4.0 / 3.0; c2 = 7.0 / 3.0; c3 = 5.0 / 6.0; c4 = 2.0 / 3.0; % % Initial guess. % f = log ( x ); if ( x <= 6.46 ) wn = x .* ( 1.0 + c1 * x ) ./ ( 1.0 + x .* ( c2 + c3 * x ) ); zn = f - wn - log ( wn ); else wn = f; zn = - log ( wn ); end % % Iteration 1. % temp = 1.0 + wn; y = 2.0 * temp .* ( temp + c4 * zn ) - zn; wn = wn .* ( 1.0 + zn .* y ./ ( temp .* ( y - zn ) ) ); % % Iteration 2. % zn = f - wn - log ( wn ); temp = 1.0 + wn; temp2 = temp + c4 * zn; en = zn .* temp2 ./ ( temp .* temp2 - 0.5 * zn ); wn = wn .* ( 1.0 + en ); value = wn; return end
@testset "classify matrices" begin A = [0..2 1..1;-1.. -1 0..2] @test !is_H_matrix(A) @test !is_strongly_regular(A) B = [-2.. -2 1..1; 5..6 -2.. -2] @test is_strongly_regular(B) @test !is_Z_matrix(B) @test !is_M_matrix(B) C = [2..2 1..1; 0..2 2..2] @test is_H_matrix(C) @test !is_strictly_diagonally_dominant(C) D = [2..2 -1..0; -1..0 2..2] @test is_strictly_diagonally_dominant(D) @test is_Z_matrix(D) @test is_M_matrix(D) E = [2..4 -2..1;-1..2 2..4] @test !is_Z_matrix(E) @test !is_M_matrix(E) @test !is_H_matrix(E) @test is_strongly_regular(E) end
If $f$ is a function from a linearly ordered set $A$ to the real numbers such that for all $t \in (0,1)$ and all $x,y \in A$ with $x < y$, we have $f((1-t)x + ty) \leq (1-t)f(x) + tf(y)$, then $f$ is convex on $A$.
State Before: R : Type ?u.3551663 A : Type u_1 inst✝ : CommRing A ⊢ ↑(rescale (-1)) X = -X State After: no goals Tactic: rw [rescale_X, map_neg, map_one, neg_one_mul]
(* Copyright 2021 (C) Mihails Milehins *) section\<open>Smallness for cones and cocones\<close> theory CZH_ECAT_Small_Cone imports CZH_ECAT_Cone CZH_ECAT_Small_NTCF begin subsection\<open>Cone with tiny maps and cocone with tiny maps\<close> subsubsection\<open>Definition and elementary properties\<close> locale is_tm_cat_cone = is_ntcf \<alpha> \<JJ> \<CC> \<open>cf_const \<JJ> \<CC> c\<close> \<FF> \<NN> + NTCod: is_tm_functor \<alpha> \<JJ> \<CC> \<FF> for \<alpha> c \<JJ> \<CC> \<FF> \<NN> + assumes tm_cat_cone_obj[cat_cs_intros, cat_small_cs_intros]: "c \<in>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>" syntax "_is_tm_cat_cone" :: "V \<Rightarrow> V \<Rightarrow> V \<Rightarrow> V \<Rightarrow> V \<Rightarrow> V \<Rightarrow> bool" (\<open>(_ :/ _ <\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>n\<^sub>e _ :/ _ \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<index> _)\<close> [51, 51, 51, 51, 51] 51) translations "\<NN> : c <\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>n\<^sub>e \<FF> : \<JJ> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<CC>" \<rightleftharpoons> "CONST is_tm_cat_cone \<alpha> c \<JJ> \<CC> \<FF> \<NN>" locale is_tm_cat_cocone = is_ntcf \<alpha> \<JJ> \<CC> \<FF> \<open>cf_const \<JJ> \<CC> c\<close> \<NN> + NTDom: is_tm_functor \<alpha> \<JJ> \<CC> \<FF> for \<alpha> c \<JJ> \<CC> \<FF> \<NN> + assumes tm_cat_cocone_obj[cat_cs_intros, cat_small_cs_intros]: "c \<in>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>" syntax "_is_tm_cat_cocone" :: "V \<Rightarrow> V \<Rightarrow> V \<Rightarrow> V \<Rightarrow> V \<Rightarrow> V \<Rightarrow> bool" (\<open>(_ :/ _ >\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>c\<^sub>o\<^sub>n\<^sub>e _ :/ _ \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<index> _)\<close> [51, 51, 51, 51, 51] 51) translations "\<NN> : \<FF> >\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>c\<^sub>o\<^sub>n\<^sub>e c : \<JJ> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<CC>" \<rightleftharpoons> "CONST is_tm_cat_cocone \<alpha> c \<JJ> \<CC> \<FF> \<NN>" text\<open>Rules.\<close> lemma (in is_tm_cat_cone) is_tm_cat_cone_axioms'[ cat_cs_intros, cat_small_cs_intros ]: assumes "\<alpha>' = \<alpha>" and "c' = c" and "\<JJ>' = \<JJ>" and "\<CC>' = \<CC>" and "\<FF>' = \<FF>" shows "\<NN> : c' <\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>n\<^sub>e \<FF>' : \<JJ>' \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>'\<^esub> \<CC>'" unfolding assms by (rule is_tm_cat_cone_axioms) mk_ide rf is_tm_cat_cone_def[unfolded is_tm_cat_cone_axioms_def] |intro is_tm_cat_coneI| |dest is_tm_cat_coneD[dest!]| |elim is_tm_cat_coneE[elim!]| lemma (in is_tm_cat_cocone) is_tm_cat_cocone_axioms'[ cat_cs_intros, cat_small_cs_intros ]: assumes "\<alpha>' = \<alpha>" and "c' = c" and "\<JJ>' = \<JJ>" and "\<CC>' = \<CC>" and "\<FF>' = \<FF>" shows "\<NN> : \<FF>' >\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>c\<^sub>o\<^sub>n\<^sub>e c' : \<JJ>' \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>'\<^esub> \<CC>'" unfolding assms by (rule is_tm_cat_cocone_axioms) mk_ide rf is_tm_cat_cocone_def[unfolded is_tm_cat_cocone_axioms_def] |intro is_tm_cat_coconeI| |dest is_tm_cat_coconeD[dest!]| |elim is_tm_cat_coconeE[elim!]| text\<open>Duality.\<close> lemma (in is_tm_cat_cone) is_tm_cat_cocone_op: "op_ntcf \<NN> : op_cf \<FF> >\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>c\<^sub>o\<^sub>n\<^sub>e c : op_cat \<JJ> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> op_cat \<CC>" by (intro is_tm_cat_coconeI) ( cs_concl cs_shallow cs_simp: cat_op_simps cs_intro: cat_cs_intros cat_op_intros )+ lemma (in is_tm_cat_cone) is_tm_cat_cocone_op'[cat_op_intros]: assumes "\<alpha>' = \<alpha>" and "\<JJ>' = op_cat \<JJ>" and "\<CC>' = op_cat \<CC>" and "\<FF>' = op_cf \<FF>" shows "op_ntcf \<NN> : \<FF>' >\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>c\<^sub>o\<^sub>n\<^sub>e c : \<JJ>' \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>'\<^esub> \<CC>'" unfolding assms by (rule is_tm_cat_cocone_op) lemmas [cat_op_intros] = is_tm_cat_cone.is_tm_cat_cocone_op' lemma (in is_tm_cat_cocone) is_tm_cat_cone_op: "op_ntcf \<NN> : c <\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>n\<^sub>e op_cf \<FF> : op_cat \<JJ> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> op_cat \<CC>" by (intro is_tm_cat_coneI) ( cs_concl cs_shallow cs_simp: cat_op_simps cs_intro: cat_cs_intros cat_op_intros ) lemma (in is_tm_cat_cocone) is_tm_cat_cone_op'[cat_op_intros]: assumes "\<alpha>' = \<alpha>" and "\<JJ>' = op_cat \<JJ>" and "\<CC>' = op_cat \<CC>" and "\<FF>' = op_cf \<FF>" shows "op_ntcf \<NN> : c <\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>n\<^sub>e \<FF>' : \<JJ>' \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>'\<^esub> \<CC>'" unfolding assms by (rule is_tm_cat_cone_op) lemmas [cat_op_intros] = is_cat_cocone.is_cat_cone_op' text\<open>Elementary properties.\<close> lemma (in is_tm_cat_cone) tm_cat_cone_is_tm_ntcf'[ cat_cs_intros, cat_small_cs_intros ]: assumes "c' = cf_const \<JJ> \<CC> c" shows "\<NN> : c' \<mapsto>\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m \<FF> : \<JJ> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<CC>" unfolding assms proof(intro is_tm_ntcfI') interpret \<FF>: is_tm_functor \<alpha> \<JJ> \<CC> \<FF> by (rule NTCod.is_tm_functor_axioms) show "cf_const \<JJ> \<CC> c : \<JJ> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<CC>" by (cs_concl cs_intro: cat_small_cs_intros cat_cs_intros) qed (cs_concl cs_shallow cs_intro: cat_small_cs_intros cat_cs_intros assms)+ lemmas [cat_small_cs_intros] = is_tm_cat_cone.tm_cat_cone_is_tm_ntcf' sublocale is_tm_cat_cone \<subseteq> is_tm_ntcf \<alpha> \<JJ> \<CC> \<open>cf_const \<JJ> \<CC> c\<close> \<FF> \<NN> by (intro tm_cat_cone_is_tm_ntcf') simp lemma (in is_tm_cat_cocone) tm_cat_cocone_is_tm_ntcf'[ cat_cs_intros, cat_small_cs_intros ]: assumes "c' = cf_const \<JJ> \<CC> c" shows "\<NN> : \<FF> \<mapsto>\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m c' : \<JJ> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<CC>" unfolding assms proof(intro is_tm_ntcfI') interpret \<FF>: is_tm_functor \<alpha> \<JJ> \<CC> \<FF> by (rule NTDom.is_tm_functor_axioms) show "cf_const \<JJ> \<CC> c : \<JJ> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<CC>" by (cs_concl cs_intro: cat_small_cs_intros cat_cs_intros) qed (cs_concl cs_shallow cs_intro: cat_small_cs_intros cat_cs_intros assms)+ lemmas [cat_small_cs_intros, cat_cs_intros] = is_tm_cat_cocone.tm_cat_cocone_is_tm_ntcf' sublocale is_tm_cat_cocone \<subseteq> is_tm_ntcf \<alpha> \<JJ> \<CC> \<FF> \<open>cf_const \<JJ> \<CC> c\<close> \<NN> by (intro tm_cat_cocone_is_tm_ntcf') simp sublocale is_tm_cat_cone \<subseteq> is_cat_cone by (intro is_cat_coneI, rule is_ntcf_axioms, rule tm_cat_cone_obj) lemmas (in is_tm_cat_cone) tm_cat_cone_is_cat_cone = is_cat_cone_axioms lemmas [cat_small_cs_intros] = is_tm_cat_cone.tm_cat_cone_is_cat_cone sublocale is_tm_cat_cocone \<subseteq> is_cat_cocone by (intro is_cat_coconeI, rule is_ntcf_axioms, rule tm_cat_cocone_obj) lemmas (in is_tm_cat_cocone) tm_cat_cocone_is_cat_cocone = is_cat_cocone_axioms lemmas [cat_small_cs_intros] = is_tm_cat_cocone.tm_cat_cocone_is_cat_cocone subsubsection\<open> Vertical composition of a natural transformation with tiny maps and a cone with tiny maps \<close> lemma ntcf_vcomp_is_tm_cat_cone[cat_cs_intros]: assumes "\<MM> : \<GG> \<mapsto>\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m \<HH> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<BB>" and "\<NN> : a <\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>n\<^sub>e \<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<BB>" shows "\<MM> \<bullet>\<^sub>N\<^sub>T\<^sub>C\<^sub>F \<NN> : a <\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>n\<^sub>e \<HH> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<BB>" by ( intro is_tm_cat_coneI ntcf_vcomp_is_ntcf; (rule is_tm_ntcfD'[OF assms(1)])?; (intro is_tm_cat_coneD[OF assms(2)])? ) subsubsection\<open> Composition of a functor and a cone with tiny maps, composition of a functor and a cocone with tiny maps \<close> lemma cf_ntcf_comp_tm_cf_tm_cat_cone: assumes "\<NN> : c <\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>n\<^sub>e \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<BB>" and "\<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>" and "\<GG> \<circ>\<^sub>C\<^sub>F \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<CC>" shows "\<GG> \<circ>\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F \<NN> : \<GG>\<lparr>ObjMap\<rparr>\<lparr>c\<rparr> <\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>n\<^sub>e \<GG> \<circ>\<^sub>C\<^sub>F \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<CC>" proof- interpret \<NN>: is_tm_cat_cone \<alpha> c \<AA> \<BB> \<FF> \<NN> by (rule assms(1)) interpret \<GG>: is_functor \<alpha> \<BB> \<CC> \<GG> by (rule assms(2)) interpret \<GG>\<FF>: is_tm_functor \<alpha> \<AA> \<CC> \<open>\<GG> \<circ>\<^sub>C\<^sub>F \<FF>\<close> by (rule assms(3)) show ?thesis by (intro is_tm_cat_coneI) (cs_concl cs_intro: cat_small_cs_intros cat_cs_intros is_cat_coneD)+ qed lemma cf_ntcf_comp_tm_cf_tm_cat_cone'[cat_small_cs_intros]: assumes "\<NN> : c <\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>n\<^sub>e \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<BB>" and "\<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>" and "\<GG> \<circ>\<^sub>C\<^sub>F \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<CC>" and "c' = \<GG>\<lparr>ObjMap\<rparr>\<lparr>c\<rparr>" and "\<GG>\<FF> = \<GG> \<circ>\<^sub>C\<^sub>F \<FF>" shows "\<GG> \<circ>\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F \<NN> : c' <\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>n\<^sub>e \<GG>\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<CC>" using assms(1,2,3) unfolding assms(4,5) by (rule cf_ntcf_comp_tm_cf_tm_cat_cone) lemma cf_ntcf_comp_tm_cf_tm_cat_cocone: assumes "\<NN> : \<FF> >\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>c\<^sub>o\<^sub>n\<^sub>e c : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<BB>" and "\<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>" and "\<GG> \<circ>\<^sub>C\<^sub>F \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<CC>" shows "\<GG> \<circ>\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F \<NN> : \<GG> \<circ>\<^sub>C\<^sub>F \<FF> >\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>c\<^sub>o\<^sub>n\<^sub>e \<GG>\<lparr>ObjMap\<rparr>\<lparr>c\<rparr> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<CC>" proof- interpret \<NN>: is_tm_cat_cocone \<alpha> c \<AA> \<BB> \<FF> \<NN> by (rule assms(1)) interpret \<GG>: is_functor \<alpha> \<BB> \<CC> \<GG> by (rule assms(2)) interpret \<GG>\<FF>: is_tm_functor \<alpha> \<AA> \<CC> \<open>\<GG> \<circ>\<^sub>C\<^sub>F \<FF>\<close> by (rule assms(3)) show ?thesis by ( rule is_tm_cat_cone.is_tm_cat_cocone_op [ OF cf_ntcf_comp_tm_cf_tm_cat_cone[ OF \<NN>.is_tm_cat_cone_op \<GG>.is_functor_op, unfolded cat_op_simps ], OF \<GG>\<FF>.is_tm_functor_op[unfolded cat_op_simps], unfolded cat_op_simps ] ) qed lemma cf_ntcf_comp_tm_cf_tm_cat_cocone'[cat_small_cs_intros]: assumes "\<NN> : \<FF> >\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>c\<^sub>o\<^sub>n\<^sub>e c : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<BB>" and "\<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>" and "\<GG> \<circ>\<^sub>C\<^sub>F \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<CC>" and "c' = \<GG>\<lparr>ObjMap\<rparr>\<lparr>c\<rparr>" and "\<GG>\<FF> = \<GG> \<circ>\<^sub>C\<^sub>F \<FF>" shows "\<GG> \<circ>\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F \<NN> : \<GG>\<FF> >\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>c\<^sub>o\<^sub>n\<^sub>e c' : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<CC>" using assms(1-3) unfolding assms(4,5) by (rule cf_ntcf_comp_tm_cf_tm_cat_cocone) subsubsection\<open> Cones and cocones with tiny maps and constant natural transformations \<close> lemma ntcf_vcomp_ntcf_const_is_tm_cat_cone: assumes "\<NN> : b <\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>n\<^sub>e \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<BB>" and "f : a \<mapsto>\<^bsub>\<BB>\<^esub> b" shows "\<NN> \<bullet>\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_const \<AA> \<BB> f : a <\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>n\<^sub>e \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<BB>" proof- interpret \<NN>: is_tm_cat_cone \<alpha> b \<AA> \<BB> \<FF> \<NN> by (rule assms(1)) from assms(2) show ?thesis by (intro is_tm_cat_coneI) (cs_concl cs_intro: cat_small_cs_intros cat_cs_intros) qed lemma ntcf_vcomp_ntcf_const_is_tm_cat_cone'[cat_small_cs_intros]: assumes "\<NN> : b <\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>n\<^sub>e \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<BB>" and "\<MM> = ntcf_const \<AA> \<BB> f" and "f : a \<mapsto>\<^bsub>\<BB>\<^esub> b" shows "\<NN> \<bullet>\<^sub>N\<^sub>T\<^sub>C\<^sub>F \<MM> : a <\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>n\<^sub>e \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<BB>" using assms(1,3) unfolding assms(2) by (rule ntcf_vcomp_ntcf_const_is_tm_cat_cone) lemma ntcf_vcomp_ntcf_const_is_tm_cat_cocone: assumes "\<NN> : \<FF> >\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>c\<^sub>o\<^sub>n\<^sub>e a : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<BB>" and "f : a \<mapsto>\<^bsub>\<BB>\<^esub> b" shows "ntcf_const \<AA> \<BB> f \<bullet>\<^sub>N\<^sub>T\<^sub>C\<^sub>F \<NN> : \<FF> >\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>c\<^sub>o\<^sub>n\<^sub>e b : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<BB>" proof- interpret \<NN>: is_tm_cat_cocone \<alpha> a \<AA> \<BB> \<FF> \<NN> by (rule assms(1)) from is_tm_cat_cone.is_tm_cat_cocone_op [ OF ntcf_vcomp_ntcf_const_is_tm_cat_cone[ OF \<NN>.is_tm_cat_cone_op, unfolded cat_op_simps, OF assms(2) ], unfolded cat_op_simps, folded op_ntcf_ntcf_const ] assms(2) show ?thesis by (cs_prems cs_simp: cat_op_simps cs_intro: cat_cs_intros cat_op_intros) qed lemma ntcf_vcomp_ntcf_const_is_tm_cat_cocone'[cat_cs_intros]: assumes "\<NN> : \<FF> >\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>c\<^sub>o\<^sub>n\<^sub>e a : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<BB>" and "\<MM> = ntcf_const \<AA> \<BB> f" and "f : a \<mapsto>\<^bsub>\<BB>\<^esub> b" shows "\<MM> \<bullet>\<^sub>N\<^sub>T\<^sub>C\<^sub>F \<NN> : \<FF> >\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m\<^sub>.\<^sub>c\<^sub>o\<^sub>c\<^sub>o\<^sub>n\<^sub>e b : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<BB>" using assms(1,3) unfolding assms(2) by (rule ntcf_vcomp_ntcf_const_is_tm_cat_cocone) subsection\<open>Small cone and small cocone functors\<close>(*TODO: duality automation*) subsubsection\<open>Definition and elementary properties\<close> definition tm_cf_Cone :: "V \<Rightarrow> V \<Rightarrow> V" where "tm_cf_Cone \<alpha> \<FF> = Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>cat_Funct \<alpha> (\<FF>\<lparr>HomDom\<rparr>) (\<FF>\<lparr>HomCod\<rparr>)(-,cf_map \<FF>) \<circ>\<^sub>C\<^sub>F op_cf (\<Delta>\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m \<alpha> (\<FF>\<lparr>HomDom\<rparr>) (\<FF>\<lparr>HomCod\<rparr>))" definition tm_cf_Cocone :: "V \<Rightarrow> V \<Rightarrow> V" where "tm_cf_Cocone \<alpha> \<FF> = Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>cat_Funct \<alpha> (\<FF>\<lparr>HomDom\<rparr>) (\<FF>\<lparr>HomCod\<rparr>)(cf_map \<FF>,-) \<circ>\<^sub>C\<^sub>F (\<Delta>\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m \<alpha> (\<FF>\<lparr>HomDom\<rparr>) (\<FF>\<lparr>HomCod\<rparr>))" text\<open>Alternative definitions.\<close> context is_tm_functor begin lemma tm_cf_Cone_def': "tm_cf_Cone \<alpha> \<FF> = Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>cat_Funct \<alpha> \<AA> \<BB>(-,cf_map \<FF>) \<circ>\<^sub>C\<^sub>F op_cf (\<Delta>\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m \<alpha> \<AA> \<BB>)" unfolding tm_cf_Cone_def cat_cs_simps by simp lemma tm_cf_Cocone_def': "tm_cf_Cocone \<alpha> \<FF> = Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>cat_Funct \<alpha> \<AA> \<BB>(cf_map \<FF>,-) \<circ>\<^sub>C\<^sub>F (\<Delta>\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m \<alpha> \<AA> \<BB>)" unfolding tm_cf_Cocone_def cat_cs_simps by simp end subsubsection\<open>Object map\<close> lemma (in is_tm_functor) tm_cf_Cone_ObjMap_vsv[cat_small_cs_intros]: "vsv (tm_cf_Cone \<alpha> \<FF>\<lparr>ObjMap\<rparr>)" proof- interpret \<Delta>: is_functor \<alpha> \<BB> \<open>cat_Funct \<alpha> \<AA> \<BB>\<close> \<open>\<Delta>\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m \<alpha> \<AA> \<BB>\<close> by (cs_concl cs_shallow cs_intro: cat_small_cs_intros cat_cs_intros) show ?thesis unfolding tm_cf_Cone_def by ( cs_concl cs_shallow cs_simp: cat_cs_simps cat_FUNCT_cs_simps cat_op_simps cs_intro: cat_small_cs_intros cat_cs_intros cat_FUNCT_cs_intros cat_op_intros ) qed lemmas [cat_small_cs_intros] = is_tm_functor.tm_cf_Cone_ObjMap_vsv lemma (in is_tm_functor) tm_cf_Cocone_ObjMap_vsv[cat_small_cs_intros]: "vsv (tm_cf_Cocone \<alpha> \<FF>\<lparr>ObjMap\<rparr>)" proof- interpret \<Delta>: is_functor \<alpha> \<BB> \<open>cat_Funct \<alpha> \<AA> \<BB>\<close> \<open>\<Delta>\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m \<alpha> \<AA> \<BB>\<close> by (cs_concl cs_shallow cs_intro: cat_small_cs_intros cat_cs_intros) show ?thesis unfolding tm_cf_Cocone_def by ( cs_concl cs_shallow cs_simp: cat_cs_simps cat_FUNCT_cs_simps cs_intro: cat_small_cs_intros cat_cs_intros cat_FUNCT_cs_intros ) qed lemmas [cat_small_cs_intros] = is_tm_functor.tm_cf_Cocone_ObjMap_vsv lemma (in is_tm_functor) tm_cf_Cone_ObjMap_vdomain[cat_small_cs_simps]: assumes "b \<in>\<^sub>\<circ> \<BB>\<lparr>Obj\<rparr>" shows "\<D>\<^sub>\<circ> (tm_cf_Cone \<alpha> \<FF>\<lparr>ObjMap\<rparr>) = \<BB>\<lparr>Obj\<rparr>" proof- from assms interpret \<Delta>: is_functor \<alpha> \<BB> \<open>cat_Funct \<alpha> \<AA> \<BB>\<close> \<open>\<Delta>\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m \<alpha> \<AA> \<BB>\<close> by (cs_concl cs_shallow cs_intro: cat_small_cs_intros cat_cs_intros) from assms show ?thesis unfolding tm_cf_Cone_def' by ( cs_concl cs_shallow cs_simp: cat_cs_simps cat_FUNCT_cs_simps cat_op_simps cs_intro: cat_small_cs_intros cat_cs_intros cat_FUNCT_cs_intros cat_op_intros ) qed lemmas [cat_small_cs_simps] = is_tm_functor.tm_cf_Cone_ObjMap_vdomain lemma (in is_tm_functor) tm_cf_Cocone_ObjMap_vdomain[cat_small_cs_simps]: assumes "b \<in>\<^sub>\<circ> \<BB>\<lparr>Obj\<rparr>" shows "\<D>\<^sub>\<circ> (tm_cf_Cocone \<alpha> \<FF>\<lparr>ObjMap\<rparr>) = \<BB>\<lparr>Obj\<rparr>" proof- from assms interpret \<Delta>: is_functor \<alpha> \<BB> \<open>cat_Funct \<alpha> \<AA> \<BB>\<close> \<open>\<Delta>\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m \<alpha> \<AA> \<BB>\<close> by (cs_concl cs_shallow cs_intro: cat_small_cs_intros cat_cs_intros) from assms show ?thesis unfolding tm_cf_Cocone_def' by ( cs_concl cs_shallow cs_simp: cat_cs_simps cat_FUNCT_cs_simps cat_op_simps cs_intro: cat_small_cs_intros cat_cs_intros cat_FUNCT_cs_intros cat_op_intros ) qed lemmas [cat_small_cs_simps] = is_tm_functor.tm_cf_Cocone_ObjMap_vdomain lemma (in is_tm_functor) tm_cf_Cone_ObjMap_app[cat_small_cs_simps]: assumes "b \<in>\<^sub>\<circ> \<BB>\<lparr>Obj\<rparr>" shows "tm_cf_Cone \<alpha> \<FF>\<lparr>ObjMap\<rparr>\<lparr>b\<rparr> = Hom (cat_Funct \<alpha> \<AA> \<BB>) (cf_map (cf_const \<AA> \<BB> b)) (cf_map \<FF>)" proof- from assms interpret \<Delta>: is_functor \<alpha> \<BB> \<open>cat_Funct \<alpha> \<AA> \<BB>\<close> \<open>\<Delta>\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m \<alpha> \<AA> \<BB>\<close> by (cs_concl cs_shallow cs_intro: cat_small_cs_intros cat_cs_intros) from assms show ?thesis unfolding tm_cf_Cone_def by ( cs_concl cs_simp: cat_small_cs_simps cat_cs_simps cat_FUNCT_cs_simps cat_op_simps cs_intro: cat_small_cs_intros cat_cs_intros cat_FUNCT_cs_intros cat_op_intros ) qed lemmas [cat_small_cs_simps] = is_tm_functor.tm_cf_Cone_ObjMap_app lemma (in is_tm_functor) tm_cf_Cocone_ObjMap_app[cat_small_cs_simps]: assumes "b \<in>\<^sub>\<circ> \<BB>\<lparr>Obj\<rparr>" shows "tm_cf_Cocone \<alpha> \<FF>\<lparr>ObjMap\<rparr>\<lparr>b\<rparr> = Hom (cat_Funct \<alpha> \<AA> \<BB>) (cf_map \<FF>) (cf_map (cf_const \<AA> \<BB> b))" proof- from assms interpret \<Delta>: is_functor \<alpha> \<BB> \<open>cat_Funct \<alpha> \<AA> \<BB>\<close> \<open>\<Delta>\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m \<alpha> \<AA> \<BB>\<close> by (cs_concl cs_shallow cs_intro: cat_small_cs_intros cat_cs_intros) from assms show ?thesis unfolding tm_cf_Cocone_def by ( cs_concl cs_shallow cs_simp: cat_small_cs_simps cat_cs_simps cat_FUNCT_cs_simps cat_op_simps cs_intro: cat_small_cs_intros cat_cs_intros cat_FUNCT_cs_intros ) qed lemmas [cat_small_cs_simps] = is_tm_functor.tm_cf_Cocone_ObjMap_app subsubsection\<open>Arrow map\<close> lemma (in is_tm_functor) tm_cf_Cone_ArrMap_vsv[cat_small_cs_intros]: "vsv (tm_cf_Cone \<alpha> \<FF>\<lparr>ArrMap\<rparr>)" proof- interpret \<Delta>: is_functor \<alpha> \<BB> \<open>cat_Funct \<alpha> \<AA> \<BB>\<close> \<open>\<Delta>\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m \<alpha> \<AA> \<BB>\<close> by (cs_concl cs_shallow cs_intro: cat_small_cs_intros cat_cs_intros) show ?thesis unfolding tm_cf_Cone_def by ( cs_concl cs_shallow cs_simp: cat_cs_simps cat_FUNCT_cs_simps cat_op_simps cs_intro: cat_small_cs_intros cat_cs_intros cat_FUNCT_cs_intros cat_op_intros ) qed lemmas [cat_small_cs_intros] = is_tm_functor.tm_cf_Cone_ArrMap_vsv lemma (in is_tm_functor) tm_cf_Cocone_ArrMap_vsv[cat_small_cs_intros]: "vsv (tm_cf_Cocone \<alpha> \<FF>\<lparr>ArrMap\<rparr>)" proof- interpret \<Delta>: is_functor \<alpha> \<BB> \<open>cat_Funct \<alpha> \<AA> \<BB>\<close> \<open>\<Delta>\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m \<alpha> \<AA> \<BB>\<close> by (cs_concl cs_shallow cs_intro: cat_small_cs_intros cat_cs_intros) show ?thesis unfolding tm_cf_Cocone_def by ( cs_concl cs_shallow cs_simp: cat_cs_simps cat_FUNCT_cs_simps cat_op_simps cs_intro: cat_small_cs_intros cat_cs_intros cat_FUNCT_cs_intros cat_op_intros ) qed lemmas [cat_small_cs_intros] = is_tm_functor.tm_cf_Cocone_ArrMap_vsv lemma (in is_tm_functor) tm_cf_Cone_ArrMap_vdomain[cat_small_cs_simps]: assumes "b \<in>\<^sub>\<circ> \<BB>\<lparr>Obj\<rparr>" shows "\<D>\<^sub>\<circ> (tm_cf_Cone \<alpha> \<FF>\<lparr>ArrMap\<rparr>) = \<BB>\<lparr>Arr\<rparr>" proof- interpret \<Delta>: is_functor \<alpha> \<BB> \<open>cat_Funct \<alpha> \<AA> \<BB>\<close> \<open>\<Delta>\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m \<alpha> \<AA> \<BB>\<close> by (cs_concl cs_shallow cs_intro: cat_small_cs_intros cat_cs_intros) from assms show ?thesis unfolding tm_cf_Cone_def' by ( cs_concl cs_shallow cs_simp: cat_cs_simps cat_FUNCT_cs_simps cat_op_simps cs_intro: cat_small_cs_intros cat_cs_intros cat_FUNCT_cs_intros cat_op_intros ) qed lemmas [cat_small_cs_simps] = is_tm_functor.tm_cf_Cone_ArrMap_vdomain lemma (in is_tm_functor) tm_cf_Cocone_ArrMap_vdomain[cat_small_cs_simps]: assumes "b \<in>\<^sub>\<circ> \<BB>\<lparr>Obj\<rparr>" shows "\<D>\<^sub>\<circ> (tm_cf_Cocone \<alpha> \<FF>\<lparr>ArrMap\<rparr>) = \<BB>\<lparr>Arr\<rparr>" proof- interpret \<Delta>: is_functor \<alpha> \<BB> \<open>cat_Funct \<alpha> \<AA> \<BB>\<close> \<open>\<Delta>\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m \<alpha> \<AA> \<BB>\<close> by (cs_concl cs_shallow cs_intro: cat_small_cs_intros cat_cs_intros) from assms show ?thesis unfolding tm_cf_Cocone_def' by ( cs_concl cs_shallow cs_simp: cat_cs_simps cat_FUNCT_cs_simps cat_op_simps cs_intro: cat_small_cs_intros cat_cs_intros cat_FUNCT_cs_intros ) qed lemmas [cat_small_cs_simps] = is_tm_functor.tm_cf_Cocone_ArrMap_vdomain lemma (in is_tm_functor) tm_cf_Cone_ArrMap_app[cat_small_cs_simps]: assumes "f : a \<mapsto>\<^bsub>\<BB>\<^esub> b" shows "tm_cf_Cone \<alpha> \<FF>\<lparr>ArrMap\<rparr>\<lparr>f\<rparr> = cf_hom (cat_Funct \<alpha> \<AA> \<BB>) [ntcf_arrow (ntcf_const \<AA> \<BB> f), cat_Funct \<alpha> \<AA> \<BB>\<lparr>CId\<rparr>\<lparr>cf_map \<FF>\<rparr>]\<^sub>\<circ>" proof- interpret \<Delta>: is_functor \<alpha> \<BB> \<open>cat_Funct \<alpha> \<AA> \<BB>\<close> \<open>\<Delta>\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m \<alpha> \<AA> \<BB>\<close> by (cs_concl cs_shallow cs_intro: cat_small_cs_intros cat_cs_intros) from assms show ?thesis unfolding tm_cf_Cone_def by ( cs_concl cs_simp: cat_cs_simps cat_FUNCT_cs_simps cat_op_simps cs_intro: cat_small_cs_intros cat_cs_intros cat_FUNCT_cs_intros cat_op_intros ) qed lemmas [cat_small_cs_simps] = is_tm_functor.tm_cf_Cone_ArrMap_app lemma (in is_tm_functor) tm_cf_Cocone_ArrMap_app[cat_small_cs_simps]: assumes "f : a \<mapsto>\<^bsub>\<BB>\<^esub> b" shows "tm_cf_Cocone \<alpha> \<FF>\<lparr>ArrMap\<rparr>\<lparr>f\<rparr> = cf_hom (cat_Funct \<alpha> \<AA> \<BB>) [cat_Funct \<alpha> \<AA> \<BB>\<lparr>CId\<rparr>\<lparr>cf_map \<FF>\<rparr>, ntcf_arrow (ntcf_const \<AA> \<BB> f)]\<^sub>\<circ>" proof- interpret \<Delta>: is_functor \<alpha> \<BB> \<open>cat_Funct \<alpha> \<AA> \<BB>\<close> \<open>\<Delta>\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m \<alpha> \<AA> \<BB>\<close> by (cs_concl cs_shallow cs_intro: cat_small_cs_intros cat_cs_intros) from assms show ?thesis unfolding tm_cf_Cocone_def by ( cs_concl cs_simp: cat_cs_simps cat_FUNCT_cs_simps cat_op_simps cat_op_simps cs_intro: cat_small_cs_intros cat_cs_intros cat_FUNCT_cs_intros cat_op_intros ) qed lemmas [cat_small_cs_simps] = is_tm_functor.tm_cf_Cocone_ArrMap_app subsubsection\<open>Small cone functor and small cocone functor are functors\<close> lemma (in is_tm_functor) tm_cf_cf_Cone_is_functor: "tm_cf_Cone \<alpha> \<FF> : op_cat \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> cat_Set \<alpha>" proof- interpret \<AA>\<BB>: category \<alpha> \<open>cat_Funct \<alpha> \<AA> \<BB>\<close> by ( cs_concl cs_shallow cs_intro: cat_small_cs_intros cat_cs_intros cat_FUNCT_cs_intros ) interpret op_\<Delta>: is_functor \<alpha> \<open>op_cat \<BB>\<close> \<open>op_cat (cat_Funct \<alpha> \<AA> \<BB>)\<close> \<open>op_cf (\<Delta>\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m \<alpha> \<AA> \<BB>)\<close> by ( cs_concl cs_shallow cs_intro: cat_small_cs_intros cat_cs_intros cat_op_intros ) have "Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>cat_Funct \<alpha> \<AA> \<BB>(-,cf_map \<FF>) : op_cat (cat_Funct \<alpha> \<AA> \<BB>) \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> cat_Set \<alpha>" by ( cs_concl cs_shallow cs_simp: cat_FUNCT_cs_simps cs_intro: cat_small_cs_intros cat_cs_intros cat_FUNCT_cs_intros ) then show "tm_cf_Cone \<alpha> \<FF> : op_cat \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> cat_Set \<alpha>" unfolding tm_cf_Cone_def' by (cs_concl cs_intro: cat_cs_intros) qed lemma (in is_tm_functor) tm_cf_cf_Cone_is_functor'[cat_small_cs_intros]: assumes "\<AA>' = op_cat \<BB>" and "\<BB>' = cat_Set \<alpha>" and "\<alpha>' = \<alpha>" shows "tm_cf_Cone \<alpha> \<FF> : \<AA>' \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>'\<^esub> \<BB>'" unfolding assms by (rule tm_cf_cf_Cone_is_functor) lemmas [cat_small_cs_intros] = is_tm_functor.tm_cf_cf_Cone_is_functor' lemma (in is_tm_functor) tm_cf_cf_Cocone_is_functor: "tm_cf_Cocone \<alpha> \<FF> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> cat_Set \<alpha>" proof- interpret Funct: category \<alpha> \<open>cat_Funct \<alpha> \<AA> \<BB>\<close> by ( cs_concl cs_shallow cs_intro: cat_small_cs_intros cat_cs_intros cat_FUNCT_cs_intros ) interpret \<Delta>: is_functor \<alpha> \<BB> \<open>cat_Funct \<alpha> \<AA> \<BB>\<close> \<open>\<Delta>\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m \<alpha> \<AA> \<BB>\<close> by (cs_concl cs_shallow cs_intro: cat_small_cs_intros cat_cs_intros) have "Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>cat_Funct \<alpha> \<AA> \<BB>(cf_map \<FF>,-) : cat_Funct \<alpha> \<AA> \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> cat_Set \<alpha>" by ( cs_concl cs_shallow cs_simp: cat_FUNCT_cs_simps cs_intro: cat_small_cs_intros cat_cs_intros cat_FUNCT_cs_intros ) then show "tm_cf_Cocone \<alpha> \<FF> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> cat_Set \<alpha>" unfolding tm_cf_Cocone_def' by (cs_concl cs_intro: cat_cs_intros) qed lemma (in is_tm_functor) tm_cf_cf_Cocone_is_functor'[cat_small_cs_intros]: assumes "\<BB>' = cat_Set \<alpha>" and "\<alpha>' = \<alpha>" shows "tm_cf_Cocone \<alpha> \<FF> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>'\<^esub> \<BB>'" unfolding assms by (rule tm_cf_cf_Cocone_is_functor) lemmas [cat_small_cs_intros] = is_tm_functor.tm_cf_cf_Cocone_is_functor' text\<open>\newpage\<close> end
lemma continuous_on_components_gen: fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space" assumes "\<And>C. C \<in> components S \<Longrightarrow> openin (top_of_set S) C \<and> continuous_on C f" shows "continuous_on S f"
## Capítulo 8 ```python from sympy.physics.mechanics import ReferenceFrame,Point,dynamicsymbols from sympy.physics.mechanics import Point,RigidBody,inertia, KanesMethod from sympy import latex,pprint,symbols,init_printing from sympy.algebras.quaternion import Quaternion from sympy.physics.mechanics import LagrangesMethod, Lagrangian from scipy.integrate import odeint from sympy import lambdify import matplotlib.pyplot as plt from matplotlib import animation import numpy as np import sys sys.path.append("../tools") from vis import Visualizer %matplotlib notebook init_printing() # Para visualizar símbolos ``` ```python # Definición del modelo para el ejemplo del robot scara # Parámetros del modelo l1,l2,l3,rb,rc,g=symbols('l_1,l_2,l_3,r_b,r_c,g') # Parámetros inerciales (note que se usan las variables ib e ic para la inercia en z). mb,mc,ib,ic=symbols('m_b,m_c,i_b,i_c') # Variables de movimiento q1,q2=dynamicsymbols('q_1,q_2') # Defina los marcos y puntos de interés en el robot a=ReferenceFrame('A') o=Point('O') b=a.orientnew('B','Axis',(q1,a.z)) p=o.locatenew('P',l1*a.z) bstar=p.locatenew('Bstar',rb*b.x) c=b.orientnew('C','Axis',(q2,b.z)) q=p.locatenew('Q',l2*b.x) cstar=q.locatenew('Cstar',rc*c.x) r=q.locatenew('R',l3*c.x) # Defina los cuerpos rígidos #RigidBody(name, masscenter, frame, mass, inertia) inertia_b=inertia(b,0,0,ib) inertia_c=inertia(c,0,0,ic) body_b=RigidBody('B', bstar, b, mb, (inertia_b,bstar)) body_c=RigidBody('C', cstar, c, mc, (inertia_c,cstar)) # Construya un objecto de visualización con el marco de referencia inercial y punto de origen vis=Visualizer(a,o) # Agrege marcos y puntos para ser visualizados (marco,punto,geometría) vis.add(a,o,shape='../Visualizacion/assets/scara_base.stl') vis.add(b,p,shape='../Visualizacion/assets/scara_brazo.stl') vis.add(c,q,shape='../Visualizacion/assets/scara_brazo.stl') vis.add(c,r,shape='../Visualizacion/assets/scara_cilindro.stl') #vis.add(b,o,shape='assets/Atraccion_Parque_link1.stl') #vis.add(c,p,shape='assets/Atraccion_Parque_disk.stl') vis.add(a,o,frame_scale=100) vis.add(b,p,frame_scale=100) vis.add(c,q,frame_scale=100) vis.add(c,r,frame_scale=100) # Modifique las variables de movimiento y verifique el cambio en la posición y # orientación de los marcos vis.plot({l1:220,l2:210,l3:210,q1:0,q2:0}) ``` <IPython.core.display.Javascript object> ```python ## 8.1 Ecuaciones iterativas de Newton-Euler ``` ```python # Primero calcule la cinemática de los cuerpos # Para esto defina las velocidades de los puntos en cada marco de referencia p.set_vel(a,0) q.set_vel(b,0) cstar.set_vel(c,0) bstar.set_vel(b,0) q.v2pt_theory(p,a,b) bstar.v2pt_theory(p,a,b) cstar.v2pt_theory(q,b,c) cstar.v2pt_theory(q,a,c) # Una vez definidas las velocidades puede calcular las velocidades en el marco A # Verifique los resultados con los siguientes comandos #b.ang_vel_in(a) #c.ang_vel_in(a) #b.ang_acc_in(a) #c.ang_acc_in(a) #bstar.vel(a) #cstar.vel(a) #bstar.acc(a) cstar.acc(a) ``` ```python #Usando ecuaciones de Newton-Euler (F=ma, M=Icm*alpha+ w x Icm w) # desde el último objeto en la cadena cinemática puede analizar y resolver # la cinética. #Primero para el cuerpo C # Encuentre la fuerza de reacción F_bc: sum(Fc)=, F_bc=mc*g*a.z+mc*cstar.acc(a) # M_bc=q.pos_from(cstar).cross(F_bc)+body_c.angular_momentum(cstar,a).dt(a) M_bc.express(b).simplify() ``` ```python #Calcule el momento asociado al motor M2=M_bc.express(b).dot(b.z) M2 ``` ```python #Ahora de la sumatoria de fuerzas para el cuerpo B F_ab=mb*g*a.z+mb*bstar.acc(a)+F_bc F_ab ``` ```python # Y de la sumatoria de momentos para el cuerpo B M_ab=-q.pos_from(bstar).cross(-F_bc)\ +p.pos_from(bstar).cross(F_ab)\ -body_b.angular_momentum(bstar,a).dt(a) M_ab.express(b).simplify() ``` ```python #Calcule el momento asociado al motor M_ab.dot(b.z).simplify() ``` ## 8.2 Formulacion de Kane para sistemas multicuerpo ```python # Defina nuevamente el modelo del robot Scara, esta vez # incluya con rapideces generalizadas para definir la cinemática usando # la formulacion de Kane. #Coordenadas generalizadas q1,q2,u1,u2=dynamicsymbols('q1,q2,u1,u2') #Derivadas qdot y udot q1d,q2d,u1d,u2d=dynamicsymbols('q1 q2 u1 u2',1) # Parámetros del modelo l1,l2,l3,rb,rc,g=symbols('l_1,l_2,l_3,r_b,r_c,g') # Parámetros inerciales (note que se usan las variables ib e ic para la inercia en z). mb,mc,ib,ic=symbols('m_b,m_c,i_b,i_c') # Defina variables para los momentos de los motores M1,M2=symbols('M1,M2') # Defina los marcos y puntos de interés en el robot a=ReferenceFrame('A') o=Point('O') b=a.orientnew('B','Axis',(q1,a.z)) p=o.locatenew('P',l1*a.z) bstar=p.locatenew('Bstar',rb*b.x) c=b.orientnew('C','Axis',(q2,b.z)) q=p.locatenew('Q',l2*b.x) cstar=q.locatenew('Cstar',rc*c.x) r=q.locatenew('R',l3*c.x) # Defina los cuerpos rígidos #RigidBody(name, masscenter, frame, mass, inertia) inertia_b=inertia(b,0,0,ib) inertia_c=inertia(c,0,0,ic) body_b=RigidBody('B', bstar, b, mb, (inertia_b,bstar)) body_c=RigidBody('C', cstar, c, mc, (inertia_c,cstar)) p.set_vel(a,0) q.set_vel(b,0) cstar.set_vel(c,0) bstar.set_vel(b,0) q.v2pt_theory(p,a,b) bstar.v2pt_theory(p,a,b) cstar.v2pt_theory(q,b,c) cstar.v2pt_theory(q,a,c) b.set_ang_vel(a,u1*a.z) c.set_ang_vel(b,u2*a.z) # Puede revisar la cinemática del sistema expresada en rapideces generalizadas # e.g. # b.ang_vel_in(a) # c.ang_vel_in(a).express(b) # b.ang_acc_in(a).express(b) # c.ang_acc_in(a).express(a) # bstar.vel(a) # cstar.vel(a) # bstar.acc(a) cstar.acc(a) ``` ```python # Ecuaciones diferenciales cinemáticas kd = [q1d-u1, q2d-u2] km=KanesMethod(a,q_ind=[q1,q2],u_ind=[u1,u2],kd_eqs=kd) # Tuplas con cuerpos y fuerzas (marcos y momentos) ftuples=[(body_b.masscenter,body_b.mass*g*a.z),(body_c.masscenter,body_c.mass*g*a.z)] mtuples=[(b,M1*b.z-M2*b.z),(c,M2*b.z)] (fr,frstar)=km.kanes_equations([body_b,body_c],ftuples+mtuples) ``` ```python # Verifique fr y frstar #fr #frstar[1] ``` ```python # Genere las ecuaciones de movimiento en espacio de estados: km.rhs() ``` $\displaystyle \left[\begin{matrix}\operatorname{u_{1}}{\left(t \right)}\\\operatorname{u_{2}}{\left(t \right)}\\\frac{M_{1} + l_{2} m_{c} r_{c} \left(\operatorname{u_{1}}{\left(t \right)} + \operatorname{u_{2}}{\left(t \right)}\right)^{2} \sin{\left(\operatorname{q_{2}}{\left(t \right)} \right)} - l_{2} m_{c} r_{c} \operatorname{u_{1}}^{2}{\left(t \right)} \sin{\left(\operatorname{q_{2}}{\left(t \right)} \right)} - \frac{\left(i_{c} + m_{c} \left(l_{2} r_{c} \cos{\left(\operatorname{q_{2}}{\left(t \right)} \right)} + r_{c}^{2}\right)\right) \left(M_{2} - l_{2} m_{c} r_{c} \operatorname{u_{1}}^{2}{\left(t \right)} \sin{\left(\operatorname{q_{2}}{\left(t \right)} \right)} - \frac{\left(i_{c} + m_{c} \left(l_{2} r_{c} \cos{\left(\operatorname{q_{2}}{\left(t \right)} \right)} + r_{c}^{2}\right)\right) \left(M_{1} + l_{2} m_{c} r_{c} \left(\operatorname{u_{1}}{\left(t \right)} + \operatorname{u_{2}}{\left(t \right)}\right)^{2} \sin{\left(\operatorname{q_{2}}{\left(t \right)} \right)} - l_{2} m_{c} r_{c} \operatorname{u_{1}}^{2}{\left(t \right)} \sin{\left(\operatorname{q_{2}}{\left(t \right)} \right)}\right)}{i_{b} + i_{c} + m_{b} r_{b}^{2} + m_{c} \left(l_{2}^{2} + 2 l_{2} r_{c} \cos{\left(\operatorname{q_{2}}{\left(t \right)} \right)} + r_{c}^{2}\right)}\right)}{i_{c} + m_{c} r_{c}^{2} - \frac{\left(i_{c} + m_{c} \left(l_{2} r_{c} \cos{\left(\operatorname{q_{2}}{\left(t \right)} \right)} + r_{c}^{2}\right)\right)^{2}}{i_{b} + i_{c} + m_{b} r_{b}^{2} + m_{c} \left(l_{2}^{2} + 2 l_{2} r_{c} \cos{\left(\operatorname{q_{2}}{\left(t \right)} \right)} + r_{c}^{2}\right)}}}{i_{b} + i_{c} + m_{b} r_{b}^{2} + m_{c} \left(l_{2}^{2} + 2 l_{2} r_{c} \cos{\left(\operatorname{q_{2}}{\left(t \right)} \right)} + r_{c}^{2}\right)}\\\frac{M_{2} - l_{2} m_{c} r_{c} \operatorname{u_{1}}^{2}{\left(t \right)} \sin{\left(\operatorname{q_{2}}{\left(t \right)} \right)} - \frac{\left(i_{c} + m_{c} \left(l_{2} r_{c} \cos{\left(\operatorname{q_{2}}{\left(t \right)} \right)} + r_{c}^{2}\right)\right) \left(M_{1} + l_{2} m_{c} r_{c} \left(\operatorname{u_{1}}{\left(t \right)} + \operatorname{u_{2}}{\left(t \right)}\right)^{2} \sin{\left(\operatorname{q_{2}}{\left(t \right)} \right)} - l_{2} m_{c} r_{c} \operatorname{u_{1}}^{2}{\left(t \right)} \sin{\left(\operatorname{q_{2}}{\left(t \right)} \right)}\right)}{i_{b} + i_{c} + m_{b} r_{b}^{2} + m_{c} \left(l_{2}^{2} + 2 l_{2} r_{c} \cos{\left(\operatorname{q_{2}}{\left(t \right)} \right)} + r_{c}^{2}\right)}}{i_{c} + m_{c} r_{c}^{2} - \frac{\left(i_{c} + m_{c} \left(l_{2} r_{c} \cos{\left(\operatorname{q_{2}}{\left(t \right)} \right)} + r_{c}^{2}\right)\right)^{2}}{i_{b} + i_{c} + m_{b} r_{b}^{2} + m_{c} \left(l_{2}^{2} + 2 l_{2} r_{c} \cos{\left(\operatorname{q_{2}}{\left(t \right)} \right)} + r_{c}^{2}\right)}}\end{matrix}\right]$ # 8.3 Uso de la formulacion de Lagrange en sistemas multicuerpo ```python # Defina nuevamente el modelo del robot Scara #Coordenadas generalizadas q1,q2=dynamicsymbols('q1,q2') #Derivadas qdot y udot q1d,q2d=dynamicsymbols('q1 q2',1) # Parámetros del modelo l1,l2,l3,rb,rc,g=symbols('l_1,l_2,l_3,r_b,r_c,g') # Parámetros inerciales (note que se usan las variables ib e ic para la inercia en z). mb,mc,ib,ic=symbols('m_b,m_c,i_b,i_c') # Defina variables para los momentos de los motors M1,M2=symbols('M1,M2') # Defina los marcos y puntos de interes en el robot a=ReferenceFrame('A') o=Point('O') b=a.orientnew('B','Axis',(q1,a.z)) p=o.locatenew('P',l1*a.z) bstar=p.locatenew('Bstar',rb*b.x) c=b.orientnew('C','Axis',(q2,b.z)) q=p.locatenew('Q',l2*b.x) cstar=q.locatenew('Cstar',rc*c.x) r=q.locatenew('R',l3*c.x) p.set_vel(a,0) q.set_vel(b,0) cstar.set_vel(c,0) bstar.set_vel(b,0) q.v2pt_theory(p,a,b) bstar.v2pt_theory(p,a,b) cstar.v2pt_theory(q,b,c) cstar.v2pt_theory(q,a,c) b.set_ang_vel(a,q1d*a.z) c.set_ang_vel(b,q2d*a.z) # Defina los cuerpos rígidos #RigidBody(name, masscenter, frame, mass, inertia) inertia_b=inertia(b,0,0,ib) inertia_c=inertia(c,0,0,ic) body_b=RigidBody('B', bstar, b, mb, (inertia_b,bstar)) body_c=RigidBody('C', cstar, c, mc, (inertia_c,cstar)) ``` ```python #En este caso todas las masas estan en el mismo plano # se supone energía potencial 0. Lb=Lagrangian(a,body_b) Lc=Lagrangian(a,body_c) # Tuplas con cuerpos y fuerzas (marcos y momentos) ftuples=[(body_b.masscenter,body_b.mass*g*a.z),(body_c.masscenter,body_c.mass*g*a.z)] mtuples=[(b,M1*b.z-M2*b.z),(c,M2*b.z)] lm=LagrangesMethod(Lb+Lc,[q1,q2],ftuples+mtuples,frame=a) lm.form_lagranges_equations() rhs=lm.rhs() # Ecuaciones de movimiento en espacio de estados rhs ``` $\displaystyle \left[\begin{matrix}\frac{d}{d t} \operatorname{q_{1}}{\left(t \right)}\\\frac{d}{d t} \operatorname{q_{2}}{\left(t \right)}\\\frac{M_{1} - \frac{m_{c} \left(- 2 l_{2} r_{c} \left(\frac{d}{d t} \operatorname{q_{1}}{\left(t \right)} + \frac{d}{d t} \operatorname{q_{2}}{\left(t \right)}\right) \sin{\left(\operatorname{q_{2}}{\left(t \right)} \right)} \frac{d}{d t} \operatorname{q_{2}}{\left(t \right)} - 2 l_{2} r_{c} \sin{\left(\operatorname{q_{2}}{\left(t \right)} \right)} \frac{d}{d t} \operatorname{q_{1}}{\left(t \right)} \frac{d}{d t} \operatorname{q_{2}}{\left(t \right)}\right)}{2} - \frac{\left(i_{c} + \frac{m_{c} \left(2 l_{2} r_{c} \cos{\left(\operatorname{q_{2}}{\left(t \right)} \right)} + 2 r_{c}^{2}\right)}{2}\right) \left(M_{2} - l_{2} m_{c} r_{c} \left(\frac{d}{d t} \operatorname{q_{1}}{\left(t \right)} + \frac{d}{d t} \operatorname{q_{2}}{\left(t \right)}\right) \sin{\left(\operatorname{q_{2}}{\left(t \right)} \right)} \frac{d}{d t} \operatorname{q_{1}}{\left(t \right)} + l_{2} m_{c} r_{c} \sin{\left(\operatorname{q_{2}}{\left(t \right)} \right)} \frac{d}{d t} \operatorname{q_{1}}{\left(t \right)} \frac{d}{d t} \operatorname{q_{2}}{\left(t \right)} - \frac{\left(M_{1} - \frac{m_{c} \left(- 2 l_{2} r_{c} \left(\frac{d}{d t} \operatorname{q_{1}}{\left(t \right)} + \frac{d}{d t} \operatorname{q_{2}}{\left(t \right)}\right) \sin{\left(\operatorname{q_{2}}{\left(t \right)} \right)} \frac{d}{d t} \operatorname{q_{2}}{\left(t \right)} - 2 l_{2} r_{c} \sin{\left(\operatorname{q_{2}}{\left(t \right)} \right)} \frac{d}{d t} \operatorname{q_{1}}{\left(t \right)} \frac{d}{d t} \operatorname{q_{2}}{\left(t \right)}\right)}{2}\right) \left(i_{c} + \frac{m_{c} \left(2 l_{2} r_{c} \cos{\left(\operatorname{q_{2}}{\left(t \right)} \right)} + 2 r_{c}^{2}\right)}{2}\right)}{i_{b} + i_{c} + m_{b} r_{b}^{2} + \frac{m_{c} \left(2 l_{2}^{2} + 4 l_{2} r_{c} \cos{\left(\operatorname{q_{2}}{\left(t \right)} \right)} + 2 r_{c}^{2}\right)}{2}}\right)}{i_{c} + m_{c} r_{c}^{2} - \frac{\left(i_{c} + \frac{m_{c} \left(2 l_{2} r_{c} \cos{\left(\operatorname{q_{2}}{\left(t \right)} \right)} + 2 r_{c}^{2}\right)}{2}\right)^{2}}{i_{b} + i_{c} + m_{b} r_{b}^{2} + \frac{m_{c} \left(2 l_{2}^{2} + 4 l_{2} r_{c} \cos{\left(\operatorname{q_{2}}{\left(t \right)} \right)} + 2 r_{c}^{2}\right)}{2}}}}{i_{b} + i_{c} + m_{b} r_{b}^{2} + \frac{m_{c} \left(2 l_{2}^{2} + 4 l_{2} r_{c} \cos{\left(\operatorname{q_{2}}{\left(t \right)} \right)} + 2 r_{c}^{2}\right)}{2}}\\\frac{M_{2} - l_{2} m_{c} r_{c} \left(\frac{d}{d t} \operatorname{q_{1}}{\left(t \right)} + \frac{d}{d t} \operatorname{q_{2}}{\left(t \right)}\right) \sin{\left(\operatorname{q_{2}}{\left(t \right)} \right)} \frac{d}{d t} \operatorname{q_{1}}{\left(t \right)} + l_{2} m_{c} r_{c} \sin{\left(\operatorname{q_{2}}{\left(t \right)} \right)} \frac{d}{d t} \operatorname{q_{1}}{\left(t \right)} \frac{d}{d t} \operatorname{q_{2}}{\left(t \right)} - \frac{\left(M_{1} - \frac{m_{c} \left(- 2 l_{2} r_{c} \left(\frac{d}{d t} \operatorname{q_{1}}{\left(t \right)} + \frac{d}{d t} \operatorname{q_{2}}{\left(t \right)}\right) \sin{\left(\operatorname{q_{2}}{\left(t \right)} \right)} \frac{d}{d t} \operatorname{q_{2}}{\left(t \right)} - 2 l_{2} r_{c} \sin{\left(\operatorname{q_{2}}{\left(t \right)} \right)} \frac{d}{d t} \operatorname{q_{1}}{\left(t \right)} \frac{d}{d t} \operatorname{q_{2}}{\left(t \right)}\right)}{2}\right) \left(i_{c} + \frac{m_{c} \left(2 l_{2} r_{c} \cos{\left(\operatorname{q_{2}}{\left(t \right)} \right)} + 2 r_{c}^{2}\right)}{2}\right)}{i_{b} + i_{c} + m_{b} r_{b}^{2} + \frac{m_{c} \left(2 l_{2}^{2} + 4 l_{2} r_{c} \cos{\left(\operatorname{q_{2}}{\left(t \right)} \right)} + 2 r_{c}^{2}\right)}{2}}}{i_{c} + m_{c} r_{c}^{2} - \frac{\left(i_{c} + \frac{m_{c} \left(2 l_{2} r_{c} \cos{\left(\operatorname{q_{2}}{\left(t \right)} \right)} + 2 r_{c}^{2}\right)}{2}\right)^{2}}{i_{b} + i_{c} + m_{b} r_{b}^{2} + \frac{m_{c} \left(2 l_{2}^{2} + 4 l_{2} r_{c} \cos{\left(\operatorname{q_{2}}{\left(t \right)} \right)} + 2 r_{c}^{2}\right)}{2}}}\end{matrix}\right]$ ```python # Finalmente puede utilizar el modelo del sistema para realizar simulaciones # de dinamica directa utilizando un integrador de ecuaciones diferenciales # de primer orden. # Defina las condiciones iniciales del sistema x0=[0,0,0,0] # Asigne valores numericos a los parámetros del modelo # rhs.free_symbols (revise las variables libres del modelo) parameters={M1:0,M2:0,mb:0.5,mc:0.5,ib:1e-3,ic:1e-3,l2:0.22,rb:0.1,rc:0.1} #Modifique los valores de M1 y M2 para obtener diferentes resultados en # la simulación parameters[M1]=-0.1*q1d-0.1*(q1-0.5) parameters[M2]=-0.1*q2d-0.1*(q2-0.5) t=np.linspace(0,20,100) # Cree una función numérica del modelo del sistema (i.e xdot=f(x)) rhs_fun=lambdify([q1,q2,q1d,q2d],rhs.subs(parameters)) ode_fun=lambda x,t: rhs_fun(x[0],x[1],x[2],x[3]).reshape(4) x=odeint(ode_fun,x0,t) plt.figure() plt.plot(t,x) plt.legend([q1,q2,q1d,q2d]) ``` <IPython.core.display.Javascript object> <matplotlib.legend.Legend at 0x1e47dd08940> ```python # Y utilizar las herramientas de visualización para observar el movimiento vis=Visualizer(a,o) vis.add(a,o,shape='../Visualizacion/assets/scara_base.stl') vis.add(b,p,shape='../Visualizacion/assets/scara_brazo.stl') vis.add(c,q,shape='../Visualizacion/assets/scara_brazo.stl') vis.add(c,r,shape='../Visualizacion/assets/scara_cilindro.stl') vis.add(a,o,frame_scale=100) vis.add(b,p,frame_scale=100) vis.add(c,q,frame_scale=100) vis.add(c,r,frame_scale=100) vis.plot({l1:220,l2:parameters[l2]*1000,l3:210,q1:x0[0],q2:x0[0]}) def update(i,data): vis.plot({l1:220,l2:parameters[l2]*1000,l3:210,q1:data[i,0],q2:data[i,1]}) ani = animation.FuncAnimation(vis.fig, update, x.shape[0], fargs=(x,), interval=20/x.shape[0], blit=False) ``` <IPython.core.display.Javascript object> # 8.4 Derivacion de un conjunto eficiente de ecuaciones dinamicas ```python # Defina nuevamente el modelo del robot Scara, esta vez # con la rapidez generalizada u2=q1d+q2d para definir la cinematica usando # la formulacion de Kane. #Coordenadas generalizadas q1,q2,u1,u2=dynamicsymbols('q1,q2,u1,u2') #Derivadas qdot y udot q1d,q2d,u1d,u2d=dynamicsymbols('q1 q2 u1 u2',1) # Parámetros del modelo l1,l2,l3,rb,rc,g=symbols('l_1,l_2,l_3,r_b,r_c,g') # Parámetros inerciales (note que se usan las variables ib e ic para la inercia en z). mb,mc,ib,ic=symbols('m_b,m_c,i_b,i_c') # Defina variables para los momentos de los motores M1,M2=symbols('M1,M2') # Defina los marcos y puntos de interés en el robot a=ReferenceFrame('A') o=Point('O') b=a.orientnew('B','Axis',(q1,a.z)) p=o.locatenew('P',l1*a.z) bstar=p.locatenew('Bstar',rb*b.x) c=b.orientnew('C','Axis',(q2,b.z)) q=p.locatenew('Q',l2*b.x) cstar=q.locatenew('Cstar',rc*c.x) r=q.locatenew('R',l3*c.x) # Defina los cuerpos rígidos #RigidBody(name, masscenter, frame, mass, inertia) inertia_b=inertia(b,0,0,ib) inertia_c=inertia(c,0,0,ic) body_b=RigidBody('B', bstar, b, mb, (inertia_b,bstar)) body_c=RigidBody('C', cstar, c, mc, (inertia_c,cstar)) p.set_vel(a,0) q.set_vel(b,0) cstar.set_vel(c,0) bstar.set_vel(b,0) q.v2pt_theory(p,a,b) bstar.v2pt_theory(p,a,b) cstar.v2pt_theory(q,b,c) cstar.v2pt_theory(q,a,c) b.set_ang_vel(a,u1*a.z) c.set_ang_vel(b,q2d*a.z) # Ecuaciones diferenciales cinemáticas kd = [q1d-u1, q1d+q2d-u2] km=KanesMethod(a,q_ind=[q1,q2],u_ind=[u1,u2],kd_eqs=kd) # Tuplas con cuerpos y fuerzas (marcos y momentos) ftuples=[(body_b.masscenter,body_b.mass*g*a.z),(body_c.masscenter,body_c.mass*g*a.z)] mtuples=[(b,M1*b.z-M2*b.z),(c,M2*b.z)] (fr,frstar)=km.kanes_equations([body_b,body_c],ftuples+mtuples) frstar ``` $\displaystyle \left[\begin{matrix}l_{2} m_{c} r_{c} \operatorname{u_{2}}^{2}{\left(t \right)} \sin{\left(\operatorname{q_{2}}{\left(t \right)} \right)} - l_{2} m_{c} r_{c} \cos{\left(\operatorname{q_{2}}{\left(t \right)} \right)} \frac{d}{d t} \operatorname{u_{2}}{\left(t \right)} - \left(i_{b} + l_{2}^{2} m_{c} + m_{b} r_{b}^{2}\right) \frac{d}{d t} \operatorname{u_{1}}{\left(t \right)}\\- l_{2} m_{c} r_{c} \operatorname{u_{1}}^{2}{\left(t \right)} \sin{\left(\operatorname{q_{2}}{\left(t \right)} \right)} - l_{2} m_{c} r_{c} \cos{\left(\operatorname{q_{2}}{\left(t \right)} \right)} \frac{d}{d t} \operatorname{u_{1}}{\left(t \right)} - \left(i_{c} + m_{c} r_{c}^{2}\right) \frac{d}{d t} \operatorname{u_{2}}{\left(t \right)}\end{matrix}\right]$
[STATEMENT] lemma not_in_Ints_imp_not_in_nonpos_Ints: "z \<notin> \<int> \<Longrightarrow> z \<notin> \<int>\<^sub>\<le>\<^sub>0" [PROOF STATE] proof (prove) goal (1 subgoal): 1. z \<notin> \<int> \<Longrightarrow> z \<notin> \<int>\<^sub>\<le>\<^sub>0 [PROOF STEP] by (auto simp: Ints_def nonpos_Ints_def)
module hamiltonian use precision use mpi use globals use fft use misc use potential implicit none contains function f_hamiltonian(wavefn, nl, nu) result(hamiltonian) ! ! This function computes the hamiltonian of a wave function ! integer(idp), dimension(2), intent(in) :: nl, nu complex(cdp), dimension(nl(1):nu(1), nl(2):nu(2)), intent(in) ::& & wavefn complex(cdp), dimension(nl(1):nu(1), nl(2):nu(2)) :: hamiltonian complex(cdp), dimension(:, :), allocatable, save :: del2, pot,& & delwavefnx, delwavefny, delwavefn, delx, dely, delxy,& & vecpotfn2 real(fdp), dimension(:, :), allocatable, save :: vecpotfnx,& & vecpotfny, vecpotfn integer(idp), dimension(dim), save :: nlold = 0, nuold = 0 logical, save :: defvecpot = .false., defpot = .false., defdel =& & .false. ! ! If the space size changes, deallocate all the stored function ! if (nlold(1) /= nl(1) .or. nlold(2) /= nl(2) .or. nuold(1) /=& & nu(1) .or. nuold(2) /= nu(2)) then if (defdel) then deallocate(del2) defdel = .false. end if if (defvecpot) then select case (parameters%gauge) case('(-y,0,0)') deallocate(delx, vecpotfny, vecpotfn2, delwavefnx) case('(-y,x,0)') deallocate(delx, dely, vecpotfnx, vecpotfny, delwavefnx& &, delwavefny, vecpotfn2) case('(x-y,x-y,0)', 'fft') deallocate(delxy, vecpotfn, delwavefn, vecpotfn2) end select defvecpot = .false. end if if (defpot) then deallocate(pot) defpot = .false. end if nlold = nl nuold = nu end if ! ! If the required function are not allocated and computed, ! allocate them and compute them ! if (.not. defdel) then allocate(del2(nl(1):nu(1), nl(2):nu(2))) call s_momentumfac(del2, nl, nu, (/ 1.0d0, 1.0d0 /)& &/dble(product(parameters%n)), (/ 2, 2 /)) ! ! Include terms for speed ! del2 = - del2 * hbar**2 / 2.0d0 / parameters%mass defdel = .true. end if if (defined_parameters%potential .and. (.not. defpot) .and.& & (.not. defvecpot)) then ! ! Define the potential ! allocate(pot(nl(1):nu(1), nl(2):nu(2))) call s_setpotential(pot, nl, nu) ! ! Save the potential to disk for plotting ! if (parameters%plotpot) then call s_write2drarray(real(pot), nl, nu, filename='rpot',& & incboundary=.true.) call s_write2drarray(aimag(pot), nl, nu, filename='ipot',& & incboundary=.true.) end if defpot = .true. end if if (defined_parameters%externalb .and. (.not. defvecpot) ) then select case (parameters%gauge) case('(-y,0,0)') allocate(delx(nl(1):nu(1), nl(2):nu(2)),& & vecpotfny(nl(1):nu(1), nl(2):nu(2)),& & vecpotfn2(nl(1):nu(1), nl(2):nu(2)),& & delwavefnx(nl(1):nu(1), nl(2):nu(2))) call s_bpoty(delx, vecpotfny, vecpotfn2, nl, nu) case('(-y,x,0)') allocate(delx(nl(1):nu(1), nl(2):nu(2)), dely(nl(1):nu(1),& & nl(2):nu(2)), vecpotfnx(nl(1):nu(1), nl(2):nu(2)),& & vecpotfny(nl(1):nu(1), nl(2):nu(2)),& & vecpotfn2(nl(1):nu(1), nl(2):nu(2)),& & delwavefnx(nl(1):nu(1), nl(2):nu(2)),& & delwavefny(nl(1):nu(1), nl(2):nu(2))) call s_bpotyx(delx, dely, vecpotfnx, vecpotfny, vecpotfn2,& & nl, nu) case('(x-y,x-y,0)') allocate(delxy(nl(1):nu(1), nl(2):nu(2)),& & vecpotfn(nl(1):nu(1), nl(2):nu(2)),& & vecpotfn2(nl(1):nu(1), nl(2):nu(2)),& & delwavefn(nl(1):nu(1), nl(2):nu(2))) call s_bpotxyxy(delxy, vecpotfn, vecpotfn2, nl, nu) case('fft') allocate(delxy(nl(1):nu(1), nl(2):nu(2)),& & vecpotfn(nl(1):nu(1), nl(2):nu(2)),& & vecpotfn2(nl(1):nu(1), nl(2):nu(2)),& & delwavefn(nl(1):nu(1), nl(2):nu(2))) call s_bpotfft(delxy, vecpotfn, vecpotfn2, nl, nu) end select defvecpot = .true. if (defpot) then vecpotfn2 = vecpotfn2 + pot deallocate(pot) defpot = .false. end if end if ! ! Compute the derivatives of the wavefn ! hamiltonian = wavefn call s_c2dfft(hamiltonian, nl, nu, fftfor) if (defined_parameters%externalb) then select case (parameters%gauge) case('(-y,0,0)') delwavefnx = hamiltonian*delx call s_c2dfft(delwavefnx, nl, nu, fftbac) case('(-y,x,0)') delwavefnx = hamiltonian*delx delwavefny = hamiltonian*dely call s_c2dfft(delwavefnx, nl, nu, fftbac) call s_c2dfft(delwavefny, nl, nu, fftbac) case('(x-y,x-y,0)', 'fft') delwavefn = hamiltonian*delxy call s_c2dfft(delwavefn, nl, nu, fftbac) end select end if hamiltonian = hamiltonian*del2 call s_c2dfft(hamiltonian, nl, nu, fftbac) ! ! Build up the hamiltonian from its various bits ! if (defined_parameters%externalb .and. defvecpot) then select case (parameters%gauge) case('(-y,0,0)') hamiltonian = hamiltonian + vecpotfny*delwavefnx +& & vecpotfn2*wavefn case('(-y,x,0)') hamiltonian = hamiltonian + vecpotfnx*delwavefny +& & vecpotfny*delwavefnx + vecpotfn2*wavefn case('(x-y,x-y,0)', 'fft') hamiltonian = hamiltonian + vecpotfn*delwavefn + vecpotfn2& &*wavefn end select end if if (defined_parameters%potential .and. defpot) then hamiltonian = hamiltonian + pot*wavefn end if ! ! If we have a magnetic field, ensure the boundary of the wave ! function ! is zero. This is a nasty hack, but I think required. ! Hopefully it ! will make this work well for magnetic fields. ! if(defined_parameters%externalb) then call s_smoothedge(hamiltonian, nl, nu, parameters%smooth) end if end function f_hamiltonian function f_wavefnenergy(wavefn, nl, nu) result(energy) ! ! this module calculates the energy of a function ! integer(idp), dimension(dim), intent(in) :: nl, nu complex(cdp), dimension(nl(1):nu(1), nl(2):nu(2)), intent(in) ::& & wavefn real(fdp) :: energy ! ! Compute the hamiltonian ! energy = f_norm(real(conjg(wavefn)*f_hamiltonian(wavefn, nl, nu))& &, nl, nu) end function f_wavefnenergy end module hamiltonian
Formal statement is: lemma (in topological_space) filterlim_at_within_If: assumes "filterlim f G (at x within (A \<inter> {x. P x}))" and "filterlim g G (at x within (A \<inter> {x. \<not>P x}))" shows "filterlim (\<lambda>x. if P x then f x else g x) G (at x within A)" Informal statement is: If $f$ converges to $L$ on the set $A \cap \{x \mid P(x)\}$ and $g$ converges to $L$ on the set $A \cap \{x \mid \lnot P(x)\}$, then the function $h$ defined by $h(x) = f(x)$ if $P(x)$ and $h(x) = g(x)$ if $\lnot P(x)$ converges to $L$ on $A$.
[STATEMENT] lemma fcard_normalize_img_if_disjoint: "disjoint_darcs xs \<Longrightarrow> fcard ((\<lambda>(t,e). (normalize1 t,e)) |`| xs) = fcard xs" [PROOF STATE] proof (prove) goal (1 subgoal): 1. disjoint_darcs xs \<Longrightarrow> fcard ((\<lambda>(t, e). (normalize1 t, e)) |`| xs) = fcard xs [PROOF STEP] using snds_neq_img_card_eq[of xs] [PROOF STATE] proof (prove) using this: \<forall>(t, e)\<in>fset xs. \<forall>(t2, e2)\<in>fset xs. e \<noteq> e2 \<or> (t, e) = (t2, e2) \<Longrightarrow> fcard ((\<lambda>(t1, e1). (?f t1, e1)) |`| xs) = fcard xs goal (1 subgoal): 1. disjoint_darcs xs \<Longrightarrow> fcard ((\<lambda>(t, e). (normalize1 t, e)) |`| xs) = fcard xs [PROOF STEP] by fast
\documentclass[bfivepaper,twosided,justified,nobib]{tufte-book} \hypersetup{colorlinks}% uncomment this line if you prefer colored hyperlinks (e.g., for onscreen viewing) %% % Book metadata \title{How I Learned to \\ Worry Productively about AI: \\ \\ Robot Apocalypses \\ Averted} \author{Z. Irene Ying and Jordan Boyd-Graber} \publisher{University of Maryland} %% % If they're installed, use Bergamo and Chantilly from www.fontsite.com. % They're clones of Bembo and Gill Sans, respectively. %\IfFileExists{bergamo.sty}{\usepackage[osf]{bergamo}}{}% Bembo %\IfFileExists{chantill.sty}{\usepackage{chantill}}{}% Gill Sans %\usepackage{microtype} \usepackage{booktabs} \usepackage{graphicx} \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} \graphicspath{{figures/}} % The fancyvrb package lets us customize the formatting of verbatim % environments. We use a slightly smaller font. \usepackage{fancyvrb} \fvset{fontsize=\normalsize} %% % Prints a trailing space in a smart way. \usepackage{xspace} \newif\ifcomment\commentfalse \input{preamble} % Generates the index \usepackage{makeidx} \usepackage{natbib} \setcitestyle{authoryear} \makeindex \newcommand{\blankpage}{\newpage\hbox{}\thispagestyle{empty}\newpage} \begin{document} % Front matter \frontmatter % \tableofcontents \input{characters} \input{chapters/00-frontmatter} \input{chapters/10-intro} \input{chapters/20-story1} \input{chapters/25-cyberjerks} %\chapter{General AI} %\label{chap:gai} %\input{chapters/example} \newcommand{\outline}[3]{\chapter{#1} \begin{itemize} \item {\bf Story:} #2 \item {\bf Essay:} #3 \end{itemize} } \outline{General AI}{\lastname{} is called in to consult on the deployment of a general AI that a military contractor has developed. It breaks out of its sandbox, causing physical havoc with military equipment. A specialized AI designed to contain the general AI is surgically deployed to resolve the problem.}{This chapter explores the distinction between general and specialized AI---\specializedai{}---and how the pressures and history of a general AI cause them to be vulnerable to specialized algorithms and methods. With respect to current day, the chapter reviews the approaches toward general AI (and how they haven't gotten anywhere) as opposed to specialized AI. } \outline{Resource-Constrained AI}{\lastname{} is comfortably faculty at University when her past history with \specializedai{} comes back to haunt her: a rogue actor has found an old copy and using it to terrorize a small Canadian town. \lastname{} works with the local authorities to deploy their specialized AI to counteract the threat.}{This chapter explores how governments' role as a protector of populations evolves in a world with ubiquitous and powerful artifcial intelligence. Although in some ways AI is democratizing, it is still connected to access to real-world resources (material, energy, physical space), and governments and multinational corporations will have the most powerful and capable AI agents. Just as we trust governments with technology that can end the world (nuclear weapons), we must trust the government to responsibly harness the power of artificial intelligence. This discussion will be connected to the connection to electricity and specialized hardware for bitcoining mining and deep learning. } \outline{AI's Role in Social Interactions}{\lastname{} finds herself drawn into a political scandal when an AI agent begins influencing public opinion against her and her research. She fights back the only way she knows how: with AI.}{While the threat of AI is often seen as physical, another salient fear is social and emotional: AIs can play on fear and emotion. In many ways this is harder to notice and fight against because these effects might be superficially welcome by their targets. This chapter talks about how AIs can detect, influence, and interact with people. Examples will be drawn from AI approaches to detecting deception and manipulating audiences on social media. } \jbgcomment{Not putting in outline, but what might be a way of making the plot work, this could be a scheme by a faculty adversary that she uncovers, which leads her to sell out.} \outline{Cashing Out}{Fed up by politics and the politics of academia, \lastname{} goes off to make a pile of money at \fintech{}, turning her AI smarts to Wall Street. It's harder than she thinks.}{Financial markets, like much of AI, hope to make predictions about what will happen in the world and to estimate uncertainty. This chapter investigates whether capitalist markets are possible in a world with effective AI. } \jbgcomment{Connection between the two chapters: previous chapter allows everyone to go out an earn a capitalist wage.} \outline{The Silent Revolution}{Having saved the world multiple times, \lastname{} retires to spend more time with her grandchildren and sees their relationship with AI.}{The book concludes with how AI can change social interactions and society in less overtly negative ways, warning about a future where AI can diminish the richness of the human experience (if we let it). More of an opinion piece, this chapter focuses on how AI and humans should interact with each other. Specifically, arguing for cooperation and collaboration rather than outright replacement. } \backmatter \bibliography{bib/jbg} \bibliographystyle{plainnat} \printindex \end{document}
import Lvl open import Type module Data.IndexedList {ℓ ℓᵢ} (T : Type{ℓ}) {I : Type{ℓᵢ}} where private variable i : I record Index : Type{ℓᵢ Lvl.⊔ ℓ} where constructor intro field ∅ : I _⊰_ : T → I → I module _ ((intro ∅ᵢ _⊰ᵢ_) : Index) where data IndexedList : I → Type{ℓᵢ Lvl.⊔ ℓ} where ∅ : IndexedList(∅ᵢ) _⊰_ : (x : T) → IndexedList(i) → IndexedList(x ⊰ᵢ i) infixr 1000 _⊰_ private variable ℓₚ : Lvl.Level private variable index : Index private variable l : IndexedList i module _ (P : ∀{i} → IndexedList i → Type{ℓₚ}) where elim : P(∅) → (∀{i}(x)(l : IndexedList i) → P(l) → P(x ⊰ l)) → ((l : IndexedList i) → P(l)) elim base next ∅ = base elim base next (x ⊰ l) = next x l (elim base next l) module LongOper where pattern empty = ∅ pattern prepend elem list = elem ⊰ list pattern singleton x = x ⊰ ∅
Get the best route from Berlin to Schildow with ViaMichelin. Choose one of the following options for the Berlin to Schildow route: Michelin recommended, quickest, shortest or economical. You can also add information on Michelin restaurants, tourist attractions or hotels in Berlin or Schildow.
function printlist(l) tl = typeof(l) if tl == JLPList println("$(typeof(l.val) <: JLPNil ? "" : l.val.val)(") _printlist(l, 1) println(")") else println(l) end return end function _printlist(l,index = 0) tl = typeof(l) if tl == JLPNil index == 0 && return print(repeat(" ", index*2 - 2)) return elseif tl == JLPList && typeof(l.car) == JLPList print(repeat(" ", index*2)) println("$(typeof(l.car.val) <: JLPNil ? "" : l.car.val.val)(") _printlist(l.car, index+1) println(")") else print(repeat(" ", index*2)) typeof(l) == JLPList ? _printlist(l.car) : println(l) end tl == JLPList && _printlist(l.cdr, index) end function car(l :: JLPList) return l.car end function cdr(l :: JLPList) return l.cdr end
If the content of a polynomial is 1, then the primitive part of the polynomial is the polynomial itself.
(* Full safety for DOT (WIP) *) (* this version is based on fsub2.v *) (* based on that, it adds self types *) (* TODO: - intersection types - stp2 trans + narrowing - stp/stp2 weakening and regularity *) Require Export SfLib. Require Export Arith.EqNat. Require Export Arith.Le. Module FSUB. Definition id := nat. Inductive ty : Type := | TBool : ty | TBot : ty | TTop : ty | TFun : ty -> ty -> ty | TMem : ty -> ty -> ty | TSel : id -> ty | TSelH : id -> ty | TSelB : id -> ty | TAll : ty -> ty -> ty | TBind : ty -> ty . Inductive tm : Type := | ttrue : tm | tfalse : tm | tvar : id -> tm | ttyp : ty -> tm | tapp : tm -> tm -> tm (* f(x) *) | tabs : id -> id -> tm -> tm (* \f x.y *) | ttapp : tm -> tm -> tm (* f[X] *) | ttabs : id -> ty -> tm -> tm (* \f x.y *) . Inductive vl : Type := | vty : list (id*vl) -> ty -> vl | vbool : bool -> vl | vabs : list (id*vl) -> id -> id -> tm -> vl | vtabs : list (id*vl) -> id -> ty -> tm -> vl . Definition tenv := list (id*ty). Definition venv := list (id*vl). Definition aenv := list (id*(venv*ty)). Hint Unfold venv. Hint Unfold tenv. Fixpoint fresh {X: Type} (l : list (id * X)): nat := match l with | [] => 0 | (n',a)::l' => 1 + n' end. Fixpoint index {X : Type} (n : id) (l : list (id * X)) : option X := match l with | [] => None | (n',a) :: l' => if le_lt_dec (fresh l') n' then if (beq_nat n n') then Some a else index n l' else None end. Fixpoint indexr {X : Type} (n : id) (l : list (id * X)) : option X := match l with | [] => None | (n',a) :: l' => (* DeBrujin *) if (beq_nat n (length l')) then Some a else indexr n l' end. (* Fixpoint update {X : Type} (n : nat) (x: X) (l : list X) { struct l }: list X := match l with | [] => [] | a :: l' => if beq_nat n (length l') then x::l' else a :: update n x l' end. *) (* LOCALLY NAMELESS *) Inductive closed_rec: nat -> nat -> ty -> Prop := | cl_top: forall k l, closed_rec k l TTop | cl_bot: forall k l, closed_rec k l TBot | cl_bool: forall k l, closed_rec k l TBool | cl_fun: forall k l T1 T2, closed_rec k l T1 -> closed_rec k l T2 -> closed_rec k l (TFun T1 T2) | cl_mem: forall k l T1 T2, closed_rec k l T1 -> closed_rec k l T2 -> closed_rec k l (TMem T1 T2) | cl_all: forall k l T1 T2, closed_rec k l T1 -> closed_rec (S k) l T2 -> closed_rec k l (TAll T1 T2) | cl_bind: forall k l T2, closed_rec (S k) l T2 -> closed_rec k l (TBind T2) | cl_sel: forall k l x, closed_rec k l (TSel x) | cl_selh: forall k l x, l > x -> closed_rec k l (TSelH x) | cl_selb: forall k l i, k > i -> closed_rec k l (TSelB i) . Hint Constructors closed_rec. Definition closed j l T := closed_rec j l T. Fixpoint open_rec (k: nat) (u: ty) (T: ty) { struct T }: ty := match T with | TSel x => TSel x (* free var remains free. functional, so we can't check for conflict *) | TSelH i => TSelH i (*if beq_nat k i then u else TSelH i *) | TSelB i => if beq_nat k i then u else TSelB i | TAll T1 T2 => TAll (open_rec k u T1) (open_rec (S k) u T2) | TBind T2 => TBind (open_rec (S k) u T2) | TTop => TTop | TBot => TBot | TBool => TBool | TMem T1 T2 => TMem (open_rec k u T1) (open_rec k u T2) | TFun T1 T2 => TFun (open_rec k u T1) (open_rec k u T2) end. Definition open u T := open_rec 0 u T. (* sanity check *) Example open_ex1: open (TSel 9) (TAll TBool (TFun (TSelB 1) (TSelB 0))) = (TAll TBool (TFun (TSel 9) (TSelB 0))). Proof. compute. eauto. Qed. Fixpoint subst (U : ty) (T : ty) {struct T} : ty := match T with | TTop => TTop | TBot => TBot | TBool => TBool | TMem T1 T2 => TMem (subst U T1) (subst U T2) | TFun T1 T2 => TFun (subst U T1) (subst U T2) | TSelB i => TSelB i | TSel i => TSel i | TSelH i => if beq_nat i 0 then U else TSelH (i-1) | TAll T1 T2 => TAll (subst U T1) (subst U T2) | TBind T2 => TBind (subst U T2) end. Fixpoint nosubst (T : ty) {struct T} : Prop := match T with | TTop => True | TBot => True | TBool => True | TMem T1 T2 => nosubst T1 /\ nosubst T2 | TFun T1 T2 => nosubst T1 /\ nosubst T2 | TSelB i => True | TSel i => True | TSelH i => i <> 0 | TAll T1 T2 => nosubst T1 /\ nosubst T2 | TBind T2 => nosubst T2 end. Hint Unfold open. Hint Unfold closed. Inductive stp: tenv -> tenv -> ty -> ty -> Prop := | stp_topx: forall G1 GH, stp G1 GH TTop TTop | stp_botx: forall G1 GH, stp G1 GH TBot TBot | stp_top: forall G1 GH T1, stp G1 GH T1 T1 -> (* regularity *) stp G1 GH T1 TTop | stp_bot: forall G1 GH T2, stp G1 GH T2 T2 -> (* regularity *) stp G1 GH TBot T2 | stp_bool: forall G1 GH, stp G1 GH TBool TBool | stp_fun: forall G1 GH T1 T2 T3 T4, stp G1 GH T3 T1 -> stp G1 GH T2 T4 -> stp G1 GH (TFun T1 T2) (TFun T3 T4) | stp_mem: forall G1 GH T1 T2 T3 T4, stp G1 GH T3 T1 -> stp G1 GH T2 T4 -> stp G1 GH (TMem T1 T2) (TMem T3 T4) | stp_sel1: forall G1 GH TX T2 x, index x G1 = Some TX -> closed 0 0 TX -> stp G1 GH TX (TMem TBot T2) -> stp G1 GH T2 T2 -> (* regularity of stp2 *) stp G1 GH (TSel x) T2 | stp_sel2: forall G1 GH TX T1 x, index x G1 = Some TX -> closed 0 0 TX -> stp G1 GH TX (TMem T1 TTop) -> stp G1 GH T1 T1 -> (* regularity of stp2 *) stp G1 GH T1 (TSel x) | stp_selb1: forall G1 GH TX T2 x, index x G1 = Some TX -> stp G1 [] TX (TBind (TMem TBot T2)) -> (* Note GH = [] *) stp G1 GH (open (TSel x) T2) (open (TSel x) T2) -> (* regularity *) stp G1 GH (TSel x) (open (TSel x) T2) | stp_selb2: forall G1 GH TX T1 x, index x G1 = Some TX -> stp G1 [] TX (TBind (TMem T1 TTop)) -> (* Note GH = [] *) stp G1 GH (open (TSel x) T1) (open (TSel x) T1) -> (* regularity *) stp G1 GH (open (TSel x) T1) (TSel x) | stp_selx: forall G1 GH TX x, index x G1 = Some TX -> stp G1 GH (TSel x) (TSel x) | stp_sela1: forall G1 GH TX T2 x, indexr x GH = Some TX -> closed 0 x TX -> stp G1 GH TX (TMem TBot T2) -> (* not using self name for now *) stp G1 GH T2 T2 -> (* regularity of stp2 *) stp G1 GH (TSelH x) T2 | stp_sela2: forall G1 GH TX T1 x, indexr x GH = Some TX -> closed 0 x TX -> stp G1 GH TX (TMem T1 TTop) -> (* not using self name for now *) stp G1 GH T1 T1 -> (* regularity of stp2 *) stp G1 GH T1 (TSelH x) | stp_selab1: forall G1 GH TX T2 T2' x, indexr x GH = Some TX -> stp G1 [] TX (TBind (TMem TBot T2)) -> (* XXX Note GH = [] *) T2' = (open (TSelH x) T2) -> stp G1 GH T2' T2' -> (* regularity *) stp G1 GH (TSelH x) T2' | stp_selab2: forall G1 GH TX T1 T1' x, indexr x GH = Some TX -> stp G1 [] TX (TBind (TMem T1 TTop)) -> (* XXX Note GH = [] *) T1' = (open (TSelH x) T1) -> stp G1 GH T1' T1' -> (* regularity *) stp G1 GH T1' (TSelH x) | stp_selax: forall G1 GH TX x, indexr x GH = Some TX -> stp G1 GH (TSelH x) (TSelH x) | stp_all: forall G1 GH T1 T2 T3 T4 x, stp G1 GH T3 T1 -> x = length GH -> closed 1 (length GH) T2 -> (* must not accidentally bind x *) closed 1 (length GH) T4 -> stp G1 ((0,T1)::GH) (open (TSelH x) T2) (open (TSelH x) T2) -> (* regularity *) stp G1 ((0,T3)::GH) (open (TSelH x) T2) (open (TSelH x) T4) -> stp G1 GH (TAll T1 T2) (TAll T3 T4) | stp_bindx: forall G1 GH T1 T2 x, x = length GH -> closed 1 (length GH) T1 -> (* must not accidentally bind x *) closed 1 (length GH) T2 -> stp G1 ((0,open (TSelH x) T2)::GH) (open (TSelH x) T2) (open (TSelH x) T2) -> (* regularity *) stp G1 ((0,open (TSelH x) T1)::GH) (open (TSelH x) T1) (open (TSelH x) T2) -> stp G1 GH (TBind T1) (TBind T2) . (* with path_type: tenv -> tenv -> id -> ty -> Prop := | pt_var: forall G1 GH TX x, index x G1 = Some TX -> path_type G1 GH x TX | pt_sub: forall G1 GH TX x, path_type has_type env e T1 -> stp env [] T1 T2 -> has_type env e T2 with pathH_type: tenv -> tenv -> id -> ty -> Prop := | pth_var: forall G1 GH TX T x, indexr x GH = Some TX -> stp G1 GH TX T -> pathH_type G1 GH x T *) Hint Constructors stp. (* TODO *) Inductive has_type : tenv -> tm -> ty -> Prop := | t_true: forall env, has_type env ttrue TBool | t_false: forall env, has_type env tfalse TBool | t_var: forall x env T1, index x env = Some T1 -> has_type env (tvar x) T1 | t_var_pack: forall x env T1, has_type env (tvar x) (open (TSel x) T1) -> has_type env (tvar x) (TBind T1) | t_var_unpack: forall x env T1, has_type env (tvar x) (TBind T1) -> has_type env (tvar x) (open (TSel x) T1) | t_typ: forall env x T1 T1X, fresh env = x -> open (TSel x) T1 = T1X -> stp ((x,TMem T1X T1X)::env) [] T1X T1X -> has_type env (ttyp T1) (TBind (TMem T1 T1)) | t_app: forall env f x T1 T2, has_type env f (TFun T1 T2) -> has_type env x T1 -> has_type env (tapp f x) T2 | t_abs: forall env f x y T1 T2, has_type ((x,T1)::(f,TFun T1 T2)::env) y T2 -> stp env [] (TFun T1 T2) (TFun T1 T2) -> fresh env <= f -> 1+f <= x -> has_type env (tabs f x y) (TFun T1 T2) | t_tapp: forall env f x T11 T12, has_type env f (TAll T11 T12) -> has_type env x T11 -> stp env [] T12 T12 -> has_type env (ttapp f x) T12 (* NOTE: both the POPLmark paper and Cardelli's paper use this rule: Does it make a difference? It seems like we can always widen f? | t_tapp: forall env f T2 T11 T12 , has_type env f (TAll T11 T12) -> stp env T2 T11 -> has_type env (ttapp f T2) (open T2 T12) *) | t_tabs: forall env x y T1 T2, has_type ((x,T1)::env) y (open (TSel x) T2) -> stp env [] (TAll T1 T2) (TAll T1 T2) -> fresh env = x -> has_type env (ttabs x T1 y) (TAll T1 T2) | t_sub: forall env e T1 T2, has_type env e T1 -> stp env [] T1 T2 -> has_type env e T2 . Definition base (v:vl): venv := match v with | vty GX _ => GX | vbool _ => nil | vabs GX _ _ _ => GX | vtabs GX _ _ _ => GX end. Definition MAX := 2. Inductive stp2: nat -> bool -> venv -> ty -> venv -> ty -> list (id*(venv*ty)) -> nat -> Prop := | stp2_topx: forall m G1 G2 GH n1, stp2 m true G1 TTop G2 TTop GH (S n1) | stp2_botx: forall m G1 G2 GH n1, stp2 m true G1 TBot G2 TBot GH (S n1) | stp2_top: forall m G1 G2 GH T n1, stp2 m true G1 T G1 T GH n1 -> (* regularity *) stp2 m true G1 T G2 TTop GH (S n1) | stp2_bot: forall m G1 G2 GH T n1, stp2 m true G2 T G2 T GH n1 -> (* regularity *) stp2 m true G1 TBot G2 T GH (S n1) | stp2_bool: forall m G1 G2 GH n1, stp2 m true G1 TBool G2 TBool GH (S n1) | stp2_fun: forall m G1 G2 T1 T2 T3 T4 GH n1 n2, stp2 MAX false G2 T3 G1 T1 GH n1 -> stp2 MAX false G1 T2 G2 T4 GH n2 -> stp2 m true G1 (TFun T1 T2) G2 (TFun T3 T4) GH (S (n1+n2)) | stp2_mem: forall G1 G2 T1 T2 T3 T4 GH n1 n2, stp2 0 false G2 T3 G1 T1 GH n1 -> stp2 0 true G1 T2 G2 T4 GH n2 -> stp2 0 true G1 (TMem T1 T2) G2 (TMem T3 T4) GH (S (n1+n2)) | stp2_mem2: forall m G1 G2 T1 T2 T3 T4 GH n1 n2, stp2 (S m) false G2 T3 G1 T1 GH n1 -> stp2 (S m) false G1 T2 G2 T4 GH n2 -> stp2 (S m) true G1 (TMem T1 T2) G2 (TMem T3 T4) GH (S (n1+n2)) (* strong version, with precise/invertible bounds *) | stp2_strong_sel1: forall G1 G2 GX TX x T2 GH n1, index x G1 = Some (vty GX TX) -> (* val_type GX (vty GX TX) (TMem TX TX) -> (* for downgrade *)*) closed 0 0 TX -> stp2 0 true GX TX G2 T2 GH n1 -> stp2 0 true G1 (TSel x) G2 T2 GH (S n1) | stp2_strong_sel2: forall G1 G2 GX TX x T1 GH n1, index x G2 = Some (vty GX TX) -> (* val_type GX (vty GX TX) (TMem TX TX) -> (* for downgrade *)*) closed 0 0 TX -> stp2 0 false G1 T1 GX TX GH n1 -> stp2 0 true G1 T1 G2 (TSel x) GH (S n1) | stp2_strong_selx: forall G1 G2 v x1 x2 GH n1, index x1 G1 = Some v -> index x2 G2 = Some v -> stp2 0 true G1 (TSel x1) G2 (TSel x2) GH n1 (* existing object, but imprecise type *) | stp2_sel1: forall m G1 G2 GX TX x T2 GH n1 n2 v, index x G1 = Some v -> val_type GX v TX -> closed 0 0 TX -> stp2 (S m) false GX TX G2 (TMem TBot T2) GH n1 -> stp2 (S m) true G2 T2 G2 T2 GH n2 -> (* regularity *) stp2 (S m) true G1 (TSel x) G2 T2 GH (S (n1+n2)) | stp2_selb1: forall m G1 G2 GX TX x T2 GH n1 n2 v, index x G1 = Some v -> val_type GX v TX -> closed 0 0 TX -> stp2 (S (S m)) false GX TX G2 (TBind (TMem TBot T2)) [] n1 -> (* Note GH = [] *) stp2 (S (S m)) true G2 (open (TSel x) T2) G2 (open (TSel x) T2) GH n2 -> (* regularity *) stp2 (S (S m)) true G1 (TSel x) G2 (open (TSel x) T2) GH (S (n1+n2)) | stp2_sel2: forall m G1 G2 GX TX x T1 GH n1 n2 v, index x G2 = Some v -> val_type GX v TX -> closed 0 0 TX -> stp2 (S m) false GX TX G1 (TMem T1 TTop) GH n1 -> stp2 (S m) true G1 T1 G1 T1 GH n2 -> (* regularity *) stp2 (S m) true G1 T1 G2 (TSel x) GH (S (n1+n2)) | stp2_selx: forall m G1 G2 v x1 x2 GH n1, index x1 G1 = Some v -> index x2 G2 = Some v -> stp2 (S m) true G1 (TSel x1) G2 (TSel x2) GH (S n1) (* hypothetical object *) | stp2_sela1: forall m G1 G2 GX TX x T2 GH n1 n2, indexr x GH = Some (GX, TX) -> closed 0 x TX -> stp2 (S m) false GX TX G2 (TMem TBot T2) GH n1 -> stp2 (S m) true G2 T2 G2 T2 GH n2 -> (* regularity *) stp2 (S m) true G1 (TSelH x) G2 T2 GH (S (n1+n2)) | stp2_selab1: forall m G1 G2 GX TX x T2 T2' GH n1 n2, (* XXX TODO *) indexr x GH = Some (GX, TX) -> (* closed 0 x TX -> *) stp2 (S m) false GX TX G2 (TBind (TMem TBot T2)) [] n1 -> T2' = (open (TSelH x) T2) -> stp2 (S m) true G2 T2' G2 T2' GH n2 -> (* regularity *) stp2 (S m) true G1 (TSelH x) G2 T2' GH (S (n1+n2)) | stp2_sela2: forall m G1 G2 GX TX x T1 GH n1 n2, indexr x GH = Some (GX, TX) -> closed 0 x TX -> stp2 (S m) false GX TX G2 (TMem T1 TTop) GH n1 -> stp2 (S m) true G1 T1 G1 T1 GH n2 -> (* regularity *) stp2 (S m) true G1 T1 G2 (TSelH x) GH (S (n1+n2)) | stp2_selax: forall m G1 G2 GX TX x GH n1, indexr x GH = Some (GX, TX) -> stp2 (S m) true G1 (TSelH x) G2 (TSelH x) GH (S n1) | stp2_all: forall m G1 G2 T1 T2 T3 T4 GH n1 n1' n2, stp2 MAX false G2 T3 G1 T1 GH n1 -> closed 1 (length GH) T2 -> (* must not accidentally bind x *) closed 1 (length GH) T4 -> stp2 MAX false G1 (open (TSelH (length GH)) T2) G1 (open (TSelH (length GH)) T2) ((0,(G1, T1))::GH) n1' -> (* regularity *) stp2 MAX false G1 (open (TSelH (length GH)) T2) G2 (open (TSelH (length GH)) T4) ((0,(G2, T3))::GH) n2 -> stp2 m true G1 (TAll T1 T2) G2 (TAll T3 T4) GH (S (n1+n1'+n2)) | stp2_bind: forall G1 G2 T1 T2 GH n1 n2, closed 1 (length GH) T1 -> (* must not accidentally bind x *) closed 1 (length GH) T2 -> stp2 1 false G2 (open (TSelH (length GH)) T2) G2 (open (TSelH (length GH)) T2) ((0,(G2, open (TSelH (length GH)) T2))::GH) n2 -> (* regularity *) stp2 1 false G1 (open (TSelH (length GH)) T1) G2 (open (TSelH (length GH)) T2) ((0,(G1, open (TSelH (length GH)) T1))::GH) n1 -> stp2 0 true G1 (TBind T1) G2 (TBind T2) GH (S (n1+n2)) | stp2_bindb: forall m G1 G2 T1 T2 GH n1 n2, closed 1 (length GH) T1 -> (* must not accidentally bind x *) closed 1 (length GH) T2 -> stp2 (S m) false G2 (open (TSelH (length GH)) T2) G2 (open (TSelH (length GH)) T2) ((0,(G2, open (TSelH (length GH)) T2))::GH) n2 -> (* regularity *) stp2 (S m) false G1 (open (TSelH (length GH)) T1) G2 (open (TSelH (length GH)) T2) ((0,(G1, open (TSelH (length GH)) T1))::GH) n1 -> stp2 (S m) true G1 (TBind T1) G2 (TBind T2) GH (S (n1+n2)) | stp2_wrapf: forall m G1 G2 T1 T2 GH n1, stp2 m true G1 T1 G2 T2 GH n1 -> stp2 m false G1 T1 G2 T2 GH (S n1) | stp2_transf: forall m G1 G2 G3 T1 T2 T3 GH n1 n2, stp2 m true G1 T1 G2 T2 GH n1 -> stp2 m false G2 T2 G3 T3 GH n2 -> stp2 m false G1 T1 G3 T3 GH (S (n1+n2)) with wf_env : venv -> tenv -> Prop := | wfe_nil : wf_env nil nil | wfe_cons : forall n v t vs ts, val_type ((n,v)::vs) v t -> wf_env vs ts -> wf_env (cons (n,v) vs) (cons (n,t) ts) with val_type : venv -> vl -> ty -> Prop := | v_ty: forall env venv tenv T1 TE, wf_env venv tenv -> (* T1 wf in tenv ? *) (exists n, stp2 0 true venv (TMem T1 T1) env TE [] n)-> val_type env (vty venv T1) TE | v_bool: forall venv b TE, (exists n, stp2 0 true [] TBool venv TE [] n) -> val_type venv (vbool b) TE | v_abs: forall env venv tenv f x y T1 T2 TE, wf_env venv tenv -> has_type ((x,T1)::(f,TFun T1 T2)::tenv) y T2 -> fresh venv <= f -> 1 + f <= x -> (exists n, stp2 0 true venv (TFun T1 T2) env TE [] n)-> val_type env (vabs venv f x y) TE | v_tabs: forall env venv tenv x y T1 T2 TE, wf_env venv tenv -> has_type ((x,T1)::tenv) y (open (TSel x) T2) -> fresh venv = x -> (exists n, stp2 0 true venv (TAll T1 T2) env TE [] n) -> val_type env (vtabs venv x T1 y) TE | v_pack: forall venv venv3 x v T T2 T3, index x venv = Some v -> val_type venv v T -> open (TSel x) T2 = T -> (exists n, stp2 0 true venv (TBind T2) venv3 T3 [] n) -> val_type venv3 v T3 . Inductive wf_envh : venv -> aenv -> tenv -> Prop := | wfeh_nil : forall vvs, wf_envh vvs nil nil | wfeh_cons : forall n t vs vvs ts, wf_envh vvs vs ts -> wf_envh vvs (cons (n,(vvs,t)) vs) (cons (n,t) ts) . Inductive valh_type : venv -> aenv -> (venv*ty) -> ty -> Prop := | v_tya: forall aenv venv T1, valh_type venv aenv (venv, T1) T1 . Definition stpd2 b G1 T1 G2 T2 GH := exists n, stp2 MAX b G1 T1 G2 T2 GH n. Definition atpd2 b G1 T1 G2 T2 GH := exists n, stp2 1 b G1 T1 G2 T2 GH n. Definition sstpd2 b G1 T1 G2 T2 GH := exists n, stp2 0 b G1 T1 G2 T2 GH n. Ltac ep := match goal with | [ |- stp2 ?M1 ?M2 ?G1 ?T1 ?G2 ?T2 ?GH ?N ] => assert (exists (x:nat), stp2 M1 M2 G1 T1 G2 T2 GH x) as EEX end. Ltac eu := match goal with | H: stpd2 _ _ _ _ _ _ |- _ => destruct H as [? H] | H: atpd2 _ _ _ _ _ _ |- _ => destruct H as [? H] | H: sstpd2 _ _ _ _ _ _ |- _ => destruct H as [? H] (* | H: exists n: nat , _ |- _ => destruct H as [e P] *) end. Hint Constructors stp2. Hint Unfold stpd2. Lemma stpd2_topx: forall G1 G2 GH, stpd2 true G1 TTop G2 TTop GH. Proof. intros. repeat exists (S 0). eauto. Qed. Lemma stpd2_botx: forall G1 G2 GH, stpd2 true G1 TBot G2 TBot GH. Proof. intros. repeat exists (S 0). eauto. Qed. Lemma stpd2_top: forall G1 G2 GH T, stpd2 true G1 T G1 T GH -> stpd2 true G1 T G2 TTop GH. Proof. intros. repeat eu. eauto. Qed. Lemma stpd2_bot: forall G1 G2 GH T, stpd2 true G2 T G2 T GH -> stpd2 true G1 TBot G2 T GH. Proof. intros. repeat eu. eauto. Qed. Lemma stpd2_bool: forall G1 G2 GH, stpd2 true G1 TBool G2 TBool GH. Proof. intros. repeat exists (S 0). eauto. Qed. Lemma stpd2_fun: forall G1 G2 GH T11 T12 T21 T22, stpd2 false G2 T21 G1 T11 GH -> stpd2 false G1 T12 G2 T22 GH -> stpd2 true G1 (TFun T11 T12) G2 (TFun T21 T22) GH. Proof. intros. repeat eu. eauto. Qed. Lemma stpd2_mem: forall G1 G2 GH T11 T12 T21 T22, stpd2 false G2 T21 G1 T11 GH -> stpd2 false G1 T12 G2 T22 GH -> stpd2 true G1 (TMem T11 T12) G2 (TMem T21 T22) GH. Proof. intros. repeat eu. eauto. unfold stpd2. eexists. eapply stp2_mem2; eauto. Qed. Lemma stpd2_sel1: forall G1 G2 GX TX x T2 GH v, index x G1 = Some v -> val_type GX v TX -> closed 0 0 TX -> stpd2 false GX TX G2 (TMem TBot T2) GH -> stpd2 true G2 T2 G2 T2 GH -> stpd2 true G1 (TSel x) G2 T2 GH. Proof. intros. repeat eu. eexists. eapply stp2_sel1; eauto. Qed. Lemma stpd2_selb1: forall G1 G2 GX TX x T2 GH v, index x G1 = Some v -> val_type GX v TX -> closed 0 0 TX -> stpd2 false GX TX G2 (TBind (TMem TBot T2)) [] -> (* Note GH = [] *) stpd2 true G2 (open (TSel x) T2) G2 (open (TSel x) T2) GH -> stpd2 true G1 (TSel x) G2 (open (TSel x) T2) GH. Proof. intros. repeat eu. eexists. eapply stp2_selb1; eauto. Qed. Lemma stpd2_sel2: forall G1 G2 GX TX x T1 GH v, index x G2 = Some v -> val_type GX v TX -> closed 0 0 TX -> stpd2 false GX TX G1 (TMem T1 TTop) GH -> stpd2 true G1 T1 G1 T1 GH -> stpd2 true G1 T1 G2 (TSel x) GH. Proof. intros. repeat eu. eexists. eapply stp2_sel2; eauto. Qed. Lemma stpd2_selx: forall G1 G2 x1 x2 GH v, index x1 G1 = Some v -> index x2 G2 = Some v -> stpd2 true G1 (TSel x1) G2 (TSel x2) GH. Proof. intros. eauto. exists (S 0). eapply stp2_selx; eauto. Qed. Lemma stpd2_selab1: forall G1 G2 GX TX x T2 GH, indexr x GH = Some (GX, TX) -> (* closed 0 x TX -> *) stpd2 false GX TX G2 (TBind (TMem TBot T2)) [] -> (* Note GH = [] *) stpd2 true G2 (open (TSelH x) T2) G2 (open (TSelH x) T2) GH -> stpd2 true G1 (TSelH x) G2 (open (TSelH x) T2) GH. Proof. intros. repeat eu. eauto. eexists. eapply stp2_selab1; eauto. Qed. Lemma stpd2_sela1: forall G1 G2 GX TX x T2 GH, indexr x GH = Some (GX, TX) -> closed 0 x TX -> stpd2 false GX TX G2 (TMem TBot T2) GH -> stpd2 true G2 T2 G2 T2 GH -> stpd2 true G1 (TSelH x) G2 T2 GH. Proof. intros. repeat eu. eauto. eexists. eapply stp2_sela1; eauto. Qed. Lemma stpd2_sela2: forall G1 G2 GX TX x T1 GH, indexr x GH = Some (GX, TX) -> closed 0 x TX -> stpd2 false GX TX G2 (TMem T1 TTop) GH -> stpd2 true G1 T1 G1 T1 GH -> stpd2 true G1 T1 G2 (TSelH x) GH. Proof. intros. repeat eu. eauto. eexists. eapply stp2_sela2; eauto. Qed. Lemma stpd2_selax: forall G1 G2 GX TX x GH, indexr x GH = Some (GX, TX) -> stpd2 true G1 (TSelH x) G2 (TSelH x) GH. Proof. intros. exists (S 0). eauto. eapply stp2_selax; eauto. Qed. Lemma stpd2_all: forall G1 G2 T1 T2 T3 T4 GH, stpd2 false G2 T3 G1 T1 GH -> closed 1 (length GH) T2 -> closed 1 (length GH) T4 -> stpd2 false G1 (open (TSelH (length GH)) T2) G1 (open (TSelH (length GH)) T2) ((0,(G1, T1))::GH) -> stpd2 false G1 (open (TSelH (length GH)) T2) G2 (open (TSelH (length GH)) T4) ((0,(G2, T3))::GH) -> stpd2 true G1 (TAll T1 T2) G2 (TAll T3 T4) GH. Proof. intros. repeat eu. eauto. Qed. Lemma stpd2_bind: forall G1 G2 T1 T2 GH, closed 1 (length GH) T1 -> closed 1 (length GH) T2 -> stpd2 false G2 (open (TSelH (length GH)) T2) G2 (open (TSelH (length GH)) T2) ((0,(G2, open (TSelH (length GH)) T2))::GH) -> stpd2 false G1 (open (TSelH (length GH)) T1) G2 (open (TSelH (length GH)) T2) ((0,(G1, open (TSelH (length GH)) T1))::GH) -> stpd2 true G1 (TBind T1) G2 (TBind T2) GH. Proof. intros. repeat eu. eauto. unfold stpd2. eexists. eapply stp2_bindb; eauto. Qed. Lemma stpd2_wrapf: forall G1 G2 T1 T2 GH, stpd2 true G1 T1 G2 T2 GH -> stpd2 false G1 T1 G2 T2 GH. Proof. intros. repeat eu. eauto. Qed. Lemma stpd2_transf: forall G1 G2 G3 T1 T2 T3 GH, stpd2 true G1 T1 G2 T2 GH -> stpd2 false G2 T2 G3 T3 GH -> stpd2 false G1 T1 G3 T3 GH. Proof. intros. repeat eu. eauto. Qed. Lemma sstpd2_wrapf: forall G1 G2 T1 T2 GH, sstpd2 true G1 T1 G2 T2 GH -> sstpd2 false G1 T1 G2 T2 GH. Proof. intros. repeat eu. eexists. eapply stp2_wrapf. eauto. Qed. Lemma sstpd2_transf: forall G1 G2 G3 T1 T2 T3 GH, sstpd2 true G1 T1 G2 T2 GH -> sstpd2 false G2 T2 G3 T3 GH -> sstpd2 false G1 T1 G3 T3 GH. Proof. intros. repeat eu. eexists. eapply stp2_transf; eauto. Qed. Lemma atpd2_transf: forall G1 G2 G3 T1 T2 T3 GH, atpd2 true G1 T1 G2 T2 GH -> atpd2 false G2 T2 G3 T3 GH -> atpd2 false G1 T1 G3 T3 GH. Proof. intros. repeat eu. eexists. eapply stp2_transf; eauto. Qed. (* None means timeout Some None means stuck Some (Some v)) means result v Could use do-notation to clean up syntax. *) Fixpoint teval(n: nat)(env: venv)(t: tm){struct n}: option (option vl) := match n with | 0 => None | S n => match t with | ttrue => Some (Some (vbool true)) | tfalse => Some (Some (vbool false)) | tvar x => Some (index x env) | tabs f x y => Some (Some (vabs env f x y)) | ttabs x T y => Some (Some (vtabs env x T y)) | ttyp T => Some (Some (vty env T)) | tapp ef ex => match teval n env ex with | None => None | Some None => Some None | Some (Some vx) => match teval n env ef with | None => None | Some None => Some None | Some (Some (vbool _)) => Some None | Some (Some (vty _ _)) => Some None | Some (Some (vtabs _ _ _ _)) => Some None | Some (Some (vabs env2 f x ey)) => teval n ((x,vx)::(f,vabs env2 f x ey)::env2) ey end end | ttapp ef ex => match teval n env ex with | None => None | Some None => Some None | Some (Some vx) => match teval n env ef with | None => None | Some None => Some None | Some (Some (vbool _)) => Some None | Some (Some (vty _ _)) => Some None | Some (Some (vabs _ _ _ _)) => Some None | Some (Some (vtabs env2 x T ey)) => teval n ((x,vx)::env2) ey end end end end. Hint Constructors ty. Hint Constructors tm. Hint Constructors vl. Hint Constructors closed_rec. Hint Constructors has_type. Hint Constructors val_type. Hint Constructors wf_env. Hint Constructors stp. Hint Constructors stp2. Hint Constructors option. Hint Constructors list. Hint Unfold index. Hint Unfold length. Hint Unfold closed. Hint Unfold open. Hint Resolve ex_intro. (* ############################################################ *) (* Examples *) (* ############################################################ *) (* match goal with | |- has_type _ (tvar _) _ => try solve [apply t_vara; repeat (econstructor; eauto)] | _ => idtac end; *) Ltac crush_has_tp := try solve [eapply stp_selx; compute; eauto; crush_has_tp]; try solve [eapply stp_selax; compute; eauto; crush_has_tp]; try solve [eapply cl_selb; compute; eauto; crush_has_tp]; try solve [(econstructor; compute; eauto; crush_has_tp)]. Ltac crush2 := try solve [(eapply stp_selx; compute; eauto; crush2)]; try solve [(eapply stp_selax; compute; eauto; crush2)]; try solve [(eapply stp_sel1; compute; eauto; crush2)]; try solve [(eapply stp_sela1; compute; eauto; crush2)]; try solve [(eapply cl_selb; compute; eauto; crush2)]; try solve [(econstructor; compute; eauto; crush2)]; try solve [(eapply t_sub; eapply t_var; compute; eauto; crush2)]. (* define polymorphic identity function *) Definition polyId := TAll (TBind (TMem TBot TTop)) (TFun (TSelB 0) (TSelB 0)). Example ex1: has_type [] (ttabs 0 (TBind (TMem TBot TTop)) (tabs 1 2 (tvar 2))) polyId. Proof. crush2. Qed. (* instantiate it to bool *) Example ex2: has_type [(0,polyId)] (ttapp (tvar 0) (ttyp TBool)) (TFun TBool TBool). Proof. eapply t_tapp. instantiate (1:= (TBind (TMem TBool TBool))). { eapply t_sub. { eapply t_var. simpl. eauto. } { eapply stp_all; eauto. { eapply stp_bindx; crush2. } compute. eapply cl_fun; eauto. eapply stp_fun. compute. eapply stp_selax; crush2. crush2. eapply stp_fun. compute. eapply stp_selab2. crush2. instantiate (1:=TBool). crush2. crush2. crush2. simpl. eapply stp_selab1. crush2. instantiate (1:=TBool). crush2. crush2. crush2. } } { eapply t_typ; crush2. } crush2. Qed. (* define brand / unbrand client function *) Definition brandUnbrand := TAll (TBind (TMem TBot TTop)) (TFun (TFun TBool (TSelB 0)) (* brand *) (TFun (TFun (TSelB 0) TBool) (* unbrand *) TBool)). Example ex3: has_type [] (ttabs 0 (TBind (TMem TBot TTop)) (tabs 1 2 (tabs 3 4 (tapp (tvar 4) (tapp (tvar 2) ttrue))))) brandUnbrand. Proof. crush2. Qed. (* instantiating it at bool is admissible *) Example ex4: has_type [(1,TFun TBool TBool);(0,brandUnbrand)] (tvar 0) (TAll (TBind (TMem TBool TBool)) (TFun (TFun TBool TBool) (TFun (TFun TBool TBool) TBool))). Proof. eapply t_sub. crush2. crush2. eapply stp_all; crush2. compute. eapply stp_fun. eapply stp_fun. crush2. eapply stp_selab2. crush2. instantiate(1:=TBool). crush2. crush2. crush2. eapply stp_fun. crush2. eapply stp_fun. eapply stp_selab1. crush2. instantiate(1:=TBool). crush2. crush2. crush2. crush2. crush2. Qed. Hint Resolve ex4. (* apply it to identity functions *) Example ex5: has_type [(1,TFun TBool TBool);(0,brandUnbrand)] (tapp (tapp (ttapp (tvar 0) (ttyp TBool)) (tvar 1)) (tvar 1)) TBool. Proof. crush2. Qed. (* test expansion *) Example ex6: has_type [(1,TSel 0);(0,TMem TBot (TBind (TFun TBool (TSelB 0))))] (tvar 1) (TFun TBool (TSel 1)). Proof. remember (TFun TBool (TSel 1)) as T. assert (T = open (TSel 1) (TFun TBool (TSelB 0))). compute. eauto. rewrite H. eapply t_var_unpack. eapply t_sub. eapply t_var. compute. eauto. crush2. Qed. Example ex7: stp [(1,TSel 0);(0,TMem TBot (TBind (TMem TBot (TFun TBool (TSelB 0)))))] [] (TSel 1) (TFun TBool(TSel 1)). Proof. remember (TFun TBool (TSel 1)) as T. assert (T = open (TSel 1) (TFun TBool (TSelB 0))). compute. eauto. rewrite H. eapply stp_selb1. compute. eauto. eapply stp_sel1. compute. eauto. crush2. eapply stp_mem. eauto. eapply stp_bindx; crush2. eapply stp_bindx; crush2. crush2. Qed. (* ############################################################ *) (* Proofs *) (* ############################################################ *) Lemma wf_fresh : forall vs ts, wf_env vs ts -> (fresh vs = fresh ts). Proof. intros. induction H. auto. compute. eauto. Qed. Hint Immediate wf_fresh. Lemma wfh_length : forall vvs vs ts, wf_envh vvs vs ts -> (length vs = length ts). Proof. intros. induction H. auto. compute. eauto. Qed. Hint Immediate wf_fresh. Lemma index_max : forall X vs n (T: X), index n vs = Some T -> n < fresh vs. Proof. intros X vs. induction vs. - Case "nil". intros. inversion H. - Case "cons". intros. inversion H. destruct a. case_eq (le_lt_dec (fresh vs) i); intros ? E1. + SCase "ok". rewrite E1 in H1. case_eq (beq_nat n i); intros E2. * SSCase "hit". eapply beq_nat_true in E2. subst n. compute. eauto. * SSCase "miss". rewrite E2 in H1. assert (n < fresh vs). eapply IHvs. apply H1. compute. omega. + SCase "bad". rewrite E1 in H1. inversion H1. Qed. Lemma indexr_max : forall X vs n (T: X), indexr n vs = Some T -> n < length vs. Proof. intros X vs. induction vs. - Case "nil". intros. inversion H. - Case "cons". intros. inversion H. destruct a. case_eq (beq_nat n (length vs)); intros E2. + SSCase "hit". eapply beq_nat_true in E2. subst n. compute. eauto. + SSCase "miss". rewrite E2 in H1. assert (n < length vs). eapply IHvs. apply H1. compute. eauto. Qed. Lemma le_xx : forall a b, a <= b -> exists E, le_lt_dec a b = left E. Proof. intros. case_eq (le_lt_dec a b). intros. eauto. intros. omega. Qed. Lemma le_yy : forall a b, a > b -> exists E, le_lt_dec a b = right E. Proof. intros. case_eq (le_lt_dec a b). intros. omega. intros. eauto. Qed. Lemma index_extend : forall X vs n n' x (T: X), index n vs = Some T -> fresh vs <= n' -> index n ((n',x)::vs) = Some T. Proof. intros. assert (n < fresh vs). eapply index_max. eauto. assert (n <> n'). omega. assert (beq_nat n n' = false) as E. eapply beq_nat_false_iff; eauto. assert (fresh vs <= n') as E2. omega. elim (le_xx (fresh vs) n' E2). intros ? EX. unfold index. unfold index in H. rewrite H. rewrite E. rewrite EX. reflexivity. Qed. Lemma indexr_extend : forall X vs n n' x (T: X), indexr n vs = Some T -> indexr n ((n',x)::vs) = Some T. Proof. intros. assert (n < length vs). eapply indexr_max. eauto. assert (beq_nat n (length vs) = false) as E. eapply beq_nat_false_iff. omega. unfold indexr. unfold indexr in H. rewrite H. rewrite E. reflexivity. Qed. (* splicing -- for stp_extend. not finished *) Fixpoint splice n (T : ty) {struct T} : ty := match T with | TTop => TTop | TBot => TBot | TBool => TBool | TMem T1 T2 => TMem (splice n T1) (splice n T2) | TFun T1 T2 => TFun (splice n T1) (splice n T2) | TSelB i => TSelB i | TSel i => TSel i | TSelH i => if le_lt_dec n i then TSelH (i+1) else TSelH i | TAll T1 T2 => TAll (splice n T1) (splice n T2) | TBind T2 => TBind (splice n T2) end. Definition splicett n (V: (id*ty)) := match V with | (x,T) => (x,(splice n T)) end. Definition spliceat n (V: (id*(venv*ty))) := match V with | (x,(G,T)) => (x,(G,splice n T)) end. Lemma splice_open_permute: forall {X} (G:list (id*X)) T n j k, n + k >= length G -> (open_rec j (TSelH (n + S k)) (splice (length G) T)) = (splice (length G) (open_rec j (TSelH (n + k)) T)). Proof. intros X G T. induction T; intros; simpl; eauto; try rewrite IHT1; try rewrite IHT2; try rewrite IHT; eauto. case_eq (le_lt_dec (length G) i); intros E LE; simpl; eauto. case_eq (beq_nat j i); intros E; simpl; eauto. case_eq (le_lt_dec (length G) (n + length G)); intros EL LE. assert (n + S (length G) = n + length G + 1). omega. case_eq (le_lt_dec (length G) (n+k)); intros E' LE'; simpl; eauto. assert (n + S k=n + k + 1) as R by omega. rewrite R. reflexivity. omega. omega. Qed. Lemma indexr_splice_hi: forall G0 G2 x0 x v1 T, indexr x0 (G2 ++ G0) = Some T -> length G0 <= x0 -> indexr (x0 + 1) (map (splicett (length G0)) G2 ++ (x, v1) :: G0) = Some (splice (length G0) T). Proof. intros G0 G2. induction G2; intros. - eapply indexr_max in H. simpl in H. omega. - simpl in H. destruct a. case_eq (beq_nat x0 (length (G2 ++ G0))); intros E. + rewrite E in H. inversion H. subst. simpl. rewrite app_length in E. rewrite app_length. rewrite map_length. simpl. assert (beq_nat (x0 + 1) (length G2 + S (length G0)) = true). eapply beq_nat_true_iff. eapply beq_nat_true_iff in E. omega. rewrite H1. eauto. + rewrite E in H. eapply IHG2 in H. eapply indexr_extend. eapply H. eauto. Qed. Lemma indexr_spliceat_hi: forall G0 G2 x0 x v1 G T, indexr x0 (G2 ++ G0) = Some (G, T) -> length G0 <= x0 -> indexr (x0 + 1) (map (spliceat (length G0)) G2 ++ (x, v1) :: G0) = Some (G, splice (length G0) T). Proof. intros G0 G2. induction G2; intros. - eapply indexr_max in H. simpl in H. omega. - simpl in H. destruct a. case_eq (beq_nat x0 (length (G2 ++ G0))); intros E. + rewrite E in H. inversion H. subst. simpl. rewrite app_length in E. rewrite app_length. rewrite map_length. simpl. assert (beq_nat (x0 + 1) (length G2 + S (length G0)) = true). eapply beq_nat_true_iff. eapply beq_nat_true_iff in E. omega. rewrite H1. eauto. + rewrite E in H. eapply IHG2 in H. destruct p. eapply indexr_extend. eapply H. eauto. Qed. Lemma plus_lt_contra: forall a b, a + b < b -> False. Proof. intros a b H. induction a. - simpl in H. apply lt_irrefl in H. assumption. - simpl in H. apply IHa. omega. Qed. Lemma indexr_splice_lo0: forall {X} G0 G2 x0 (T:X), indexr x0 (G2 ++ G0) = Some T -> x0 < length G0 -> indexr x0 G0 = Some T. Proof. intros X G0 G2. induction G2; intros. - simpl in H. apply H. - simpl in H. destruct a. case_eq (beq_nat x0 (length (G2 ++ G0))); intros E. + eapply beq_nat_true_iff in E. subst. rewrite app_length in H0. apply plus_lt_contra in H0. inversion H0. + rewrite E in H. apply IHG2. apply H. apply H0. Qed. Lemma indexr_extend_mult: forall {X} G0 G2 x0 (T:X), indexr x0 G0 = Some T -> indexr x0 (G2++G0) = Some T. Proof. intros X G0 G2. induction G2; intros. - simpl. assumption. - destruct a. simpl. case_eq (beq_nat x0 (length (G2 ++ G0))); intros E. + eapply beq_nat_true_iff in E. apply indexr_max in H. subst. rewrite app_length in H. apply plus_lt_contra in H. inversion H. + apply IHG2. assumption. Qed. Lemma indexr_splice_lo: forall G0 G2 x0 x v1 T f, indexr x0 (G2 ++ G0) = Some T -> x0 < length G0 -> indexr x0 (map (splicett f) G2 ++ (x, v1) :: G0) = Some T. Proof. intros. assert (indexr x0 G0 = Some T). eapply indexr_splice_lo0; eauto. eapply indexr_extend_mult. eapply indexr_extend. eauto. Qed. Lemma indexr_spliceat_lo: forall G0 G2 x0 x v1 G T f, indexr x0 (G2 ++ G0) = Some (G, T) -> x0 < length G0 -> indexr x0 (map (spliceat f) G2 ++ (x, v1) :: G0) = Some (G, T). Proof. intros. assert (indexr x0 G0 = Some (G, T)). eapply indexr_splice_lo0; eauto. eapply indexr_extend_mult. eapply indexr_extend. eauto. Qed. Lemma fresh_splice_ctx: forall G n, fresh G = fresh (map (splicett n) G). Proof. intros. induction G. - simpl. reflexivity. - destruct a. simpl. reflexivity. Qed. Lemma index_splice_ctx: forall G x T n, index x G = Some T -> index x (map (splicett n) G) = Some (splice n T). Proof. intros. induction G. - simpl in H. inversion H. - destruct a. simpl in H. case_eq (le_lt_dec (fresh G) i); intros E LE; rewrite LE in H. case_eq (beq_nat x i); intros Eq; rewrite Eq in H. inversion H. simpl. erewrite <- (fresh_splice_ctx). rewrite LE. rewrite Eq. reflexivity. simpl. erewrite <- (fresh_splice_ctx). rewrite LE. rewrite Eq. apply IHG. apply H. inversion H. Qed. Lemma closed_splice: forall j l T n, closed j l T -> closed j (S l) (splice n T). Proof. intros. induction H; simpl; eauto. case_eq (le_lt_dec n x); intros E LE. unfold closed. apply cl_selh. omega. unfold closed. apply cl_selh. omega. Qed. Lemma map_splice_length_inc: forall G0 G2 x v1, (length (map (splicett (length G0)) G2 ++ (x, v1) :: G0)) = (S (length (G2 ++ G0))). Proof. intros. rewrite app_length. rewrite map_length. induction G2. - simpl. reflexivity. - simpl. eauto. Qed. Lemma map_spliceat_length_inc: forall G0 G2 x v1, (length (map (spliceat (length G0)) G2 ++ (x, v1) :: G0)) = (S (length (G2 ++ G0))). Proof. intros. rewrite app_length. rewrite map_length. induction G2. - simpl. reflexivity. - simpl. eauto. Qed. Lemma closed_inc: forall j l T, closed j l T -> closed j (S l) T. Proof. intros. induction H; simpl; eauto. unfold closed. apply cl_selh. omega. Qed. Lemma closed_inc_mult: forall j l l' T, closed j l T -> l' >= l -> closed j l' T. Proof. intros j l l' T H LE. induction LE. - assumption. - apply closed_inc. assumption. Qed. Ltac sp := match goal with | A : ?P, H : ?P -> _ |- _ => specialize (H A) end. Lemma closed_splice_idem: forall k l T n, closed k l T -> n >= l -> splice n T = T. Proof. intros. induction H; simpl; repeat sp; repeat (match goal with | H: splice ?N ?T = ?T |- _ => rewrite H end); eauto. case_eq (le_lt_dec n x); intros E LE. omega. reflexivity. Qed. Ltac ev := repeat match goal with | H: exists _, _ |- _ => destruct H | H: _ /\ _ |- _ => destruct H end. Lemma closed_upgrade: forall i j l T, closed_rec i l T -> j >= i -> closed_rec j l T. Proof. intros. generalize dependent j. induction H; intros; eauto. Case "TAll". econstructor. eapply IHclosed_rec1. omega. eapply IHclosed_rec2. omega. Case "TBind". econstructor. eapply IHclosed_rec. omega. Case "TSelB". econstructor. omega. Qed. Lemma closed_upgrade_free: forall i l k T, closed_rec i l T -> k >= l -> closed_rec i k T. Proof. intros. generalize dependent k. induction H; intros; eauto. Case "TSelH". econstructor. omega. Qed. Lemma closed_open: forall j n TX T, closed (j+1) n T -> closed j n TX -> closed j n (open_rec j TX T). Proof. intros. generalize dependent j. induction T; intros; inversion H; unfold closed; try econstructor; try eapply IHT1; eauto; try eapply IHT2; eauto; try eapply IHT; eauto. eapply closed_upgrade. eauto. eauto. - Case "TSelB". simpl. case_eq (beq_nat j i); intros E. eauto. econstructor. eapply beq_nat_false_iff in E. omega. - eauto. - eapply closed_upgrade; eauto. - eapply closed_upgrade; eauto. Qed. Lemma stp_closed : forall G GH T1 T2, stp G GH T1 T2 -> closed 0 (length GH) T1 /\ closed 0 (length GH) T2. Proof. intros. induction H; try solve [repeat ev; split; eauto using indexr_max]; try solve [try inversion IHstp; split; eauto; apply cl_selh; eapply indexr_max; eassumption]; try solve [inversion IHstp1 as [IH1 IH2]; inversion IH2; split; eauto; apply cl_selh; eapply indexr_max; eassumption]. Qed. Lemma stp_closed2 : forall G1 GH T1 T2, stp G1 GH T1 T2 -> closed 0 (length GH) T2. Proof. intros. apply (proj2 (stp_closed G1 GH T1 T2 H)). Qed. Lemma stp_closed1 : forall G1 GH T1 T2, stp G1 GH T1 T2 -> closed 0 (length GH) T1. Proof. intros. apply (proj1 (stp_closed G1 GH T1 T2 H)). Qed. Lemma stp2_closed: forall G1 G2 T1 T2 GH s m n1, stp2 s m G1 T1 G2 T2 GH n1 -> closed 0 (length GH) T1 /\ closed 0 (length GH) T2. intros. induction H; try solve [repeat ev; split; eauto]; try solve [try inversion IHstp2_1; try inversion IHstp2_2; split; eauto; apply cl_selh; eapply indexr_max; eassumption]; try solve [inversion IHstp2 as [IH1 IH2]; inversion IH2; split; eauto; apply cl_selh; eapply indexr_max; eassumption]. Qed. Lemma stp2_closed2 : forall G1 G2 T1 T2 GH s m n1, stp2 s m G1 T1 G2 T2 GH n1 -> closed 0 (length GH) T2. Proof. intros. apply (proj2 (stp2_closed G1 G2 T1 T2 GH s m n1 H)). Qed. Lemma stp2_closed1 : forall G1 G2 T1 T2 GH s m n1, stp2 s m G1 T1 G2 T2 GH n1 -> closed 0 (length GH) T1. Proof. intros. apply (proj1 (stp2_closed G1 G2 T1 T2 GH s m n1 H)). Qed. Lemma stp_splice : forall GX G0 G1 T1 T2 x v1, stp GX (G1++G0) T1 T2 -> stp GX ((map (splicett (length G0)) G1) ++ (x,v1)::G0) (splice (length G0) T1) (splice (length G0) T2). Proof. intros GX G0 G1 T1 T2 x v1 H. remember (G1++G0) as G. revert G0 G1 HeqG. induction H; intros; subst GH; simpl; eauto. - Case "sel1". eapply stp_sel1. apply H. assumption. assert (splice (length G0) TX=TX) as A. { eapply closed_splice_idem. eassumption. omega. } rewrite <- A. apply IHstp1. reflexivity. apply IHstp2. reflexivity. - Case "sel2". eapply stp_sel2. apply H. assumption. assert (splice (length G0) TX=TX) as A. { eapply closed_splice_idem. eassumption. omega. } rewrite <- A. apply IHstp1. reflexivity. apply IHstp2. reflexivity. - Case "selb1". assert (splice (length G0) (open (TSel x0) T2)=(open (TSel x0) T2)) as A. { eapply closed_splice_idem. apply stp_closed2 in H0. inversion H0. subst. simpl in H5. inversion H5. subst. eapply closed_open. simpl. eassumption. eauto. omega. } rewrite A. eapply stp_selb1; eauto. rewrite <- A. apply IHstp2; eauto. - Case "selb2". assert (splice (length G0) (open (TSel x0) T1)=(open (TSel x0) T1)) as A. { eapply closed_splice_idem. apply stp_closed2 in H0. inversion H0. subst. simpl in H5. inversion H5. subst. eapply closed_open. simpl. eassumption. eauto. omega. } rewrite A. eapply stp_selb2; eauto. rewrite <- A. apply IHstp2; eauto. - Case "sela1". case_eq (le_lt_dec (length G0) x0); intros E LE. + eapply stp_sela1. eapply indexr_splice_hi. eauto. eauto. eapply closed_splice in H0. assert (S x0 = x0 +1) as A by omega. rewrite <- A. eapply H0. eapply IHstp1. eauto. eapply IHstp2. eauto. + eapply stp_sela1. eapply indexr_splice_lo. eauto. eauto. eauto. eauto. assert (splice (length G0) TX=TX) as A. { eapply closed_splice_idem. eassumption. omega. } rewrite <- A. eapply IHstp1. eauto. eapply IHstp2. eauto. - Case "sela2". case_eq (le_lt_dec (length G0) x0); intros E LE. + eapply stp_sela2. eapply indexr_splice_hi. eauto. eauto. eapply closed_splice in H0. assert (S x0 = x0 +1) as A by omega. rewrite <- A. eapply H0. eapply IHstp1. eauto. eapply IHstp2. eauto. + eapply stp_sela2. eapply indexr_splice_lo. eauto. eauto. eauto. eauto. assert (splice (length G0) TX=TX) as A. { eapply closed_splice_idem. eassumption. omega. } rewrite <- A. eapply IHstp1. eauto. eapply IHstp2. eauto. - Case "selab1". case_eq (le_lt_dec (length G0) x0); intros E LE. + eapply stp_selab1. eapply indexr_splice_hi; eauto. instantiate (1:=T2). assert (splice (length G0) TX=TX) as A. { apply stp_closed1 in H0. simpl in H0. eapply closed_splice_idem. apply H0. omega. } rewrite A. apply H0. rewrite H1. unfold open. assert (TSelH x0=TSelH (x0+0)) as B. { rewrite <- plus_n_O. reflexivity. } rewrite B. rewrite <- splice_open_permute. assert (splice (length G0) T2=T2) as C. { apply stp_closed2 in H0. simpl in H0. inversion H0; subst. inversion H6; subst. eapply closed_splice_idem. eassumption. omega. } rewrite C. reflexivity. omega. apply IHstp2; eauto. + eapply stp_selab1. eapply indexr_splice_lo; eauto. eassumption. rewrite H1. apply stp_closed2 in H0. simpl in H0. inversion H0; subst. inversion H6; subst. apply closed_upgrade_free with (k:=(length G0)) in H8. eapply closed_splice_idem. eapply closed_open. eassumption. apply cl_selh. omega. omega. omega. apply IHstp2; eauto. - Case "selab2". case_eq (le_lt_dec (length G0) x0); intros E LE. + eapply stp_selab2. eapply indexr_splice_hi; eauto. instantiate (1:=T1). assert (splice (length G0) TX=TX) as A. { apply stp_closed1 in H0. simpl in H0. eapply closed_splice_idem. apply H0. omega. } rewrite A. apply H0. rewrite H1. unfold open. assert (TSelH x0=TSelH (x0+0)) as B. { rewrite <- plus_n_O. reflexivity. } rewrite B. rewrite <- splice_open_permute. assert (splice (length G0) T1=T1) as C. { apply stp_closed2 in H0. simpl in H0. inversion H0; subst. inversion H6; subst. eapply closed_splice_idem. eassumption. omega. } rewrite C. reflexivity. omega. apply IHstp2; eauto. + eapply stp_selab2. eapply indexr_splice_lo; eauto. eassumption. rewrite H1. apply stp_closed2 in H0. simpl in H0. inversion H0; subst. inversion H6; subst. apply closed_upgrade_free with (k:=(length G0)) in H7. eapply closed_splice_idem. eapply closed_open. eassumption. apply cl_selh. omega. omega. omega. apply IHstp2; eauto. - Case "selax". case_eq (le_lt_dec (length G0) x0); intros E LE. + eapply stp_selax. eapply indexr_splice_hi. eauto. eauto. + eapply stp_selax. eapply indexr_splice_lo. eauto. eauto. - Case "all". eapply stp_all. eapply IHstp1. eauto. eauto. eauto. simpl. rewrite map_splice_length_inc. apply closed_splice. assumption. simpl. rewrite map_splice_length_inc. apply closed_splice. assumption. specialize IHstp2 with (G3:=G0) (G4:=(0, T1) :: G2). simpl in IHstp2. rewrite app_length. rewrite map_length. simpl. repeat rewrite splice_open_permute with (j:=0). subst x0. rewrite app_length in IHstp2. simpl in IHstp2. eapply IHstp2. eauto. omega. specialize IHstp3 with (G3:=G0) (G4:=(0, T3) :: G2). simpl in IHstp2. rewrite app_length. rewrite map_length. simpl. repeat rewrite splice_open_permute with (j:=0). subst x0. rewrite app_length in IHstp3. simpl in IHstp3. eapply IHstp3. eauto. omega. omega. - Case "bind". eapply stp_bindx. eauto. rewrite map_splice_length_inc. apply closed_splice. assumption. rewrite map_splice_length_inc. apply closed_splice. assumption. rewrite app_length. rewrite map_length. simpl. repeat rewrite splice_open_permute with (j:=0). subst x0. specialize IHstp1 with (G3:=G0) (G4:=(0, (open (TSelH (length G2 + length G0)) T2))::G2). rewrite app_length in IHstp1. simpl in IHstp1. unfold open in IHstp1. eapply IHstp1. eauto. omega. rewrite app_length. rewrite map_length. simpl. repeat rewrite splice_open_permute with (j:=0). subst x0. specialize IHstp2 with (G3:=G0) (G4:=(0, (open (TSelH (length G2 + length G0)) T1))::G2). rewrite app_length in IHstp2. simpl in IHstp2. unfold open in IHstp2. eapply IHstp2. eauto. omega. omega. Qed. Lemma stp2_splice : forall G1 T1 G2 T2 GH1 GH0 x v1 s m n1, stp2 s m G1 T1 G2 T2 (GH1++GH0) n1 -> stp2 s m G1 (splice (length GH0) T1) G2 (splice (length GH0) T2) ((map (spliceat (length GH0)) GH1) ++ (x,v1)::GH0) n1. Proof. intros G1 T1 G2 T2 GH1 GH0 x v1 s m n1 H. remember (GH1++GH0) as GH. revert GH0 GH1 HeqGH. induction H; intros; subst GH; simpl; eauto. - Case "strong_sel1". eapply stp2_strong_sel1. apply H. assumption. (*assumption.*) assert (splice (length GH0) TX=TX) as A. { eapply closed_splice_idem. eassumption. omega. } rewrite <- A. apply IHstp2. reflexivity. - Case "strong_sel2". eapply stp2_strong_sel2. apply H. assumption. (*assumption.*) assert (splice (length GH0) TX=TX) as A. { eapply closed_splice_idem. eassumption. omega. } rewrite <- A. apply IHstp2. reflexivity. - Case "sel1". eapply stp2_sel1. apply H. eassumption. assumption. assert (splice (length GH0) TX=TX) as A. { eapply closed_splice_idem. eassumption. omega. } rewrite <- A. apply IHstp2_1. reflexivity. apply IHstp2_2. reflexivity. - Case "selb1". assert (splice (length GH0) (open (TSel x0) T2)=(open (TSel x0) T2)) as A. { eapply closed_splice_idem. apply stp2_closed2 in H2. inversion H2. subst. simpl in H7. inversion H7. subst. eapply closed_open. simpl. eassumption. eauto. omega. } rewrite A. eapply stp2_selb1; eauto. rewrite <- A. apply IHstp2_2; eauto. - Case "sel2". eapply stp2_sel2. apply H. eassumption. assumption. assert (splice (length GH0) TX=TX) as A. { eapply closed_splice_idem. eassumption. omega. } rewrite <- A. apply IHstp2_1. reflexivity. apply IHstp2_2. reflexivity. - Case "sela1". case_eq (le_lt_dec (length GH0) x0); intros E LE. + eapply stp2_sela1. eapply indexr_spliceat_hi. apply H. eauto. eapply closed_splice in H0. assert (S x0 = x0 +1) as EQ by omega. rewrite <- EQ. eapply H0. eapply IHstp2_1. eauto. eapply IHstp2_2. eauto. + eapply stp2_sela1. eapply indexr_spliceat_lo. apply H. eauto. eauto. assert (splice (length GH0) TX=TX) as A. { eapply closed_splice_idem. eassumption. omega. } rewrite <- A. eapply IHstp2_1. eauto. eapply IHstp2_2. eauto. - Case "selab1". case_eq (le_lt_dec (length GH0) x0); intros E LE. + eapply stp2_selab1. eapply indexr_spliceat_hi; eauto. instantiate (1:=T2). assert (splice (length GH0) TX=TX) as A. { apply stp2_closed1 in H0. simpl in H0. eapply closed_splice_idem. apply H0. omega. } rewrite A. apply H0. rewrite H1. unfold open. assert (TSelH x0=TSelH (x0+0)) as B. { rewrite <- plus_n_O. reflexivity. } rewrite B. rewrite <- splice_open_permute. assert (splice (length GH0) T2=T2) as C. { apply stp2_closed2 in H0. simpl in H0. inversion H0; subst. inversion H6; subst. eapply closed_splice_idem. eassumption. omega. } rewrite C. reflexivity. omega. apply IHstp2_2; eauto. + eapply stp2_selab1. eapply indexr_spliceat_lo; eauto. eassumption. rewrite H1. apply stp2_closed2 in H0. simpl in H0. inversion H0; subst. inversion H6; subst. apply closed_upgrade_free with (k:=(length GH0)) in H8. eapply closed_splice_idem. eapply closed_open. eassumption. apply cl_selh. omega. omega. omega. apply IHstp2_2; eauto. - Case "sela2". case_eq (le_lt_dec (length GH0) x0); intros E LE. + eapply stp2_sela2. eapply indexr_spliceat_hi. apply H. eauto. eapply closed_splice in H0. assert (S x0 = x0 +1) as EQ by omega. rewrite <- EQ. eapply H0. eapply IHstp2_1. eauto. eapply IHstp2_2. eauto. + eapply stp2_sela2. eapply indexr_spliceat_lo. apply H. eauto. eauto. assert (splice (length GH0) TX=TX) as A. { eapply closed_splice_idem. eassumption. omega. } rewrite <- A. eapply IHstp2_1. eauto. eapply IHstp2_2. eauto. - Case "selax". case_eq (le_lt_dec (length GH0) x0); intros E LE. + eapply stp2_selax. eapply indexr_spliceat_hi. apply H. eauto. + eapply stp2_selax. eapply indexr_spliceat_lo. apply H. eauto. - Case "all". eapply stp2_all. eapply IHstp2_1. reflexivity. simpl. rewrite map_spliceat_length_inc. apply closed_splice. assumption. simpl. rewrite map_spliceat_length_inc. apply closed_splice. assumption. specialize IHstp2_2 with (GH2:=GH0) (GH3:=(0, (G1, T1)) :: GH1). simpl in IHstp2_2. rewrite app_length. rewrite map_length. simpl. repeat rewrite splice_open_permute with (j:=0). rewrite app_length in IHstp2_2. simpl in IHstp2_2. eapply IHstp2_2. reflexivity. omega. specialize IHstp2_3 with (GH2:=GH0) (GH3:=(0, (G2, T3)) :: GH1). simpl in IHstp2_3. rewrite app_length. rewrite map_length. simpl. repeat rewrite splice_open_permute with (j:=0). rewrite app_length in IHstp2_3. simpl in IHstp2_3. eapply IHstp2_3. reflexivity. omega. omega. - Case "bind". eapply stp2_bind. simpl. rewrite map_spliceat_length_inc. apply closed_splice. assumption. simpl. rewrite map_spliceat_length_inc. apply closed_splice. assumption. rewrite app_length. rewrite map_length. simpl. repeat rewrite splice_open_permute with (j:=0). specialize IHstp2_1 with (GH2:=GH0) (GH3:=(0, (G2,(open (TSelH (length GH1 + length GH0)) T2)))::GH1). rewrite app_length in IHstp2_1. simpl in IHstp2_1. unfold open in IHstp2_1. eapply IHstp2_1. eauto. omega. rewrite app_length. rewrite map_length. simpl. repeat rewrite splice_open_permute with (j:=0). specialize IHstp2_2 with (GH2:=GH0) (GH3:=(0, (G1,(open (TSelH (length GH1 + length GH0)) T1)))::GH1). rewrite app_length in IHstp2_2. simpl in IHstp2_2. unfold open in IHstp2_2. eapply IHstp2_2. eauto. omega. omega. - Case "bindb". eapply stp2_bindb. simpl. rewrite map_spliceat_length_inc. apply closed_splice. assumption. simpl. rewrite map_spliceat_length_inc. apply closed_splice. assumption. rewrite app_length. rewrite map_length. simpl. repeat rewrite splice_open_permute with (j:=0). specialize IHstp2_1 with (GH2:=GH0) (GH3:=(0, (G2,(open (TSelH (length GH1 + length GH0)) T2)))::GH1). rewrite app_length in IHstp2_1. simpl in IHstp2_1. unfold open in IHstp2_1. eapply IHstp2_1. eauto. omega. rewrite app_length. rewrite map_length. simpl. repeat rewrite splice_open_permute with (j:=0). specialize IHstp2_2 with (GH2:=GH0) (GH3:=(0, (G1,(open (TSelH (length GH1 + length GH0)) T1)))::GH1). rewrite app_length in IHstp2_2. simpl in IHstp2_2. unfold open in IHstp2_2. eapply IHstp2_2. eauto. omega. omega. Qed. Lemma stp_extend : forall G1 GH T1 T2 x v1, stp G1 GH T1 T2 -> stp G1 ((x,v1)::GH) T1 T2. Proof. intros. induction H; eauto using indexr_extend. - Case "all". assert (splice (length GH) T2 = T2) as A2. { eapply closed_splice_idem. apply H1. omega. } assert (splice (length GH) T4 = T4) as A4. { eapply closed_splice_idem. apply H2. omega. } assert (TSelH (S (length GH)) = splice (length GH) (TSelH (length GH))) as AH. { simpl. case_eq (le_lt_dec (length GH) (length GH)); intros E LE. simpl. rewrite NPeano.Nat.add_1_r. reflexivity. clear LE. apply lt_irrefl in E. inversion E. } assert (closed 0 (length GH) T1). eapply stp_closed2. eauto. assert (splice (length GH) T1 = T1) as A1. { eapply closed_splice_idem. eauto. omega. } assert (closed 0 (length GH) T3). eapply stp_closed1. eauto. assert (splice (length GH) T3 = T3) as A3. { eapply closed_splice_idem. eauto. omega. } assert (map (splicett (length GH)) [(0,T1)] ++(x,v1)::GH =((0,T1)::(x,v1)::GH)) as HGX1. { simpl. rewrite A1. eauto. } assert (map (splicett (length GH)) [(0,T3)] ++(x,v1)::GH =((0,T3)::(x,v1)::GH)) as HGX3. { simpl. rewrite A3. eauto. } apply stp_all with (x:=length ((x,v1) :: GH)). apply IHstp1. reflexivity. apply closed_inc. apply H1. apply closed_inc. apply H2. simpl. rewrite <- A2. rewrite <- A2. unfold open. change (TSelH (S (length GH))) with (TSelH (0 + (S (length GH)))). rewrite -> splice_open_permute. rewrite <- HGX1. apply stp_splice. rewrite A2. simpl. unfold open in H3. rewrite <- H0. apply H3. omega. simpl. rewrite <- A2. rewrite <- A4. unfold open. change (TSelH (S (length GH))) with (TSelH (0 + (S (length GH)))). rewrite -> splice_open_permute. rewrite -> splice_open_permute. rewrite <- HGX3. apply stp_splice. simpl. unfold open in H4. rewrite <- H0. apply H4. omega. omega. - Case "bind". assert (splice (length GH) T2 = T2) as A2. { eapply closed_splice_idem. apply H1. omega. } assert (splice (length GH) T1 = T1) as A1. { eapply closed_splice_idem. eauto. omega. } apply stp_bindx with (x:=length ((x,v1) :: GH)). reflexivity. apply closed_inc. apply H0. apply closed_inc. apply H1. simpl. unfold open. rewrite <- A2. change (TSelH (S (length GH))) with (TSelH (0 + (S (length GH)))). rewrite -> splice_open_permute. simpl. assert ( stp G1 ((map (splicett (length GH)) [(0, (open_rec 0 (TSelH (length GH)) T2))])++(x, v1)::GH) (splice (length GH) (open_rec 0 (TSelH (length GH)) T2)) (splice (length GH) (open_rec 0 (TSelH (length GH)) T2)) -> stp G1 ((0, splice (length GH) (open_rec 0 (TSelH (length GH)) T2)) :: (x, v1) :: GH) (splice (length GH) (open_rec 0 (TSelH (length GH)) T2)) (splice (length GH) (open_rec 0 (TSelH (length GH)) T2)) ) as HGX1. { simpl. intros A. apply A. } apply HGX1. apply stp_splice. simpl. unfold open in H2. rewrite <- H. apply H2. simpl. apply le_refl. rewrite <- A1. rewrite <- A2. unfold open. simpl. change (TSelH (S (length GH))) with (TSelH (0 + (S (length GH)))). rewrite -> splice_open_permute. rewrite -> splice_open_permute. assert ( (stp G1 ((map (splicett (length GH)) [(0, (open_rec 0 (TSelH (length GH)) T1))])++(x, v1)::GH) (splice (length GH) (open_rec 0 (TSelH (0 + length GH)) T1)) (splice (length GH) (open_rec 0 (TSelH (0 + length GH)) T2))) -> (stp G1 ((0, splice (length GH) (open_rec 0 (TSelH (0 + length GH)) T1)) :: (x, v1) :: GH) (splice (length GH) (open_rec 0 (TSelH (0 + length GH)) T1)) (splice (length GH) (open_rec 0 (TSelH (0 + length GH)) T2))) ) as HGX2. { simpl. intros A. apply A. } apply HGX2. apply stp_splice. simpl. unfold open in H3. rewrite <- H. apply H3. simpl. apply le_refl. simpl. apply le_refl. Qed. Lemma indexr_at_index: forall {A} x0 GH0 GH1 x (v:A), beq_nat x0 (length GH1) = true -> indexr x0 (GH0 ++ (x, v) :: GH1) = Some v. Proof. intros. apply beq_nat_true in H. subst. induction GH0. - simpl. rewrite <- beq_nat_refl. reflexivity. - destruct a. simpl. rewrite app_length. simpl. rewrite <- plus_n_Sm. rewrite <- plus_Sn_m. rewrite false_beq_nat. assumption. omega. Qed. Lemma indexr_same: forall {A} x0 (v0:A) GH0 GH1 x (v:A) (v':A), beq_nat x0 (length GH1) = false -> indexr x0 (GH0 ++ (x, v) :: GH1) = Some v0 -> indexr x0 (GH0 ++ (x, v') :: GH1) = Some v0. Proof. intros ? ? ? ? ? ? ? ? E H. induction GH0. - simpl. rewrite E. simpl in H. rewrite E in H. apply H. - destruct a. simpl. rewrite app_length. simpl. case_eq (beq_nat x0 (length GH0 + S (length GH1))); intros E'. simpl in H. rewrite app_length in H. simpl in H. rewrite E' in H. rewrite H. reflexivity. simpl in H. rewrite app_length in H. simpl in H. rewrite E' in H. rewrite IHGH0. reflexivity. assumption. Qed. Inductive venv_ext : venv -> venv -> Prop := | venv_ext_refl : forall G, venv_ext G G | venv_ext_cons : forall x T G1 G2, fresh G1 <= x -> venv_ext G1 G2 -> venv_ext ((x,T)::G1) G2. Inductive aenv_ext : aenv -> aenv -> Prop := | aenv_ext_nil : aenv_ext nil nil | aenv_ext_cons : forall x T G' G A A', aenv_ext A' A -> venv_ext G' G -> aenv_ext ((x,(G',T))::A') ((x,(G,T))::A). Lemma aenv_ext_refl: forall GH, aenv_ext GH GH. Proof. intros. induction GH. - apply aenv_ext_nil. - destruct a. destruct p. apply aenv_ext_cons. assumption. apply venv_ext_refl. Qed. Lemma index_extend_mult : forall G G' x T, index x G = Some T -> venv_ext G' G -> index x G' = Some T. Proof. intros G G' x T H HV. induction HV. - assumption. - apply index_extend. apply IHHV. apply H. assumption. Qed. Lemma aenv_ext__same_length: forall GH GH', aenv_ext GH' GH -> length GH = length GH'. Proof. intros. induction H. - simpl. reflexivity. - simpl. rewrite IHaenv_ext. reflexivity. Qed. Lemma indexr_at_ext : forall GH GH' x T G, aenv_ext GH' GH -> indexr x GH = Some (G, T) -> exists G', indexr x GH' = Some (G', T) /\ venv_ext G' G. Proof. intros GH GH' x T G Hext Hindex. induction Hext. - simpl in Hindex. inversion Hindex. - simpl. simpl in Hindex. case_eq (beq_nat x (length A)); intros E. rewrite E in Hindex. inversion Hindex. subst. rewrite <- (@aenv_ext__same_length A A'). rewrite E. exists G'. split. reflexivity. assumption. assumption. rewrite E in Hindex. rewrite <- (@aenv_ext__same_length A A'). rewrite E. apply IHHext. assumption. assumption. Qed. Lemma stp2_closure_extend_rec : forall G1 G2 T1 T2 GH s m n1, stp2 s m G1 T1 G2 T2 GH n1 -> (forall G1' G2' GH', aenv_ext GH' GH -> venv_ext G1' G1 -> venv_ext G2' G2 -> stp2 s m G1' T1 G2' T2 GH' n1). Proof. intros G1 G2 T1 T2 GH s m n1 H. induction H; intros; eauto; try solve [inversion IHstp2_1; inversion IHstp2_2; eauto]; try solve [inversion IHstp2; eauto]. - Case "strong_sel1". eapply stp2_strong_sel1. eapply index_extend_mult. apply H. assumption. assumption. (* assumption. *) apply IHstp2. assumption. apply venv_ext_refl. assumption. - Case "strong_sel2". eapply stp2_strong_sel2. eapply index_extend_mult. apply H. assumption. assumption. (* assumption. *) apply IHstp2. assumption. assumption. apply venv_ext_refl. - Case "strong_selx". eapply stp2_strong_selx. eapply index_extend_mult. apply H. assumption. eapply index_extend_mult. apply H0. assumption. - Case "sel1". eapply stp2_sel1. eapply index_extend_mult. apply H. assumption. eassumption. assumption. apply IHstp2_1. assumption. apply venv_ext_refl. assumption. apply IHstp2_2. assumption. assumption. assumption. - Case "selb1". eapply stp2_selb1. eapply index_extend_mult. apply H. assumption. eassumption. assumption. apply IHstp2_1. apply aenv_ext_refl. apply venv_ext_refl. assumption. apply IHstp2_2. assumption. assumption. assumption. - Case "sel2". eapply stp2_sel2. eapply index_extend_mult. apply H. assumption. eassumption. assumption. apply IHstp2_1. assumption. apply venv_ext_refl. assumption. apply IHstp2_2. assumption. assumption. assumption. - Case "selx". eapply stp2_selx. eapply index_extend_mult. apply H. assumption. eapply index_extend_mult. apply H0. assumption. - Case "sela1". assert (exists GX', indexr x GH' = Some (GX', TX) /\ venv_ext GX' GX) as A. { apply indexr_at_ext with (GH:=GH); assumption. } inversion A as [GX' [H' HX]]. apply stp2_sela1 with (GX:=GX') (TX:=TX). assumption. assumption. apply IHstp2_1; assumption. apply IHstp2_2; assumption. - Case "selab1". assert (exists GX', indexr x GH' = Some (GX', TX) /\ venv_ext GX' GX) as A. { apply indexr_at_ext with (GH:=GH); assumption. } inversion A as [GX' [H' HX]]. eapply stp2_selab1 with (GX:=GX') (TX:=TX). assumption. apply IHstp2_1; eauto. apply aenv_ext_refl. assumption. apply IHstp2_2; eauto. - Case "sela2". assert (exists GX', indexr x GH' = Some (GX', TX) /\ venv_ext GX' GX) as A. { apply indexr_at_ext with (GH:=GH); assumption. } inversion A as [GX' [H' HX]]. apply stp2_sela2 with (GX:=GX') (TX:=TX). assumption. assumption. apply IHstp2_1; assumption. apply IHstp2_2; assumption. - Case "selax". assert (exists GX', indexr x GH' = Some (GX', TX) /\ venv_ext GX' GX) as A. { apply indexr_at_ext with (GH:=GH); assumption. } inversion A as [GX' [H' HX]]. apply stp2_selax with (GX:=GX') (TX:=TX). assumption. - Case "all". assert (length GH = length GH') as A. { apply aenv_ext__same_length. assumption. } apply stp2_all. apply IHstp2_1; assumption. subst. rewrite <- A. assumption. subst. rewrite <- A. assumption. subst. rewrite <- A. apply IHstp2_2. apply aenv_ext_cons. assumption. assumption. assumption. assumption. subst. rewrite <- A. apply IHstp2_3. apply aenv_ext_cons. assumption. assumption. assumption. assumption. - Case "bind". assert (length GH = length GH') as A. { apply aenv_ext__same_length. assumption. } apply stp2_bind. subst. rewrite A in H. assumption. subst. rewrite A in H0. assumption. rewrite A in IHstp2_1. apply IHstp2_1. apply aenv_ext_cons. assumption. assumption. assumption. assumption. subst. rewrite A in IHstp2_2. apply IHstp2_2. apply aenv_ext_cons. assumption. assumption. assumption. assumption. - Case "bindb". assert (length GH = length GH') as A. { apply aenv_ext__same_length. assumption. } apply stp2_bindb. subst. rewrite A in H. assumption. subst. rewrite A in H0. assumption. rewrite A in IHstp2_1. apply IHstp2_1. apply aenv_ext_cons. assumption. assumption. assumption. assumption. subst. rewrite A in IHstp2_2. apply IHstp2_2. apply aenv_ext_cons. assumption. assumption. assumption. assumption. - Case "trans". eapply stp2_transf. eapply IHstp2_1. assumption. assumption. apply venv_ext_refl. eapply IHstp2_2. assumption. apply venv_ext_refl. assumption. Qed. Lemma stp2_closure_extend : forall G1 T1 G2 T2 GH GX T x v s m n1, stp2 s m G1 T1 G2 T2 ((0,(GX,T))::GH) n1 -> fresh GX <= x -> stp2 s m G1 T1 G2 T2 ((0,((x,v)::GX,T))::GH) n1. Proof. intros. eapply stp2_closure_extend_rec. apply H. apply aenv_ext_cons. apply aenv_ext_refl. apply venv_ext_cons. assumption. apply venv_ext_refl. apply venv_ext_refl. apply venv_ext_refl. Qed. Lemma stp2_extend : forall x v1 G1 G2 T1 T2 H s m n1, stp2 s m G1 T1 G2 T2 H n1 -> (fresh G1 <= x -> stp2 s m ((x,v1)::G1) T1 G2 T2 H n1) /\ (fresh G2 <= x -> stp2 s m G1 T1 ((x,v1)::G2) T2 H n1) /\ (fresh G1 <= x -> fresh G2 <= x -> stp2 s m ((x,v1)::G1) T1 ((x,v1)::G2) T2 H n1). Proof. intros. induction H0; try solve [split; try split; repeat ev; intros; eauto using index_extend]; try solve [split; try split; intros; inversion IHstp2_1 as [? [? ?]]; inversion IHstp2_2 as [? [? ?]]; inversion IHstp2_3 as [? [? ?]]; constructor; eauto; apply stp2_closure_extend; eauto]; try solve [split; try split; intros; inversion IHstp2_1 as [? [? ?]]; inversion IHstp2_2 as [? [? ?]]; eapply stp2_bind; eauto; apply stp2_closure_extend; eauto]; try solve [split; try split; intros; inversion IHstp2_1 as [? [? ?]]; inversion IHstp2_2 as [? [? ?]]; eapply stp2_bindb; eauto; apply stp2_closure_extend; eauto]. Qed. Lemma stp2_extend2 : forall x v1 G1 G2 T1 T2 H s m n1, stp2 s m G1 T1 G2 T2 H n1 -> fresh G2 <= x -> stp2 s m G1 T1 ((x,v1)::G2) T2 H n1. Proof. intros. apply (proj2 (stp2_extend x v1 G1 G2 T1 T2 H s m n1 H0)). assumption. Qed. Lemma stp2_extend1 : forall x v1 G1 G2 T1 T2 H s m n1, stp2 s m G1 T1 G2 T2 H n1 -> fresh G1 <= x -> stp2 s m ((x,v1)::G1) T1 G2 T2 H n1. Proof. intros. apply (proj1 (stp2_extend x v1 G1 G2 T1 T2 H s m n1 H0)). assumption. Qed. Lemma stp2_extendH : forall x v1 G1 G2 T1 T2 GH s m n1, stp2 s m G1 T1 G2 T2 GH n1 -> stp2 s m G1 T1 G2 T2 ((x,v1)::GH) n1. Proof. intros. induction H; eauto using indexr_extend. - Case "all". assert (splice (length GH) T2 = T2) as A2. { eapply closed_splice_idem. apply H0. omega. } assert (splice (length GH) T4 = T4) as A4. { eapply closed_splice_idem. apply H1. omega. } assert (TSelH (S (length GH)) = splice (length GH) (TSelH (length GH))) as AH. { simpl. case_eq (le_lt_dec (length GH) (length GH)); intros E LE. simpl. rewrite NPeano.Nat.add_1_r. reflexivity. clear LE. apply lt_irrefl in E. inversion E. } assert (closed 0 (length GH) T1). eapply stp2_closed2. eauto. assert (splice (length GH) T1 = T1) as A1. { eapply closed_splice_idem. eauto. omega. } assert (map (spliceat (length GH)) [(0,(G1, T1))] ++(x,v1)::GH =((0, (G1, T1))::(x,v1)::GH)) as HGX1. { simpl. rewrite A1. eauto. } assert (closed 0 (length GH) T3). eapply stp2_closed1. eauto. assert (splice (length GH) T3 = T3) as A3. { eapply closed_splice_idem. eauto. omega. } assert (map (spliceat (length GH)) [(0,(G2, T3))] ++(x,v1)::GH =((0, (G2, T3))::(x,v1)::GH)) as HGX3. { simpl. rewrite A3. eauto. } eapply stp2_all. apply IHstp2_1. apply closed_inc. apply H0. apply closed_inc. apply H1. simpl. unfold open. rewrite <- A2. unfold open. change (TSelH (S (length GH))) with (TSelH (0 + (S (length GH)))). rewrite -> splice_open_permute. rewrite <- HGX1. apply stp2_splice. simpl. unfold open in H2. apply H2. simpl. omega. rewrite <- A2. rewrite <- A4. unfold open. simpl. change (TSelH (S (length GH))) with (TSelH (0 + (S (length GH)))). rewrite -> splice_open_permute. rewrite -> splice_open_permute. rewrite <- HGX3. apply stp2_splice. simpl. unfold open in H3. apply H3. omega. omega. - Case "bind". assert (splice (length GH) T2 = T2) as A2. { eapply closed_splice_idem. eauto. omega. } assert (splice (length GH) T1 = T1) as A1. { eapply closed_splice_idem. eauto. omega. } eapply stp2_bind. apply closed_inc. eauto. apply closed_inc. eauto. simpl. unfold open. rewrite <- A2. change (TSelH (S (length GH))) with (TSelH (0 + (S (length GH)))). rewrite -> splice_open_permute. simpl. assert ( stp2 1 false G2 (splice (length GH) (open_rec 0 (TSelH (length GH)) T2)) G2 (splice (length GH) (open_rec 0 (TSelH (length GH)) T2)) ((map (spliceat (length GH)) [(0, (G2, open_rec 0 (TSelH (length GH)) T2))])++((x, v1)::GH)) n2 -> stp2 1 false G2 (splice (length GH) (open_rec 0 (TSelH (length GH)) T2)) G2 (splice (length GH) (open_rec 0 (TSelH (length GH)) T2)) ((0, (G2, splice (length GH) (open_rec 0 (TSelH (length GH)) T2))) :: (x, v1) :: GH) n2 ) as HGX1. { simpl. intros A. apply A. } apply HGX1. apply stp2_splice. simpl. unfold open in H1. apply H1. simpl. apply le_refl. rewrite <- A1. rewrite <- A2. unfold open. simpl. change (TSelH (S (length GH))) with (TSelH (0 + (S (length GH)))). rewrite -> splice_open_permute. rewrite -> splice_open_permute. assert ( stp2 1 false G1 (splice (length GH) (open_rec 0 (TSelH (0 + length GH)) T1)) G2 (splice (length GH) (open_rec 0 (TSelH (0 + length GH)) T2)) ((map (spliceat (length GH)) [(0, (G1, (open_rec 0 (TSelH (0 + length GH)) T1)))])++((x, v1) :: GH)) n1 -> stp2 1 false G1 (splice (length GH) (open_rec 0 (TSelH (0 + length GH)) T1)) G2 (splice (length GH) (open_rec 0 (TSelH (0 + length GH)) T2)) ((0, (G1, splice (length GH) (open_rec 0 (TSelH (0 + length GH)) T1))) :: (x, v1) :: GH) n1 ) as HGX2. { simpl. intros A. apply A. } apply HGX2. apply stp2_splice. simpl. unfold open in H2. apply H2. simpl. apply le_refl. simpl. apply le_refl. - Case "bindb". assert (splice (length GH) T2 = T2) as A2. { eapply closed_splice_idem. eauto. omega. } assert (splice (length GH) T1 = T1) as A1. { eapply closed_splice_idem. eauto. omega. } eapply stp2_bindb. apply closed_inc. eauto. apply closed_inc. eauto. simpl. unfold open. rewrite <- A2. change (TSelH (S (length GH))) with (TSelH (0 + (S (length GH)))). rewrite -> splice_open_permute. simpl. assert ( stp2 (S m) false G2 (splice (length GH) (open_rec 0 (TSelH (length GH)) T2)) G2 (splice (length GH) (open_rec 0 (TSelH (length GH)) T2)) ((map (spliceat (length GH)) [(0, (G2, open_rec 0 (TSelH (length GH)) T2))])++((x, v1)::GH)) n2 -> stp2 (S m) false G2 (splice (length GH) (open_rec 0 (TSelH (length GH)) T2)) G2 (splice (length GH) (open_rec 0 (TSelH (length GH)) T2)) ((0, (G2, splice (length GH) (open_rec 0 (TSelH (length GH)) T2))) :: (x, v1) :: GH) n2 ) as HGX1. { simpl. intros A. apply A. } apply HGX1. apply stp2_splice. simpl. unfold open in H1. apply H1. simpl. apply le_refl. rewrite <- A1. rewrite <- A2. unfold open. simpl. change (TSelH (S (length GH))) with (TSelH (0 + (S (length GH)))). rewrite -> splice_open_permute. rewrite -> splice_open_permute. assert ( stp2 (S m) false G1 (splice (length GH) (open_rec 0 (TSelH (0 + length GH)) T1)) G2 (splice (length GH) (open_rec 0 (TSelH (0 + length GH)) T2)) ((map (spliceat (length GH)) [(0, (G1, (open_rec 0 (TSelH (0 + length GH)) T1)))])++((x, v1) :: GH)) n1 -> stp2 (S m) false G1 (splice (length GH) (open_rec 0 (TSelH (0 + length GH)) T1)) G2 (splice (length GH) (open_rec 0 (TSelH (0 + length GH)) T2)) ((0, (G1, splice (length GH) (open_rec 0 (TSelH (0 + length GH)) T1))) :: (x, v1) :: GH) n1 ) as HGX2. { simpl. intros A. apply A. } apply HGX2. apply stp2_splice. simpl. unfold open in H2. apply H2. simpl. apply le_refl. simpl. apply le_refl. Qed. Lemma stp2_extendH_mult : forall G1 G2 T1 T2 H H2 s m n1, stp2 s m G1 T1 G2 T2 H n1-> stp2 s m G1 T1 G2 T2 (H2++H) n1. Proof. intros. induction H2. simpl. eauto. destruct a. simpl. eapply stp2_extendH. eauto. Qed. Lemma stp2_extendH_mult0 : forall G1 G2 T1 T2 H2 s m n1, stp2 s m G1 T1 G2 T2 [] n1 -> stp2 s m G1 T1 G2 T2 H2 n1. Proof. intros. eapply stp2_extendH_mult with (H2:=H2) in H; eauto. rewrite app_nil_r in H. eauto. Qed. Lemma stp2_reg : forall G1 G2 T1 T2 GH s m n1, stp2 s m G1 T1 G2 T2 GH n1 -> (exists n0, stp2 s true G1 T1 G1 T1 GH n0) /\ (exists n0, stp2 s true G2 T2 G2 T2 GH n0). Proof. intros. induction H; try solve [repeat ev; split; eexists; eauto]. Grab Existential Variables. apply 0. apply 0. apply 0. apply 0. apply 0. apply 0. apply 0. apply 0. apply 0. apply 0. apply 0. apply 0. apply 0. apply 0. apply 0. apply 0. apply 0. apply 0. apply 0. apply 0. apply 0. apply 0. Qed. Lemma stp2_reg2 : forall G1 G2 T1 T2 GH s m n1, stp2 s m G1 T1 G2 T2 GH n1 -> (exists n0, stp2 s true G2 T2 G2 T2 GH n0). Proof. intros. apply (proj2 (stp2_reg G1 G2 T1 T2 GH s m n1 H)). Qed. Lemma stp2_reg1 : forall G1 G2 T1 T2 GH s m n1, stp2 s m G1 T1 G2 T2 GH n1 -> (exists n0, stp2 s true G1 T1 G1 T1 GH n0). Proof. intros. apply (proj1 (stp2_reg G1 G2 T1 T2 GH s m n1 H)). Qed. Lemma stp_reg : forall G GH T1 T2, stp G GH T1 T2 -> stp G GH T1 T1 /\ stp G GH T2 T2. Proof. intros. induction H; try solve [repeat ev; split; eauto]. Qed. Lemma stpd2_extend2 : forall x v1 G1 G2 T1 T2 H m, stpd2 m G1 T1 G2 T2 H -> fresh G2 <= x -> stpd2 m G1 T1 ((x,v1)::G2) T2 H. Proof. intros. inversion H0 as [n1 Hsub]. exists n1. apply stp2_extend2; assumption. Qed. Lemma stpd2_extend1 : forall x v1 G1 G2 T1 T2 H m, stpd2 m G1 T1 G2 T2 H -> fresh G1 <= x -> stpd2 m ((x,v1)::G1) T1 G2 T2 H. Proof. intros. inversion H0 as [n1 Hsub]. exists n1. apply stp2_extend1; assumption. Qed. Lemma stpd2_extendH : forall x v1 G1 G2 T1 T2 H m, stpd2 m G1 T1 G2 T2 H -> stpd2 m G1 T1 G2 T2 ((x,v1)::H). Proof. intros. inversion H0 as [n1 Hsub]. exists n1. apply stp2_extendH; assumption. Qed. Lemma stpd2_extendH_mult : forall G1 G2 T1 T2 H H2 m, stpd2 m G1 T1 G2 T2 H-> stpd2 m G1 T1 G2 T2 (H2++H). Proof. intros. inversion H0 as [n1 Hsub]. exists n1. apply stp2_extendH_mult; assumption. Qed. Lemma stpd2_extendH_mult0 : forall G1 G2 T1 T2 H2 m, stpd2 m G1 T1 G2 T2 [] -> stpd2 m G1 T1 G2 T2 H2. Proof. intros. inversion H as [n1 Hsub]. exists n1. apply stp2_extendH_mult0; assumption. Qed. Lemma stpd2_reg2 : forall G1 G2 T1 T2 H m, stpd2 m G1 T1 G2 T2 H -> stpd2 true G2 T2 G2 T2 H. Proof. intros. inversion H0 as [n1 Hsub]. eapply stp2_reg2; eassumption. Qed. Lemma stpd2_reg1 : forall G1 G2 T1 T2 H m, stpd2 m G1 T1 G2 T2 H -> stpd2 true G1 T1 G1 T1 H. Proof. intros. inversion H0 as [n1 Hsub]. eapply stp2_reg1; eassumption. Qed. Lemma stpd2_closed2 : forall G1 G2 T1 T2 H m, stpd2 m G1 T1 G2 T2 H -> closed 0 (length H) T2. Proof. intros. inversion H0 as [n1 Hsub]. eapply stp2_closed2; eassumption. Qed. Lemma stpd2_closed1 : forall G1 G2 T1 T2 H m, stpd2 m G1 T1 G2 T2 H -> closed 0 (length H) T1. Proof. intros. inversion H0 as [n1 Hsub]. eapply stp2_closed1; eassumption. Qed. (* sstpd2 variants below *) Lemma sstpd2_extend2 : forall x v1 G1 G2 T1 T2 H m, sstpd2 m G1 T1 G2 T2 H -> fresh G2 <= x -> sstpd2 m G1 T1 ((x,v1)::G2) T2 H. Proof. intros. inversion H0 as [n1 Hsub]. exists n1. apply stp2_extend2; assumption. Qed. Lemma sstpd2_extend1 : forall x v1 G1 G2 T1 T2 H m, sstpd2 m G1 T1 G2 T2 H -> fresh G1 <= x -> sstpd2 m ((x,v1)::G1) T1 G2 T2 H. Proof. intros. inversion H0 as [n1 Hsub]. exists n1. apply stp2_extend1; assumption. Qed. Lemma sstpd2_extendH : forall x v1 G1 G2 T1 T2 H m, sstpd2 m G1 T1 G2 T2 H -> sstpd2 m G1 T1 G2 T2 ((x,v1)::H). Proof. intros. inversion H0 as [n1 Hsub]. exists n1. apply stp2_extendH; assumption. Qed. Lemma sstpd2_extendH_mult : forall G1 G2 T1 T2 H H2 m, sstpd2 m G1 T1 G2 T2 H-> sstpd2 m G1 T1 G2 T2 (H2++H). Proof. intros. inversion H0 as [n1 Hsub]. exists n1. apply stp2_extendH_mult; assumption. Qed. Lemma sstpd2_extendH_mult0 : forall G1 G2 T1 T2 H2 m, sstpd2 m G1 T1 G2 T2 [] -> sstpd2 m G1 T1 G2 T2 H2. Proof. intros. inversion H as [n1 Hsub]. exists n1. apply stp2_extendH_mult0; assumption. Qed. Lemma sstpd2_reg2 : forall G1 G2 T1 T2 H m, sstpd2 m G1 T1 G2 T2 H -> sstpd2 true G2 T2 G2 T2 H. Proof. intros. inversion H0 as [n1 Hsub]. eapply stp2_reg2; eassumption. Qed. Lemma sstpd2_reg1 : forall G1 G2 T1 T2 H m, sstpd2 m G1 T1 G2 T2 H -> sstpd2 true G1 T1 G1 T1 H. Proof. intros. inversion H0 as [n1 Hsub]. eapply stp2_reg1; eassumption. Qed. Lemma sstpd2_closed2 : forall G1 G2 T1 T2 H m, sstpd2 m G1 T1 G2 T2 H -> closed 0 (length H) T2. Proof. intros. inversion H0 as [n1 Hsub]. eapply stp2_closed2; eassumption. Qed. Lemma sstpd2_closed1 : forall G1 G2 T1 T2 H m, sstpd2 m G1 T1 G2 T2 H -> closed 0 (length H) T1. Proof. intros. inversion H0 as [n1 Hsub]. eapply stp2_closed1; eassumption. Qed. Lemma valtp_extend : forall vs v x v1 T, val_type vs v T -> fresh vs <= x -> val_type ((x,v1)::vs) v T. Proof. intros. induction H; eauto; econstructor; eauto; eapply sstpd2_extend2; eauto. Qed. Lemma index_safe_ex: forall H1 G1 TF i, wf_env H1 G1 -> index i G1 = Some TF -> exists v, index i H1 = Some v /\ val_type H1 v TF. Proof. intros. induction H. - Case "nil". inversion H0. - Case "cons". inversion H0. case_eq (le_lt_dec (fresh ts) n); intros ? E1. + SCase "ok". rewrite E1 in H3. assert ((fresh ts) <= n) as QF. eauto. rewrite <-(wf_fresh vs ts H1) in QF. elim (le_xx (fresh vs) n QF). intros ? EX. case_eq (beq_nat i n); intros E2. * SSCase "hit". assert (index i ((n, v) :: vs) = Some v). eauto. unfold index. rewrite EX. rewrite E2. eauto. assert (t = TF). unfold index in H0. rewrite E1 in H0. rewrite E2 in H0. inversion H0. eauto. subst t. eauto. * SSCase "miss". rewrite E2 in H3. assert (exists v0, index i vs = Some v0 /\ val_type vs v0 TF) as HI. eapply IHwf_env. eauto. inversion HI as [v0 HI1]. inversion HI1. eexists. econstructor. eapply index_extend; eauto. eapply valtp_extend; eauto. + SSCase "bad". rewrite E1 in H3. inversion H3. Qed. Lemma index_safeh_ex: forall H1 H2 G1 GH TF i, wf_env H1 G1 -> wf_envh H1 H2 GH -> indexr i GH = Some TF -> exists v, indexr i H2 = Some v /\ valh_type H1 H2 v TF. Proof. intros. induction H0. - Case "nil". inversion H3. - Case "cons". inversion H3. case_eq (beq_nat i (length ts)); intros E2. * SSCase "hit". rewrite E2 in H2. inversion H2. subst. clear H2. assert (length ts = length vs). symmetry. eapply wfh_length. eauto. simpl. rewrite H1 in E2. rewrite E2. eexists. split. eauto. econstructor. * SSCase "miss". rewrite E2 in H2. assert (exists v : venv * ty, indexr i vs = Some v /\ valh_type vvs vs v TF). eauto. destruct H1. destruct H1. eexists. split. eapply indexr_extend. eauto. inversion H4. subst. eapply v_tya. (* aenv is not constrained -- bit of a cheat?*) Qed. Inductive res_type: venv -> option vl -> ty -> Prop := | not_stuck: forall venv v T, val_type venv v T -> res_type venv (Some v) T. Hint Constructors res_type. Hint Resolve not_stuck. Lemma stpd2_trans_aux: forall n, forall G1 G2 G3 T1 T2 T3 H n1, stp2 MAX false G1 T1 G2 T2 H n1 -> n1 < n -> stpd2 false G2 T2 G3 T3 H -> stpd2 false G1 T1 G3 T3 H. Proof. intros n. induction n; intros; try omega; repeat eu; subst; inversion H0. - Case "wrapf". eapply stpd2_transf; eauto. - Case "transf". eapply stpd2_transf. eauto. eapply IHn. eauto. omega. eauto. Qed. Lemma sstpd2_trans_axiom_aux: forall n, forall G1 G2 G3 T1 T2 T3 H n1, stp2 0 false G1 T1 G2 T2 H n1 -> n1 < n -> sstpd2 false G2 T2 G3 T3 H -> sstpd2 false G1 T1 G3 T3 H. Proof. intros n. induction n; intros; try omega; repeat eu; subst; inversion H0. - Case "wrapf". eapply sstpd2_transf. eexists. eauto. eexists. eauto. - Case "transf". eapply sstpd2_transf. eexists. eauto. eapply IHn. eauto. omega. eexists. eauto. Qed. Lemma atpd2_trans_axiom_aux: forall n, forall G1 G2 G3 T1 T2 T3 H n1, stp2 1 false G1 T1 G2 T2 H n1 -> n1 < n -> atpd2 false G2 T2 G3 T3 H -> atpd2 false G1 T1 G3 T3 H. Proof. intros n. induction n; intros; try omega; repeat eu; subst; inversion H0. - Case "wrapf". eapply atpd2_transf. eexists. eauto. eexists. eauto. - Case "transf". eapply atpd2_transf. eexists. eauto. eapply IHn. eauto. omega. eexists. eauto. Qed. Lemma stpd2_trans: forall G1 G2 G3 T1 T2 T3 H, stpd2 false G1 T1 G2 T2 H -> stpd2 false G2 T2 G3 T3 H -> stpd2 false G1 T1 G3 T3 H. Proof. intros. repeat eu. eapply stpd2_trans_aux; eauto. Qed. Lemma sstpd2_trans_axiom: forall G1 G2 G3 T1 T2 T3 H, sstpd2 false G1 T1 G2 T2 H -> sstpd2 false G2 T2 G3 T3 H -> sstpd2 false G1 T1 G3 T3 H. Proof. intros. repeat eu. eapply sstpd2_trans_axiom_aux; eauto. eexists. eauto. Qed. Lemma atpd2_trans_axiom: forall G1 G2 G3 T1 T2 T3 H, atpd2 false G1 T1 G2 T2 H -> atpd2 false G2 T2 G3 T3 H -> atpd2 false G1 T1 G3 T3 H. Proof. intros. repeat eu. eapply atpd2_trans_axiom_aux; eauto. eexists. eauto. Qed. Lemma stp2_narrow_aux: forall n, forall m G1 T1 G2 T2 GH n0, stp2 MAX m G1 T1 G2 T2 GH n0 -> n0 <= n -> forall x GH1 GH0 GH' GX1 TX1 GX2 TX2, GH=GH1++[(x,(GX2,TX2))]++GH0 -> GH'=GH1++[(x,(GX1,TX1))]++GH0 -> stpd2 false GX1 TX1 GX2 TX2 [] -> stpd2 m G1 T1 G2 T2 GH'. Proof. intros n. induction n. - Case "z". intros. inversion H0. subst. inversion H; eauto. - Case "s n". intros m G1 T1 G2 T2 GH n0 H NE. inversion H; subst; intros x0 GH1 GH0 GH' GX1 TX1 GX2 TX2 EGH EGH' HX; eauto. + SCase "top". eapply stpd2_top. eapply IHn; try eassumption. omega. + SCase "bot". eapply stpd2_bot. eapply IHn; try eassumption. omega. + SCase "fun". eapply stpd2_fun. eapply IHn; try eassumption. omega. eapply IHn; try eassumption. omega. + SCase "mem". eapply stpd2_mem. eapply IHn; try eassumption. omega. eapply IHn; try eassumption. omega. + SCase "sel1". eapply stpd2_sel1; try eassumption. eapply IHn; try eassumption. omega. eapply IHn; try eassumption. omega. + SCase "selb1". eapply stpd2_selb1; try eassumption. eexists; eassumption. eapply IHn; try eassumption. omega. + SCase "sel2". eapply stpd2_sel2; try eassumption. eapply IHn; try eassumption. omega. eapply IHn; try eassumption. omega. + SCase "selx". eapply stpd2_selx; try eassumption. + SCase "sela1". case_eq (beq_nat x (length GH0)); intros E. * assert (indexr x ([(x0, (GX2, TX2))]++GH0) = Some (GX2, TX2)) as A2. { simpl. rewrite E. reflexivity. } assert (indexr x GH = Some (GX2, TX2)) as A2'. { rewrite EGH. eapply indexr_extend_mult. apply A2. } rewrite A2' in H1. inversion H1. subst. inversion HX as [nx HX']. eapply stpd2_sela1. eapply indexr_extend_mult. simpl. rewrite E. reflexivity. apply beq_nat_true in E. rewrite E. eapply stp2_closed1. eapply stp2_extendH_mult0. eassumption. eapply stpd2_trans. eexists. eapply stp2_extendH_mult0. eassumption. eapply IHn; try eassumption. omega. reflexivity. reflexivity. eapply IHn; try eassumption. omega. reflexivity. reflexivity. * assert (indexr x GH' = Some (GX, TX)) as A. { subst. eapply indexr_same. apply E. eassumption. } eapply stpd2_sela1. eapply A. assumption. eapply IHn; try eassumption. omega. eapply IHn; try eassumption. omega. + SCase "selab1". case_eq (beq_nat x (length GH0)); intros E. * assert (indexr x ([(x0, (GX2, TX2))]++GH0) = Some (GX2, TX2)) as A2. { simpl. rewrite E. reflexivity. } assert (indexr x GH = Some (GX2, TX2)) as A2'. { rewrite EGH. eapply indexr_extend_mult. apply A2. } assert (Some (GX2,TX2) = Some (GX, TX)) as E2. { rewrite A2' in H1. apply H1. } inversion E2. subst. eapply stpd2_selab1. eapply indexr_extend_mult. simpl. rewrite E. reflexivity. eapply stpd2_trans. eassumption. eexists. eassumption. eapply IHn; try eassumption. omega. reflexivity. reflexivity. * assert (indexr x GH' = Some (GX, TX)) as A. { subst. eapply indexr_same. apply E. eassumption. } eapply stpd2_selab1. eapply A. eexists. eassumption. eapply IHn; try eassumption. omega. + SCase "sela2". case_eq (beq_nat x (length GH0)); intros E. * assert (indexr x ([(x0, (GX2, TX2))]++GH0) = Some (GX2, TX2)) as A2. { simpl. rewrite E. reflexivity. } assert (indexr x GH = Some (GX2, TX2)) as A2'. { rewrite EGH. eapply indexr_extend_mult. apply A2. } rewrite A2' in H1. inversion H1. subst. inversion HX as [nx HX']. eapply stpd2_sela2. eapply indexr_extend_mult. simpl. rewrite E. reflexivity. apply beq_nat_true in E. rewrite E. eapply stp2_closed1. eapply stp2_extendH_mult0. eassumption. eapply stpd2_trans. eexists. eapply stp2_extendH_mult0. eassumption. eapply IHn; try eassumption. omega. reflexivity. reflexivity. eapply IHn; try eassumption. omega. reflexivity. reflexivity. * assert (indexr x GH' = Some (GX, TX)) as A. { subst. eapply indexr_same. apply E. eassumption. } eapply stpd2_sela2. eapply A. assumption. eapply IHn; try eassumption. omega. eapply IHn; try eassumption. omega. + SCase "selax". case_eq (beq_nat x (length GH0)); intros E. * assert (indexr x ([(x0, (GX2, TX2))]++GH0) = Some (GX2, TX2)) as A2. { simpl. rewrite E. reflexivity. } assert (indexr x GH = Some (GX2, TX2)) as A2'. { rewrite EGH. eapply indexr_extend_mult. apply A2. } rewrite A2' in H1. inversion H1. subst. inversion HX as [nx HX']. eapply stpd2_selax. eapply indexr_extend_mult. simpl. rewrite E. reflexivity. * assert (indexr x GH' = Some (GX, TX)) as A. { subst. eapply indexr_same. apply E. eassumption. } eapply stpd2_selax. eapply A. + SCase "all". assert (length GH = length GH') as A. { subst. clear. induction GH1. - simpl. reflexivity. - simpl. simpl in IHGH1. rewrite IHGH1. reflexivity. } eapply stpd2_all. eapply IHn; try eassumption. omega. rewrite <- A. assumption. rewrite <- A. assumption. rewrite <- A. subst. eapply IHn with (GH1:=(0, (G1, T0)) :: GH1); try eassumption. omega. simpl. reflexivity. simpl. reflexivity. rewrite <- A. subst. eapply IHn with (GH1:=(0, (G2, T4)) :: GH1); try eassumption. omega. simpl. reflexivity. simpl. reflexivity. + SCase "bind". assert (length GH = length GH') as A. { subst. clear. induction GH1. - simpl. reflexivity. - simpl. simpl in IHGH1. rewrite IHGH1. reflexivity. } eapply stpd2_bind. assert (closed 1 (length GH) T0 -> closed 1 (length GH') T0) as C0. { rewrite A. intros P. apply P. } apply C0; assumption. assert (closed 1 (length GH) T3 -> closed 1 (length GH') T3) as C3. { rewrite A. intros P. apply P. } apply C3; assumption. assert ( stpd2 false G2 (open (TSelH (length GH)) T3) G2 (open (TSelH (length GH)) T3) ((0, (G2, open (TSelH (length GH)) T3)) :: GH') -> stpd2 false G2 (open (TSelH (length GH')) T3) G2 (open (TSelH (length GH')) T3) ((0, (G2, open (TSelH (length GH')) T3)) :: GH')) as CS1. { rewrite A. intros P. apply P. } apply CS1. eapply IHn. eassumption. omega. instantiate (5:=(0, (G2, open (TSelH (length GH)) T3)) :: GH1). subst. simpl. reflexivity. subst. simpl. reflexivity. assumption. assert ( stpd2 false G1 (open (TSelH (length GH)) T0) G2 (open (TSelH (length GH)) T3) ((0, (G1, open (TSelH (length GH)) T0)) :: GH') -> stpd2 false G1 (open (TSelH (length GH')) T0) G2 (open (TSelH (length GH')) T3) ((0, (G1, open (TSelH (length GH')) T0)) :: GH') ) as CS2. { rewrite A. intros P. apply P. } apply CS2. eapply IHn. eassumption. omega. instantiate (5:=(0, (G1, open (TSelH (length GH)) T0)) :: GH1). subst. simpl. reflexivity. subst. simpl. reflexivity. assumption. + SCase "wrapf". eapply stpd2_wrapf. eapply IHn; try eassumption. omega. + SCase "transf". eapply stpd2_transf. eapply IHn; try eassumption. omega. eapply IHn; try eassumption. omega. Grab Existential Variables. apply 0. apply 0. apply 0. Qed. Lemma stpd2_narrow: forall x G1 G2 G3 G4 T1 T2 T3 T4, stpd2 false G1 T1 G2 T2 [] -> (* careful about H! *) stpd2 false G3 T3 G4 T4 ((x,(G2,T2))::[]) -> stpd2 false G3 T3 G4 T4 ((x,(G1,T1))::[]). Proof. intros. inversion H0 as [n H']. eapply (stp2_narrow_aux n) with (GH1:=[]) (GH0:=[]). eapply H'. omega. simpl. reflexivity. reflexivity. assumption. Qed. Lemma atpd2_narrow: forall x G1 G2 G3 G4 T1 T2 T3 T4 H, atpd2 false G1 T1 G2 T2 ((x,(G1,T1))::H) -> (* careful about H! *) atpd2 false G3 T3 G4 T4 ((x,(G2,T2))::H) -> atpd2 false G3 T3 G4 T4 ((x,(G1,T1))::H). Proof. admit. Qed. Lemma sstpd2_trans_aux: forall n, forall m G1 G2 G3 T1 T2 T3 n1, stp2 0 m G1 T1 G2 T2 nil n1 -> n1 < n -> sstpd2 true G2 T2 G3 T3 nil -> sstpd2 true G1 T1 G3 T3 nil. Proof. intros n. induction n; intros; try omega. eu. inversion H. - Case "topx". subst. inversion H1. + SCase "topx". eexists. eauto. + SCase "top". eexists. eauto. + SCase "sel2". eexists. eapply stp2_strong_sel2; eauto. - Case "botx". subst. inversion H1. + SCase "botx". eexists. eauto. + SCase "top". eexists. eauto. + SCase "?". eexists. eauto. + SCase "sel2". eexists. eapply stp2_strong_sel2; eauto. - Case "top". subst. inversion H1. + SCase "topx". eexists. eauto. + SCase "top". eexists. eauto. + SCase "sel2". eexists. eapply stp2_strong_sel2; eauto. - Case "bot". subst. apply stp2_reg2 in H1. inversion H1 as [n1' H1']. exists (S n1'). apply stp2_bot. apply H1'. - Case "bool". subst. inversion H1. + SCase "top". eexists. eauto. + SCase "bool". eexists. eauto. + SCase "sel2". eexists. eapply stp2_strong_sel2; eauto. - Case "fun". subst. inversion H1. + SCase "top". assert (stpd2 false G1 T0 G1 T0 []) as A0 by solve [eapply stpd2_wrapf; eapply stp2_reg2; eassumption]. inversion A0 as [na0 HA0]. assert (stpd2 false G1 T4 G1 T4 []) as A4 by solve [eapply stpd2_wrapf; eapply stp2_reg1; eassumption]. inversion A4 as [na4 HA4]. eexists. eapply stp2_top. subst. eapply stp2_fun. eassumption. eassumption. + SCase "fun". subst. assert (stpd2 false G3 T7 G1 T0 []) as A by solve [eapply stpd2_trans; eauto]. inversion A as [na A']. assert (stpd2 false G1 T4 G3 T8 []) as B by solve [eapply stpd2_trans; eauto]. inversion B as [nb B']. eexists. eapply stp2_fun. apply A'. apply B'. + SCase "sel2". eexists. eapply stp2_strong_sel2. eauto. eauto. eauto. - Case "mem". subst. inversion H1. + SCase "top". apply stp2_reg1 in H. inversion H. eexists. eapply stp2_top. eassumption. + SCase "mem". subst. assert (sstpd2 false G3 T7 G1 T0 []) as A. { eapply sstpd2_trans_axiom; eexists; eauto. } inversion A as [na A']. assert (sstpd2 true G1 T4 G3 T8 []) as B. { eapply IHn. eassumption. omega. eexists. eassumption. } inversion B as [nb B']. eexists. eapply stp2_mem. apply A'. apply B'. + SCase "sel2". eexists. eapply stp2_strong_sel2; eauto. - Case "ssel1". assert (sstpd2 true GX TX G3 T3 []). eapply IHn. eauto. omega. eexists. eapply H1. eu. eexists. eapply stp2_strong_sel1; eauto. - Case "ssel2". subst. inversion H1. + SCase "top". subst. apply stp2_reg1 in H4. inversion H4. eexists. eapply stp2_top. eassumption. + SCase "ssel1". (* interesting one *) subst. rewrite H6 in H2. inversion H2. subst. eapply IHn. eapply H4. omega. eexists. eauto. + SCase "ssel2". eexists. eapply stp2_strong_sel2; eauto. + SCase "sselx". subst. rewrite H2 in H6. inversion H6. subst. eexists. eapply stp2_strong_sel2; eauto. - Case "sselx". subst. inversion H1. + SCase "top". subst. apply stp2_reg1 in H. inversion H. eexists. eapply stp2_top. eassumption. + SCase "ssel1". subst. rewrite H5 in H3. inversion H3. subst. eexists. eapply stp2_strong_sel1; eauto. + SCase "ssel2". eexists. eapply stp2_strong_sel2; eauto. + SCase "sselx". subst. rewrite H5 in H3. inversion H3. subst. eexists. eapply stp2_strong_selx. eauto. eauto. - Case "all". subst. inversion H1. + SCase "top". apply stp2_reg1 in H. inversion H. eexists. eapply stp2_top. eassumption. + SCase "ssel2". eexists. eapply stp2_strong_sel2; eauto. + SCase "all". subst. assert (stpd2 false G3 T7 G1 T0 []). eapply stpd2_trans. eauto. eauto. assert (stpd2 false G1 (open (TSelH (length ([]:aenv))) T4) G3 (open (TSelH (length ([]:aenv))) T8) [(0, (G3, T7))]). eapply stpd2_trans. eapply stpd2_narrow. eexists. eapply H9. eauto. eauto. repeat eu. eexists. eapply stp2_all. eauto. eauto. eauto. eauto. eapply H8. - Case "bind". subst. inversion H1; subst. + SCase "top". apply stp2_reg1 in H. inversion H. eexists. eapply stp2_top. eassumption. + SCase "ssel2". eexists. eapply stp2_strong_sel2; eauto. + SCase "bind". subst. assert (atpd2 false G1 (open (TSelH 0) T0) G3 (open (TSelH 0) T2) [(0, (G1, open (TSelH 0) T0))]) as A. { simpl in H5. simpl in H10. eapply atpd2_trans_axiom. eexists; eauto. change ([(0, (G1, open (TSelH 0) T0))]) with ((0, (G1, open (TSelH 0) T0))::[]). eapply atpd2_narrow. eexists. eassumption. eexists. eassumption. } inversion A. eexists. eapply stp2_bind; try eassumption. - Case "wrapf". subst. eapply IHn. eapply H2. omega. eexists. eauto. - Case "transf". subst. eapply IHn. eapply H2. omega. eapply IHn. eapply H3. omega. eexists. eauto. Grab Existential Variables. apply 0. apply 0. apply 0. apply 0. apply 0. apply 0. apply 0. Qed. Lemma sstpd2_trans: forall G1 G2 G3 T1 T2 T3, sstpd2 true G1 T1 G2 T2 nil -> sstpd2 true G2 T2 G3 T3 nil -> sstpd2 true G1 T1 G3 T3 nil. Proof. intros. repeat eu. eapply sstpd2_trans_aux; eauto. eexists. eauto. Qed. Lemma sstpd2_untrans_aux: forall n, forall G1 G2 T1 T2 n1, stp2 0 false G1 T1 G2 T2 nil n1 -> n1 < n -> sstpd2 true G1 T1 G2 T2 nil. Proof. intros n. induction n; intros; try omega. inversion H; subst. - Case "wrapf". eexists. eauto. - Case "transf". eapply sstpd2_trans_aux. eapply H1. eauto. eapply IHn. eauto. omega. Qed. Lemma sstpd2_untrans: forall G1 G2 T1 T2, sstpd2 false G1 T1 G2 T2 nil -> sstpd2 true G1 T1 G2 T2 nil. Proof. intros. repeat eu. eapply sstpd2_untrans_aux; eauto. Qed. Lemma valtp_widen: forall vf H1 H2 T1 T2, val_type H1 vf T1 -> sstpd2 true H1 T1 H2 T2 [] -> val_type H2 vf T2. Proof. intros. inversion H; econstructor; eauto; eapply sstpd2_trans; eauto. Qed. Lemma restp_widen: forall vf H1 H2 T1 T2, res_type H1 vf T1 -> sstpd2 true H1 T1 H2 T2 [] -> res_type H2 vf T2. Proof. intros. inversion H. eapply not_stuck. eapply valtp_widen; eauto. Qed. Lemma invert_typ: forall venv vx T1 T2, val_type venv vx (TMem T1 T2) -> exists GX TX, vx = (vty GX TX) /\ sstpd2 false venv T1 GX TX [] /\ sstpd2 true GX TX venv T2 []. Proof. intros. inversion H; ev; try solve by inversion. inversion H1. subst. assert (sstpd2 false venv0 T1 venv1 T0 []) as E1. { eexists. eassumption. } assert (sstpd2 true venv1 T0 venv0 T2 []) as E2. { eexists. eassumption. } repeat eu. repeat eexists; eauto. Qed. Lemma stpd2_to_sstpd2_aux1: forall n, forall G1 G2 T1 T2 m n1, stp2 1 m G1 T1 G2 T2 nil n1 -> n1 < n -> sstpd2 m G1 T1 G2 T2 nil. Proof. intros n. induction n; intros; try omega. inversion H. - Case "topx". eexists. eauto. - Case "botx". eexists. eauto. - Case "top". subst. eapply IHn in H1. inversion H1. eexists. eauto. omega. - Case "bot". subst. eapply IHn in H1. inversion H1. eexists. eauto. omega. - Case "bool". eexists. eauto. - Case "fun". eexists. eapply stp2_fun. eauto. eauto. - Case "mem". eapply IHn in H2. eapply sstpd2_untrans in H2. eu. eapply IHn in H3. eapply sstpd2_untrans in H3. eu. eexists. eapply stp2_mem. eauto. eauto. omega. omega. - Case "sel1". eapply IHn in H5. eapply sstpd2_untrans in H5. eapply valtp_widen with (2:=H5) in H3. eapply invert_typ in H3. ev. repeat eu. subst. assert (closed 0 (length ([]:aenv)) x1). eapply stp2_closed2; eauto. eexists. eapply stp2_strong_sel1. eauto. eauto. eauto. omega. - Case "sel2". eapply IHn in H5. eapply sstpd2_untrans in H5. eapply valtp_widen with (2:=H5) in H3. eapply invert_typ in H3. ev. repeat eu. subst. assert (closed 0 (length ([]:aenv)) x1). eapply stp2_closed2; eauto. eexists. eapply stp2_strong_sel2. eauto. eauto. eauto. omega. - Case "selx". eexists. eapply stp2_strong_selx. eauto. eauto. - Case "sela1". inversion H2. - Case "selab1". inversion H2. - Case "sela2". inversion H2. - Case "selax". inversion H2. - Case "all". eexists. eapply stp2_all. eauto. eauto. eauto. eauto. eauto. - Case "bind". eexists. eapply stp2_bind. eauto. eauto. eauto. eauto. - Case "wrapf". eapply IHn in H1. eu. eexists. eapply stp2_wrapf. eauto. omega. - Case "transf". eapply IHn in H1. eapply IHn in H2. eu. eu. eexists. eapply stp2_transf. eauto. eauto. omega. omega. Grab Existential Variables. apply 0. apply 0. apply 0. apply 0. Qed. Lemma stpd2_to_sstpd2_aux2: forall n, forall G1 G2 GH T1 T2 m n1, stp2 2 m G1 T1 G2 T2 GH n1 -> n1 < n -> exists n2, stp2 1 m G1 T1 G2 T2 GH n2. Proof. intros n. induction n; intros; try omega. inversion H. - Case "topx". eexists. eauto. - Case "botx". eexists. eauto. - Case "top". subst. eapply IHn in H1. inversion H1. eexists. eauto. omega. - Case "bot". subst. eapply IHn in H1. inversion H1. eexists. eauto. omega. - Case "bool". eexists. eauto. - Case "fun". eexists. eapply stp2_fun. eauto. eauto. - Case "mem". eapply IHn in H2. ev. eapply IHn in H3. ev. eexists. eapply stp2_mem2; eauto. omega. omega. - Case "sel1". subst. eapply IHn in H5. eapply IHn in H6. ev. ev. eexists. eapply stp2_sel1; eauto. omega. omega. - Case "selb1". subst. eapply IHn in H5. eapply IHn in H6. ev. ev. eapply stpd2_to_sstpd2_aux1 in H5. eapply sstpd2_untrans in H5. eapply valtp_widen with (2:=H5) in H3. (* now invert base on TBind knowledge -- TODO: helper lemma*) inversion H3; ev. subst. inversion H7. subst. inversion H6. subst. inversion H10. inversion H9. (* 1 case left *) subst. inversion H9. subst. assert (stp2 1 false venv0 (open (TSel x2) T2) G2 (open (TSel x) (TMem TBot T0)) [] n1) as ST. admit. (* get this from substitute *) (* NOTE: this crucially depends on the result of inverting stp_bind having level 1, so we don't need to do induction on it. Right now, this is quite a limitation: we cannot use level 2 derivations inside binds. - We cannot lower levels in hypothetical contexts, because we need to untrans above. So we cannot change the bind's body elsewhere, before inverting here. (UPDATE: actually that's what we're doing now. We get away with it because GH = [], which means that we may not be able to unfold nontrivial binds for selections on hypothetical vars) - Doing induction on ST here would be difficult, because the size is wrong. We're inverting from valtp, which does not count towards our own size. It may seem that it should. But then it needs to be inserted by stp_substitute, ergo stp_substitute will no longer keep things at const size, and will return larger terms. That makes it seem unlikely that we'd be able to use IHn on the result. We know the size of what we're putting into ST. But we have the same problem as previously in narrowing: we do not know how many times the added term is used, so we cannot bound the result size. *) assert (closed 0 (length (nil:aenv)) (open (TSel x2) T2)) as C. eapply stp2_closed1. eauto. simpl in C. eexists. eapply stp2_sel1. eauto. eapply H7. eauto. eapply stp2_extendH_mult0. eauto. eauto. eauto. omega. omega. - Case "sel2". subst. eapply IHn in H5. eapply IHn in H6. ev. ev. eexists. eapply stp2_sel2; eauto. omega. omega. - Case "selx". subst. eexists. eapply stp2_selx. eauto. eauto. - Case "sela1". subst. eapply IHn in H4. eapply IHn in H5. ev. ev. eexists. eapply stp2_sela1; eauto. omega. omega. - Case "selab1". (* THIS ONE WILL NOT WORK AT LEVEL 2 (no way to remove *) (* so we use it at level 1, and translate during subst *) (* restriction GH = [] ensures that level 2 terms are already removed *) eapply IHn in H3. eapply IHn in H5. ev. ev. eexists. eapply stp2_selab1; eauto. omega. omega. - Case "sela2". eapply IHn in H4. eapply IHn in H5. ev. ev. eexists. eapply stp2_sela2; eauto. omega. omega. - Case "selhx". eexists. eapply stp2_selax. eauto. - Case "all". eexists. eapply stp2_all. eauto. eauto. eauto. eapply H4. eapply H5. - Case "bind". eapply IHn in H4. eapply IHn in H5. ev. ev. eexists. eapply stp2_bindb. eauto. eauto. eauto. eauto. omega. omega. - Case "wrapf". eapply IHn in H1. ev. eexists. eapply stp2_wrapf. eauto. omega. - Case "transf". eapply IHn in H1. eapply IHn in H2. ev. ev. eexists. eapply stp2_transf. eauto. eauto. omega. omega. Grab Existential Variables. apply 0. apply 0. apply 0. apply 0. apply 0. Qed. Lemma stpd2_to_sstpd2: forall G1 G2 T1 T2 m, stpd2 m G1 T1 G2 T2 nil -> sstpd2 m G1 T1 G2 T2 nil. Proof. intros. eu. eapply stpd2_to_sstpd2_aux2 in H. ev. eapply stpd2_to_sstpd2_aux1; eauto. eauto. Qed. Lemma stpd2_upgrade: forall G1 G2 T1 T2, stpd2 false G1 T1 G2 T2 nil -> sstpd2 true G1 T1 G2 T2 nil. Proof. intros. eapply sstpd2_untrans. eapply stpd2_to_sstpd2. eauto. Qed. (* not essential *) Lemma sstpd2_downgrade: forall G1 G2 T1 T2 H, sstpd2 true G1 T1 G2 T2 H -> stpd2 false G1 T1 G2 T2 H. Proof. admit. Qed. Lemma index_miss {X}: forall x x1 (B:X) A G, index x ((x1,B)::G) = A -> fresh G <= x1 -> x <> x1 -> index x G = A. Proof. intros. unfold index in H. elim (le_xx (fresh G) x1 H0). intros. rewrite H2 in H. assert (beq_nat x x1 = false). eapply beq_nat_false_iff. eauto. rewrite H3 in H. eapply H. Qed. Lemma index_hit {X}: forall x x1 (B:X) A G, index x ((x1,B)::G) = Some A -> fresh G <= x1 -> x = x1 -> B = A. Proof. intros. unfold index in H. elim (le_xx (fresh G) x1 H0). intros. rewrite H2 in H. assert (beq_nat x x1 = true). eapply beq_nat_true_iff. eauto. rewrite H3 in H. inversion H. eauto. Qed. Lemma index_hit2 {X}: forall x x1 (B:X) A G, fresh G <= x1 -> x = x1 -> B = A -> index x ((x1,B)::G) = Some A. Proof. intros. unfold index. elim (le_xx (fresh G) x1 H). intros. rewrite H2. assert (beq_nat x x1 = true). eapply beq_nat_true_iff. eauto. rewrite H3. rewrite H1. eauto. Qed. Lemma indexr_miss {X}: forall x x1 (B:X) A G, indexr x ((x1,B)::G) = A -> x <> (length G) -> indexr x G = A. Proof. intros. unfold indexr in H. assert (beq_nat x (length G) = false). eapply beq_nat_false_iff. eauto. rewrite H1 in H. eauto. Qed. Lemma indexr_hit {X}: forall x x1 (B:X) A G, indexr x ((x1,B)::G) = Some A -> x = length G -> B = A. Proof. intros. unfold indexr in H. assert (beq_nat x (length G) = true). eapply beq_nat_true_iff. eauto. rewrite H1 in H. inversion H. eauto. Qed. Lemma indexr_hit0: forall GH (GX0:venv) (TX0:ty), indexr 0 (GH ++ [(0,(GX0, TX0))]) = Some (GX0, TX0). Proof. intros GH. induction GH. - intros. simpl. eauto. - intros. simpl. destruct a. simpl. rewrite app_length. simpl. assert (length GH + 1 = S (length GH)). omega. rewrite H. eauto. Qed. Hint Resolve beq_nat_true_iff. Hint Resolve beq_nat_false_iff. Lemma closed_no_open: forall T x l j, closed_rec j l T -> T = open_rec j x T. Proof. intros. induction H; intros; eauto; try solve [compute; compute in IHclosed_rec; rewrite <-IHclosed_rec; auto]; try solve [compute; compute in IHclosed_rec1; compute in IHclosed_rec2; rewrite <-IHclosed_rec1; rewrite <-IHclosed_rec2; auto]. Case "TSelB". unfold open_rec. assert (k <> i). omega. apply beq_nat_false_iff in H0. rewrite H0. auto. Qed. Lemma open_subst_commute: forall T2 TX (n:nat) x j, closed j n TX -> (open_rec j (TSelH x) (subst TX T2)) = (subst TX (open_rec j (TSelH (x+1)) T2)). Proof. intros T2 TX n. induction T2; intros; eauto. - simpl. rewrite IHT2_1. rewrite IHT2_2. eauto. eauto. eauto. - simpl. rewrite IHT2_1. rewrite IHT2_2. eauto. eauto. eauto. - simpl. case_eq (beq_nat i 0); intros E. symmetry. eapply closed_no_open. eauto. simpl. eauto. - simpl. case_eq (beq_nat j i); intros E. simpl. assert (x+1<>0). omega. eapply beq_nat_false_iff in H0. assert (x=x+1-1). unfold id. omega. rewrite H0. eauto. simpl. eauto. - simpl. rewrite IHT2_1. rewrite IHT2_2. eauto. eapply closed_upgrade. eauto. eauto. eauto. - simpl. rewrite IHT2. eauto. eapply closed_upgrade. eauto. eauto. Qed. Lemma closed_no_subst: forall T j TX, closed_rec j 0 T -> subst TX T = T. Proof. intros T. induction T; intros; inversion H; simpl; eauto; try rewrite (IHT (S j) TX); eauto; try rewrite (IHT2 (S j) TX); eauto; try rewrite (IHT j TX); eauto; try rewrite (IHT1 j TX); eauto; try rewrite (IHT2 j TX); eauto. eapply closed_upgrade. eauto. eauto. eapply closed_upgrade. eauto. eauto. subst. omega. Qed. Lemma closed_subst: forall j n TX T, closed j (n+1) T -> closed 0 n TX -> closed j (n) (subst TX T). Proof. intros. generalize dependent j. induction T; intros; inversion H; unfold closed; try econstructor; try eapply IHT1; eauto; try eapply IHT2; eauto; try eapply IHT; eauto. - Case "TSelH". simpl. case_eq (beq_nat i 0); intros E. eapply closed_upgrade. eapply closed_upgrade_free. eauto. omega. eauto. omega. econstructor. assert (i > 0). eapply beq_nat_false_iff in E. omega. omega. Qed. Lemma subst_open_commute_m: forall j n m TX T2, closed (j+1) (n+1) T2 -> closed 0 m TX -> subst TX (open_rec j (TSelH (n+1)) T2) = open_rec j (TSelH n) (subst TX T2). Proof. intros. generalize dependent j. generalize dependent n. induction T2; intros; inversion H; simpl; eauto; try rewrite IHT2_1; try rewrite IHT2_2; try rewrite IHT2; eauto. - Case "TSelH". simpl. case_eq (beq_nat i 0); intros E. eapply closed_no_open. eapply closed_upgrade. eauto. omega. eauto. - Case "TSelB". simpl. case_eq (beq_nat j i); intros E. simpl. case_eq (beq_nat (n+1) 0); intros E2. eapply beq_nat_true_iff in E2. omega. assert (n+1-1 = n). omega. eauto. eauto. Qed. Lemma subst_open_commute: forall j n TX T2, closed (j+1) (n+1) T2 -> closed 0 0 TX -> subst TX (open_rec j (TSelH (n+1)) T2) = open_rec j (TSelH n) (subst TX T2). Proof. intros. eapply subst_open_commute_m; eauto. Qed. Lemma subst_open_zero: forall j k TX T2, closed k 0 T2 -> subst TX (open_rec j (TSelH 0) T2) = open_rec j TX T2. Proof. intros. generalize dependent k. generalize dependent j. induction T2; intros; inversion H; simpl; eauto; try rewrite (IHT2_1 _ k); try rewrite (IHT2_2 _ (S k)); try rewrite (IHT2_2 _ (S k)); try rewrite (IHT2 _ (S k)); try rewrite (IHT2 _ k); eauto. eapply closed_upgrade; eauto. eapply closed_upgrade; eauto. case_eq (beq_nat i 0); intros E. omega. omega. case_eq (beq_nat j i); intros E. eauto. eauto. Qed. Lemma Forall2_length: forall A B f (G1:list A) (G2:list B), Forall2 f G1 G2 -> length G1 = length G2. Proof. intros. induction H. eauto. simpl. eauto. Qed. Lemma nosubst_intro: forall j T, closed j 0 T -> nosubst T. Proof. intros. generalize dependent j. induction T; intros; inversion H; simpl; eauto. omega. Qed. Lemma nosubst_open: forall j TX T2, nosubst TX -> nosubst T2 -> nosubst (open_rec j TX T2). Proof. intros. generalize dependent j. induction T2; intros; try inversion H0; simpl; eauto. case_eq (beq_nat j i); intros E. eauto. eauto. Qed. Lemma nosubst_open_rev: forall j TX T2, nosubst (open_rec j TX T2) -> nosubst TX -> nosubst T2. Proof. intros. generalize dependent j. induction T2; intros; try inversion H; simpl in H; simpl; eauto. Qed. Lemma nosubst_zero_closed: forall j T2, nosubst (open_rec j (TSelH 0) T2) -> closed_rec (j+1) 0 T2 -> closed_rec j 0 T2. Proof. intros. generalize dependent j. induction T2; intros; simpl in H; try destruct H; inversion H0; eauto. omega. econstructor. case_eq (beq_nat j i); intros E. rewrite E in H. destruct H. eauto. eapply beq_nat_false_iff in E. omega. Qed. (* substitution for one-env stp. not necessary, but good sanity check *) Definition substt (UX: ty) (V: (id*ty)) := match V with | (x,T) => (x-1,(subst UX T)) end. Lemma indexr_subst: forall GH0 x TX TX', indexr x (GH0 ++ [(0, TX)]) = Some (TX') -> x = 0 /\ TX = TX' \/ x > 0 /\ indexr (x-1) (map (substt TX) GH0) = Some (subst TX TX'). Proof. intros GH0. induction GH0; intros. - simpl in H. case_eq (beq_nat x 0); intros E. + rewrite E in H. inversion H. left. split. eapply beq_nat_true_iff. eauto. eauto. + rewrite E in H. inversion H. - destruct a. unfold id in H. remember ((length (GH0 ++ [(0, TX)]))) as L. case_eq (beq_nat x L); intros E. + assert (x = L). eapply beq_nat_true_iff. eauto. eapply indexr_hit in H. right. split. rewrite app_length in HeqL. simpl in HeqL. omega. assert ((x - 1) = (length (map (substt TX) GH0))). rewrite map_length. rewrite app_length in HeqL. simpl in HeqL. unfold id. omega. simpl. eapply beq_nat_true_iff in H1. unfold id in H1. unfold id. rewrite H1. subst. eauto. eauto. subst. eauto. + assert (x <> L). eapply beq_nat_false_iff. eauto. eapply indexr_miss in H. eapply IHGH0 in H. inversion H. left. eapply H1. right. inversion H1. split. eauto. simpl. assert ((x - 1) <> (length (map (substt TX) GH0))). rewrite app_length in HeqL. simpl in HeqL. rewrite map_length. unfold not. intros. subst L. unfold id in H0. unfold id in H2. unfold not in H0. eapply H0. unfold id in H4. rewrite <-H4. omega. eapply beq_nat_false_iff in H4. unfold id in H4. unfold id. rewrite H4. eauto. subst. eauto. Qed. (* when and how we can replace with multiple environments: stp2 G1 T1 G2 T2 (GH0 ++ [(0,vtya GX TX)]) 1) T1 closed stp2 G1 T1 G2' T2' (subst GH0) 2) G1 contains (GX TX) at some index x1 index x1 G1 = (GX TX) stp2 G (subst (TSel x1) T1) G2' T2' 3) G1 = GX <----- valid for Fsub, but not for DOT ! stp2 G1 (subst TX T1) G2' T2' 4) G1 and GX unrelated stp2 ((GX,TX) :: G1) (subst (TSel (length G1)) T1) G2' T2' *) (* ---- two-env substitution. first define what 'compatible' types mean. ---- *) Definition compat (GX:venv) (TX: ty) (V: option vl) (G1:venv) (T1:ty) (T1':ty) := (exists x1 v, index x1 G1 = Some v /\ V = Some v /\ GX = GX /\ val_type GX v TX /\ T1' = (subst (TSel x1) T1)) \/ (* (G1 = GX /\ T1' = (subst TX T1)) \/ *) (* this is doesn't work for DOT *) (* ((forall TA TB, TX <> TMem TA TB) /\ T1' = subst TTop T1) \/ *)(* can remove all term-only bindings -- may not be necessary after all since it applies nosubst *) (closed_rec 0 0 T1 /\ T1' = T1) \/ (* this one is for convenience: redundant with next *) (nosubst T1 /\ T1' = subst TTop T1). Definition compat2 (GX:venv) (TX: ty) (V: option vl) (p1:id*(venv*ty)) (p2:id*(venv*ty)) := match p1, p2 with (n1,(G1,T1)), (n2,(G2,T2)) => n1=n2(*+1 disregarded*) /\ G1 = G2 /\ compat GX TX V G1 T1 T2 end. Lemma closed_compat: forall GX TX V GXX TXX TXX' j k, compat GX TX V GXX TXX TXX' -> closed 0 k TX -> closed j (k+1) TXX -> closed j k TXX'. Proof. intros. inversion H;[|destruct H2;[|destruct H2]]. - destruct H2. destruct H2. destruct H2. destruct H2. destruct H3. destruct H3. destruct H3. destruct H4. rewrite H4. eapply closed_subst. eauto. eauto. - destruct H2. rewrite H3. eapply closed_upgrade. eapply closed_upgrade_free. eauto. omega. omega. - rewrite H3. eapply closed_subst. eauto. eauto. Qed. Lemma indexr_compat_miss0: forall GH GH' GX TX V (GXX:venv) (TXX:ty) n, Forall2 (compat2 GX TX V) GH GH' -> indexr (n+1) (GH ++ [(0,(GX, TX))]) = Some (GXX,TXX) -> exists TXX', indexr n GH' = Some (GXX,TXX') /\ compat GX TX V GXX TXX TXX'. Proof. intros. revert n H0. induction H. - intros. simpl. eauto. simpl in H0. assert (n+1 <> 0). omega. eapply beq_nat_false_iff in H. rewrite H in H0. inversion H0. - intros. simpl. destruct y. case_eq (beq_nat n (length l')); intros E. + simpl in H1. destruct x. rewrite app_length in H1. simpl in H1. assert (n = length l'). eapply beq_nat_true_iff. eauto. assert (beq_nat (n+1) (length l + 1) = true). eapply beq_nat_true_iff. rewrite (Forall2_length _ _ _ _ _ H0). omega. rewrite H3 in H1. destruct p. destruct p0. inversion H1. subst. simpl in H. destruct H. destruct H2. subst. inversion H1. subst. eexists. eauto. + simpl in H1. destruct x. assert (n <> length l'). eapply beq_nat_false_iff. eauto. assert (beq_nat (n+1) (length l + 1) = false). eapply beq_nat_false_iff. rewrite (Forall2_length _ _ _ _ _ H0). omega. rewrite app_length in H1. simpl in H1. rewrite H3 in H1. eapply IHForall2. eapply H1. Qed. Lemma compat_top: forall GX TX V G1 T1', compat GX TX V G1 TTop T1' -> closed 0 0 TX -> T1' = TTop. Proof. intros ? ? ? ? ? CC CLX. repeat destruct CC as [|CC]; ev; eauto. Qed. Lemma compat_bot: forall GX TX V G1 T1', compat GX TX V G1 TBot T1' -> closed 0 0 TX -> T1' = TBot. Proof. intros ? ? ? ? ? CC CLX. repeat destruct CC as [|CC]; ev; eauto. Qed. Lemma compat_bool: forall GX TX V G1 T1', compat GX TX V G1 TBool T1' -> closed 0 0 TX -> T1' = TBool. Proof. intros ? ? ? ? ? CC CLX. repeat destruct CC as [|CC]; ev; eauto. Qed. Lemma compat_mem: forall GX TX V G1 T1 T2 T1', compat GX TX V G1 (TMem T1 T2) T1' -> closed 0 0 TX -> exists TA TB, T1' = TMem TA TB /\ compat GX TX V G1 T1 TA /\ compat GX TX V G1 T2 TB. Proof. intros ? ? ? ? ? ? ? CC CLX. repeat destruct CC as [|CC]. - ev. repeat eexists; eauto. + left. repeat eexists; eauto. + left. repeat eexists; eauto. - ev. repeat eexists; eauto. + right. left. inversion H. eauto. + right. left. inversion H. eauto. - ev. repeat eexists; eauto. + right. right. inversion H. eauto. + right. right. inversion H. eauto. Qed. Lemma compat_mem_fwd2: forall GX TX V G1 T2 T2', compat GX TX V G1 T2 T2' -> compat GX TX V G1 (TMem TBot T2) (TMem TBot T2'). Proof. intros. repeat destruct H as [|H]. - ev. repeat eexists; eauto. + left. repeat eexists; eauto. rewrite H3. eauto. - ev. repeat eexists; eauto. + right. left. subst. eauto. - ev. repeat eexists; eauto. + right. right. subst. simpl. eauto. Qed. Lemma compat_mem_fwd1: forall GX TX V G1 T2 T2', compat GX TX V G1 T2 T2' -> compat GX TX V G1 (TMem T2 TTop) (TMem T2' TTop). Proof. intros. repeat destruct H as [|H]. - ev. repeat eexists; eauto. + left. repeat eexists; eauto. rewrite H3. eauto. - ev. repeat eexists; eauto. + right. left. subst. eauto. - ev. repeat eexists; eauto. + right. right. subst. simpl. eauto. Qed. Lemma compat_mem_fwdx: forall GX TX V G1 T2 T2', compat GX TX V G1 T2 T2' -> compat GX TX V G1 (TMem T2 T2) (TMem T2' T2'). Proof. intros. repeat destruct H as [|H]. - ev. repeat eexists; eauto. + left. repeat eexists; eauto. rewrite H3. eauto. - ev. repeat eexists; eauto. + right. left. subst. eauto. - ev. repeat eexists; eauto. + right. right. subst. simpl. eauto. Qed. Lemma compat_fun: forall GX TX V G1 T1 T2 T1', compat GX TX V G1 (TFun T1 T2) T1' -> closed_rec 0 0 TX -> exists TA TB, T1' = TFun TA TB /\ compat GX TX V G1 T1 TA /\ compat GX TX V G1 T2 TB. Proof. intros ? ? ? ? ? ? ? CC CLX. repeat destruct CC as [|CC]. - ev. repeat eexists; eauto. + left. repeat eexists; eauto. + left. repeat eexists; eauto. - ev. repeat eexists; eauto. + right. left. inversion H. eauto. + right. left. inversion H. eauto. - ev. repeat eexists; eauto. + right. right. inversion H. eauto. + right. right. inversion H. eauto. Qed. Lemma compat_sel: forall GX TX V G1 T1' (GXX:venv) (TXX:ty) x v, compat GX TX V G1 (TSel x) T1' -> closed 0 0 TX -> closed 0 0 TXX -> index x G1 = Some v -> val_type GXX v TXX -> exists TXX', T1' = (TSel x) /\ TXX' = TXX /\ compat GX TX V GXX TXX TXX' . Proof. intros ? ? ? ? ? ? ? ? ? CC CL CL1 IX. repeat destruct CC as [|CC]. - ev. repeat eexists; eauto. + right. left. simpl in H0. eauto. - ev. repeat eexists; eauto. + right. left. simpl in H0. eauto. - ev. repeat eexists; eauto. + right. left. simpl in H0. eauto. Qed. Lemma compat_selh: forall GX TX V G1 T1' GH0 GH0' (GXX:venv) (TXX:ty) x, compat GX TX V G1 (TSelH x) T1' -> closed 0 0 TX -> indexr x (GH0 ++ [(0, (GX, TX))]) = Some (GXX, TXX) -> Forall2 (compat2 GX TX V) GH0 GH0' -> (x = 0 /\ GXX = GX /\ TXX = TX) \/ exists TXX', x > 0 /\ T1' = TSelH (x-1) /\ indexr (x-1) GH0' = Some (GXX, TXX') /\ compat GX TX V GXX TXX TXX' . Proof. intros ? ? ? ? ? ? ? ? ? ? CC CL IX FA. unfold id in x. case_eq (beq_nat x 0); intros E. - left. assert (x = 0). eapply beq_nat_true_iff. eauto. subst x. rewrite indexr_hit0 in IX. inversion IX. eauto. - right. assert (x <> 0). eapply beq_nat_false_iff. eauto. assert (x > 0). omega. remember (x-1) as y. assert (x = y+1) as Y. omega. subst x. eapply (indexr_compat_miss0 GH0 GH0' _ _ _ _ _ _ FA) in IX. repeat destruct CC as [|CC]. + ev. simpl in H7. rewrite E in H7. rewrite <-Heqy in H7. eexists. eauto. + ev. inversion H1. omega. + ev. simpl in H4. rewrite E in H4. rewrite <-Heqy in H4. eexists. eauto. Qed. Lemma compat_all: forall GX TX V G1 T1 T2 T1' n, compat GX TX V G1 (TAll T1 T2) T1' -> closed 0 0 TX -> closed 1 (n+1) T2 -> exists TA TB, T1' = TAll TA TB /\ closed 1 n TB /\ compat GX TX V G1 T1 TA /\ compat GX TX V G1 (open_rec 0 (TSelH (n+1)) T2) (open_rec 0 (TSelH n) TB). Proof. intros ? ? ? ? ? ? ? ? CC CLX CL2. repeat destruct CC as [|CC]. - ev. simpl in H0. repeat eexists; eauto. eapply closed_subst; eauto. + unfold compat. left. repeat eexists; eauto. + unfold compat. left. repeat eexists; eauto. rewrite subst_open_commute; eauto. - ev. simpl in H0. inversion H. repeat eexists; eauto. eapply closed_upgrade_free; eauto. omega. + unfold compat. right. right. split. eapply nosubst_intro; eauto. symmetry. eapply closed_no_subst; eauto. + unfold compat. right. right. split. * eapply nosubst_open. simpl. omega. eapply nosubst_intro. eauto. * rewrite subst_open_commute. assert (T2 = subst TTop T2) as E. symmetry. eapply closed_no_subst; eauto. rewrite <-E. eauto. eauto. eauto. - ev. simpl in H0. destruct H. repeat eexists; eauto. eapply closed_subst; eauto. eauto. + unfold compat. right. right. eauto. + unfold compat. right. right. split. * eapply nosubst_open. simpl. omega. eauto. * rewrite subst_open_commute; eauto. Qed. Lemma compat_bind: forall GX TX V G1 T2 T1' n, compat GX TX V G1 (TBind T2) T1' -> closed 0 0 TX -> closed 1 (n+1) T2 -> exists TB, T1' = TBind TB /\ closed 1 n TB /\ compat GX TX V G1 (open_rec 0 (TSelH (n+1)) T2) (open_rec 0 (TSelH n) TB). Proof. intros ? ? ? ? ? ? ? CC CLX CL2. repeat destruct CC as [|CC]. - ev. simpl in H0. repeat eexists; eauto. eapply closed_subst; eauto. + unfold compat. left. repeat eexists; eauto. rewrite subst_open_commute; eauto. - ev. simpl in H0. inversion H. repeat eexists; eauto. eapply closed_upgrade_free; eauto. omega. + unfold compat. right. right. split. * eapply nosubst_open. simpl. omega. eapply nosubst_intro. eauto. * rewrite subst_open_commute. assert (T2 = subst TTop T2) as E. symmetry. eapply closed_no_subst; eauto. rewrite <-E. eauto. eauto. eauto. - ev. simpl in H0. simpl in H. repeat eexists; eauto. eapply closed_subst; eauto. eauto. + unfold compat. right. right. split. * eapply nosubst_open. simpl. omega. eauto. * rewrite subst_open_commute; eauto. Qed. (* can be called on level >= 1 *) Lemma stp2_substitute_aux: forall n, forall d m G1 G2 T1 T2 GH n1, stp2 (S d) m G1 T1 G2 T2 GH n1 -> n1 < n -> forall GH0 GH0' GX TX T1' T2' V, GH = (GH0 ++ [(0,(GX, TX))]) -> closed 0 0 TX -> compat GX TX V G1 T1 T1' -> compat GX TX V G2 T2 T2' -> Forall2 (compat2 GX TX V) GH0 GH0' -> stp2 (S d) m G1 T1' G2 T2' GH0' n1. Proof. intros n. induction n; intros d m G1 G2 T1 T2 GH n1 H ?. inversion H0. inversion H; subst. - Case "topx". intros GH0 GH0' GXX TXX T1' T2' V ? CX IX1 IX2 FA. eapply compat_top in IX1. eapply compat_top in IX2. subst. eapply stp2_topx. eauto. eauto. - Case "botx". intros GH0 GH0' GXX TXX T1' T2' V ? CX IX1 IX2 FA. eapply compat_bot in IX1. eapply compat_bot in IX2. subst. eapply stp2_botx. eauto. eauto. - Case "top". intros GH0 GH0' GXX TXX T1' T2' V ? CX IX1 IX2 FA. eapply compat_top in IX2. subst. eapply stp2_top. eapply IHn; eauto. omega. eauto. - Case "bot". intros GH0 GH0' GXX TXX T1' T2' V ? CX IX1 IX2 FA. eapply compat_bot in IX1. subst. eapply stp2_bot. eapply IHn; eauto. omega. eauto. - Case "bool". intros GH0 GH0' GXX TXX T1' T2' V ? CX IX1 IX2 FA. eapply compat_bool in IX1. eapply compat_bool in IX2. subst. eapply stp2_bool; eauto. eauto. eauto. - Case "fun". intros GH0 GH0' GXX TXX T1' T2' V ? CX IX1 IX2 FA. eapply compat_fun in IX1. repeat destruct IX1 as [? IX1]. eapply compat_fun in IX2. repeat destruct IX2 as [? IX2]. subst. eapply stp2_fun. eapply IHn; eauto. omega. eapply IHn; eauto. omega. eauto. eauto. - Case "mem". intros GH0 GH0' GXX TXX T1' T2' V ? CX IX1 IX2 FA. eapply compat_mem in IX1. repeat destruct IX1 as [? IX1]. eapply compat_mem in IX2. repeat destruct IX2 as [? IX2]. subst. eapply stp2_mem2. eapply IHn; eauto. omega. eapply IHn; eauto. omega. eauto. eauto. - Case "sel1". intros GH0 GH0' GXX TXX T1' T2' V ? CX IX1 IX2 FA. assert (length GH = length GH0 + 1). subst GH. eapply app_length. assert (length GH0 = length GH0') as EL. eapply Forall2_length. eauto. eapply (compat_sel GXX TXX V G1 T1' GX TX) in IX1. repeat destruct IX1 as [? IX1]. assert (compat GXX TXX V GX TX TX) as CPX. right. left. eauto. subst. eapply stp2_sel1. eauto. eauto. eauto. eapply IHn. eauto. omega. eauto. eauto. eauto. eapply compat_mem_fwd2. eauto. eauto. eapply IHn; eauto; try omega. eauto. eauto. eauto. eauto. - Case "selb1". intros GH0 GH0' GXX TXX T1' T2' V ? CX IX1 IX2 FA. assert (closed 0 (length ([]:aenv)) (TBind (TMem TBot T0))). eapply stp2_closed2; eauto. simpl in H6. unfold closed in H7. inversion H7. subst. inversion H11. subst. admit. (* eapply stp2_selb1. arg has GH = [] so nothing to be done (inversion IX2 and then a couple simplifications *) - Case "sel2". intros GH0 GH0' GXX TXX T1' T2' V ? CX IX1 IX2 FA. assert (length GH = length GH0 + 1). subst GH. eapply app_length. assert (length GH0 = length GH0') as EL. eapply Forall2_length. eauto. eapply (compat_sel GXX TXX V G2 T2' GX TX) in IX2. repeat destruct IX2 as [? IX2]. assert (compat GXX TXX V GX TX TX) as CPX. right. left. eauto. subst. eapply stp2_sel2. eauto. eauto. eauto. eapply IHn. eauto. omega. eauto. eauto. eauto. eapply compat_mem_fwd1. eauto. eauto. eapply IHn; eauto; try omega. eauto. eauto. eauto. eauto. - Case "selx". intros GH0 GH0' GXX TXX T1' T2' V ? CX IX1 IX2 FA. assert (length GH = length GH0 + 1). subst GH. eapply app_length. assert (length GH0 = length GH0') as EL. eapply Forall2_length. eauto. assert (T1' = TSel x1). destruct IX1. ev. eauto. destruct H5. ev. auto. ev. eauto. assert (T2' = TSel x2). destruct IX2. ev. eauto. destruct H6. ev. auto. ev. eauto. subst. eapply stp2_selx. eauto. eauto. - Case "sela1". intros GH0 GH0' GXX TXX T1' T2' V ? CX IX1 IX2 FA. assert (length GH = length GH0 + 1). subst GH. eapply app_length. assert (length GH0 = length GH0') as EL. eapply Forall2_length. eauto. assert (compat GXX TXX V G1 (TSelH x) T1') as IXX. eauto. eapply (compat_selh GXX TXX V G1 T1' GH0 GH0' GX TX) in IX1. repeat destruct IX1 as [? IX1]. destruct IX1. + SCase "x = 0". repeat destruct IXX as [|IXX]; ev. * subst. simpl. eapply stp2_sel1. eauto. eauto. eauto. eapply IHn. eauto. omega. eauto. eauto. right. left. eauto. eapply compat_mem_fwd2. eauto. eauto. eapply IHn; eauto; try omega. * subst. inversion H8. omega. * subst. destruct H8. eauto. + SCase "x > 0". ev. subst. eapply stp2_sela1. eauto. assert (x-1+1=x) as A by omega. remember (x-1) as x1. rewrite <- A in H3. eapply closed_compat. eauto. eapply closed_upgrade_free. eauto. omega. eauto. eapply IHn; eauto. omega. eauto. eapply compat_mem_fwd2. eauto. eapply IHn; eauto; try omega. (* remaining obligations *) + eauto. + subst GH. eauto. + eauto. - Case "selab1". intros GH0 GH0' GXX TXX T1' T2' V ? CX IX1 IX2 FA. assert (length GH = length GH0 + 1). subst GH. eapply app_length. assert (length GH0 = length GH0') as EL. eapply Forall2_length. eauto. assert (compat GXX TXX V G1 (TSelH x) T1') as IXX. eauto. eapply (compat_selh GXX TXX V G1 T1' GH0 GH0' GX TX) in IX1. repeat destruct IX1 as [? IX1]. destruct IX1. + SCase "x = 0". assert (d = 0). admit. (* either we are called with m = 1 (from 2->1) or with m = 2, in which case we can call 2->1 *) subst d. admit. (* TODO! *) (* Do basically what 2->1 does. Create a sel1 node. *) + SCase "x > 0". ev. subst. admit. (* miss case, eapply stp2_selab1 *) (* remaining obligations *) + eauto. + subst GH. eauto. + eauto. - Case "sela2". admit. (* just like sela1 *) - Case "selax". intros GH0 GH0' GXX TXX T1' T2' V ? CX IX1 IX2 FA. assert (length GH = length GH0 + 1). subst GH. eapply app_length. assert (length GH0 = length GH0') as EL. eapply Forall2_length. eauto. assert (compat GXX TXX V G1 (TSelH x) T1') as IXX1. eauto. assert (compat GXX TXX V G2 (TSelH x) T2') as IXX2. eauto. eapply (compat_selh GXX TXX V G1 T1' GH0 GH0' GX TX) in IX1. repeat destruct IX1 as [? IX1]. eapply (compat_selh GXX TXX V G2 T2' GH0 GH0' GX TX) in IX2. repeat destruct IX2 as [? IX2]. assert (not (nosubst (TSelH 0))). unfold not. intros. simpl in H1. eauto. assert (not (closed 0 0 (TSelH 0))). unfold not. intros. inversion H5. omega. destruct x; destruct IX1; ev; try omega; destruct IX2; ev; try omega; subst. + SCase "x = 0". repeat destruct IXX1 as [IXX1|IXX1]; ev; try contradiction. repeat destruct IXX2 as [IXX2|IXX2]; ev; try contradiction. * SSCase "sel-sel". subst. inversion H15. subst. simpl. eapply stp2_selx. eauto. eauto. + SCase "x > 0". destruct IXX1; destruct IXX2; ev; subst; eapply stp2_selax; eauto. (* leftovers *) + eauto. + subst. eauto. + eauto. + eauto. + subst. eauto. + eauto. - Case "all". intros GH0 GH0' GX TX T1' T2' V ? CX IX1 IX2 FA. assert (length GH = length GH0 + 1). subst GH. eapply app_length. assert (length GH0 = length GH0') as EL. eapply Forall2_length. eauto. eapply compat_all in IX1. repeat destruct IX1 as [? IX1]. eapply compat_all in IX2. repeat destruct IX2 as [? IX2]. subst. eapply stp2_all. + eapply IHn. eauto. omega. eauto. eauto. eauto. eauto. eauto. + eauto. + eauto. + subst. eapply IHn. eauto. omega. change ((0, (G1, T0)) :: GH0 ++ [(0, (GX, TX))]) with (((0, (G1, T0)) :: GH0) ++ [(0, (GX, TX))]). reflexivity. eauto. rewrite app_length. simpl. rewrite EL. eauto. rewrite app_length. simpl. rewrite EL. eauto. eapply Forall2_cons. simpl. eauto. eauto. + subst. (* specialize (IHn) with (GH0 := (0, (G2, T4))::GH0). *) eapply IHn. eauto. omega. instantiate (3:= (0, (G2, T4))::GH0). reflexivity. eauto. rewrite app_length. simpl. rewrite EL. eauto. rewrite app_length. simpl. rewrite EL. eauto. eapply Forall2_cons. simpl. eauto. eauto. + eauto. + eauto. subst GH. rewrite <-EL. eapply closed_upgrade_free. eauto. omega. + eauto. + eauto. subst GH. rewrite <-EL. eapply closed_upgrade_free. eauto. omega. - Case "bind". intros GH0 GH0' GX TX T1' T2' V ? CX IX1 IX2 FA. assert (length GH = length GH0 + 1). subst GH. eapply app_length. assert (length GH0 = length GH0') as EL. eapply Forall2_length. eauto. eapply compat_bind in IX1. repeat destruct IX1 as [? IX1]. eapply compat_bind in IX2. repeat destruct IX2 as [? IX2]. subst. eapply stp2_bindb. + eauto. + eauto. + subst. eapply IHn. eauto. omega. change ((0, (G2, open (TSelH (length (GH0 ++ [(0, (GX, TX))]))) T3)) :: GH0 ++ [(0, (GX, TX))]) with (((0, (G2, open (TSelH (length (GH0 ++ [(0, (GX, TX))]))) T3)) :: GH0) ++ [(0, (GX, TX))]). reflexivity. eauto. rewrite app_length. simpl. rewrite EL. eauto. rewrite app_length. simpl. rewrite EL. eauto. eapply Forall2_cons. simpl. eauto. eauto. repeat split. rewrite app_length. simpl. rewrite EL. eapply IX2. eauto. + subst. (* specialize (IHstp2 H2) with (GH1 := (0, (G1, open (TSelH (length (GH0 ++ [(0, (GX, TX))]))) T1))::GH0). *) eapply IHn. eauto. omega. instantiate (3:=(0, (G1, open (TSelH (length (GH0 ++ [(0, (GX, TX))]))) T0))::GH0). reflexivity. eauto. rewrite app_length. simpl. rewrite EL. eauto. rewrite app_length. simpl. rewrite EL. eauto. eapply Forall2_cons. simpl. eauto. eauto. repeat split. rewrite app_length. simpl. rewrite EL. eapply IX1. eauto. + eauto. + eauto. subst GH. fold id. rewrite <- EL. eapply closed_upgrade_free. eauto. unfold id in H5. rewrite app_length. simpl. omega. + eauto. + eauto. subst GH. fold id. rewrite <-EL. eapply closed_upgrade_free. eauto. unfold id in H5. rewrite app_length. simpl. omega. - Case "wrapf". intros. subst. eapply stp2_wrapf. eapply IHn; eauto. omega. - Case "transf". intros. subst. assert (exists vx T3', compat GX TX (Some vx) G1 T1 T1' /\ compat GX TX (Some vx) G2 T2 T2' /\ compat GX TX (Some vx) ((fresh G3,vx)::G3) T3 T3' /\ Forall2 (compat2 GX TX (Some vx)) GH0 GH0'). { (* TODO: If V is None, use vx = vty GX TX. (may need to pass in val_type evidence If V is Some v, use v. However v might never actually be used. In that case, process as with V = None. *) admit. } ev. assert (stp2 (S d) true G1 T1 ((fresh G3,x)::G3) T3 (GH0 ++ [(0, (GX, TX))]) n0) as S1. eapply stp2_extend2; eauto. assert (stp2 (S d) false ((fresh G3,x)::G3) T3 G2 T2 (GH0 ++ [(0, (GX, TX))]) n2) as S2. eapply stp2_extend1; eauto. eapply stp2_transf. eapply IHn. eauto. omega. eauto. eauto. eauto. eauto. eauto. eapply IHn. eauto. omega. eauto. eauto. eauto. eauto. eauto. Qed. Lemma stpd2_substitute: forall m G1 G2 T1 T2 GH, stpd2 m G1 T1 G2 T2 GH -> forall GH0 GH0' GX TX T1' T2' V, GH = (GH0 ++ [(0,(GX, TX))]) -> closed 0 0 TX -> compat GX TX V G1 T1 T1' -> compat GX TX V G2 T2 T2' -> Forall2 (compat2 GX TX V) GH0 GH0' -> stpd2 m G1 T1' G2 T2' GH0'. Proof. intros. repeat eu. eexists. eapply stp2_substitute_aux; eauto. Qed. (* --------------------------------- *) Lemma valtp_closed: forall G v T, val_type G v T -> closed 0 0 T. Proof. intros. inversion H; subst; repeat ev; match goal with [ H : stp2 ?s ?m ?G1 ?T1 G T [] ?n |- _ ] => eapply stp2_closed2 in H; simpl in H; apply H end. Qed. Hint Constructors wf_envh. Lemma stp_to_stp2: forall G1 GH T1 T2, stp G1 GH T1 T2 -> forall GX GY, wf_env GX G1 -> wf_envh GX GY GH -> stpd2 false GX T1 GX T2 GY. Proof with stpd2_wrapf. intros G1 G2 T1 T2 ST. induction ST; intros GX GY WX WY; eapply stpd2_wrapf. - Case "topx". eapply stpd2_topx. - Case "botx". eapply stpd2_botx. - Case "top". eapply stpd2_top. specialize (IHST GX GY WX WY). apply stpd2_reg2 in IHST. apply IHST. - Case "bot". eapply stpd2_bot. specialize (IHST GX GY WX WY). apply stpd2_reg2 in IHST. apply IHST. - Case "bool". eapply stpd2_bool; eauto. - Case "fun". eapply stpd2_fun; eauto. - Case "mem". eapply stpd2_mem; eauto. - Case "sel1". assert (exists v : vl, index x GX = Some v /\ val_type GX v TX) as A. eapply index_safe_ex. eauto. eauto. destruct A as [? [? VT]]. eapply stpd2_sel1. eauto. eauto. eapply valtp_closed; eauto. eauto. specialize (IHST2 GX GY WX WY). apply stpd2_reg2 in IHST2. apply IHST2. - Case "sel2". assert (exists v : vl, index x GX = Some v /\ val_type GX v TX) as A. eapply index_safe_ex. eauto. eauto. destruct A as [? [? VT]]. eapply stpd2_sel2. eauto. eauto. eapply valtp_closed; eauto. eauto. specialize (IHST2 GX GY WX WY). apply stpd2_reg2 in IHST2. apply IHST2. - Case "selb1". assert (exists v : vl, index x GX = Some v /\ val_type GX v TX) as A. eapply index_safe_ex. eauto. eauto. destruct A as [? [? VT]]. eapply stpd2_selb1. eauto. eauto. eapply valtp_closed; eauto. eauto. specialize (IHST2 GX GY WX WY). apply stpd2_reg2 in IHST2. apply IHST2. - Case "selb2". admit. - Case "selx". assert (exists v : vl, index x GX = Some v /\ val_type GX v TX) as A. eapply index_safe_ex. eauto. eauto. ev. eapply stpd2_selx. eauto. eauto. - Case "sela1". eauto. assert (exists v, indexr x GY = Some v /\ valh_type GX GY v TX) as A. eapply index_safeh_ex. eauto. eauto. eauto. destruct A as [? [? VT]]. destruct x0. inversion VT. subst. eapply stpd2_sela1. eauto. eauto. eapply IHST1. eauto. eauto. specialize (IHST2 _ _ WX WY). apply stpd2_reg2 in IHST2. apply IHST2. - Case "sela2". assert (exists v, indexr x GY = Some v /\ valh_type GX GY v TX) as A. eapply index_safeh_ex. eauto. eauto. eauto. destruct A as [? [? VT]]. destruct x0. inversion VT. subst. eapply stpd2_sela2. eauto. eauto. eapply IHST1. eauto. eauto. specialize (IHST2 _ _ WX WY). apply stpd2_reg2 in IHST2. apply IHST2. - Case "selab1". assert (exists v, indexr x GY = Some v /\ valh_type GX GY v TX) as A. eapply index_safeh_ex. eauto. eauto. eauto. destruct A as [? [? VT]]. inversion VT. subst. eapply stpd2_selab1. eauto. eapply IHST1. eauto. econstructor. specialize (IHST2 _ _ WX WY). apply stpd2_reg2 in IHST2. apply IHST2. - Case "selab2". admit. - Case "selax". eauto. assert (exists v, indexr x GY = Some v /\ valh_type GX GY v TX) as A. eapply index_safeh_ex. eauto. eauto. eauto. ev. destruct x0. eapply stpd2_selax. eauto. - Case "all". subst x. assert (length GY = length GH). eapply wfh_length; eauto. eapply stpd2_all. eauto. rewrite H. eauto. rewrite H. eauto. rewrite H. eapply IHST2. eauto. eapply wfeh_cons. eauto. rewrite H. apply IHST3; eauto. - Case "bind". subst x. assert (length GY = length GH). eapply wfh_length; eauto. unfold id in H. eapply stpd2_bind. rewrite H. eauto. rewrite H. eauto. rewrite H. eapply IHST1. eauto. eapply wfeh_cons. eauto. rewrite H. eapply IHST2; eauto. Qed. Lemma invert_abs: forall venv vf T1 T2, val_type venv vf (TFun T1 T2) -> exists env tenv f x y T3 T4, vf = (vabs env f x y) /\ fresh env <= f /\ 1 + f <= x /\ wf_env env tenv /\ has_type ((x,T3)::(f,TFun T3 T4)::tenv) y T4 /\ sstpd2 true venv T1 env T3 [] /\ sstpd2 true env T4 venv T2 []. Proof. intros. inversion H; repeat ev; try solve by inversion. inversion H4. assert (stpd2 false venv0 T1 venv1 T0 []) as E1. eauto. assert (stpd2 false venv1 T3 venv0 T2 []) as E2. eauto. eapply stpd2_upgrade in E1. eapply stpd2_upgrade in E2. repeat eu. repeat eexists; eauto. Qed. Lemma inv_vtp_half: forall G v T GH, val_type G v T -> exists T0, val_type (base v) v T0 /\ closed 0 0 T0 /\ stpd2 false (base v) T0 G T GH. Proof. intros. induction H. - eexists. split; try split. + simpl. econstructor. eassumption. ev. eapply stp2_reg1 in H0. apply H0. + ev. eapply stp2_closed1 in H0. simpl in H0. apply H0. + eapply sstpd2_downgrade. ev. eexists. simpl. eapply stp2_extendH_mult0. eassumption. - eexists. split; try split. + simpl. econstructor. ev. eapply stp2_reg1 in H. apply H. + ev. eapply stp2_closed1 in H. simpl in H. apply H. + eapply sstpd2_downgrade. ev. eexists. simpl. eapply stp2_extendH_mult0. eassumption. - eexists. split; try split. + simpl. econstructor; try eassumption. ev. eapply stp2_reg1 in H3. apply H3. + ev. eapply stp2_closed1 in H3. simpl in H3. apply H3. + eapply sstpd2_downgrade. ev. eexists. simpl. eapply stp2_extendH_mult0. eassumption. - eexists. split; try split. + simpl. subst. econstructor; try eassumption. reflexivity. ev. eapply stp2_reg1 in H1. apply H1. + ev. eapply stp2_closed1 in H2. simpl in H2. apply H2. + eapply sstpd2_downgrade. ev. eexists. simpl. eapply stp2_extendH_mult0. eassumption. - repeat ev. eexists. split; try split; try eassumption. + admit. Qed. Lemma invert_tabs: forall venv vf vx T1 T2, val_type venv vf (TAll T1 T2) -> val_type venv vx T1 -> sstpd2 true venv T2 venv T2 [] -> exists env tenv x y T3 T4, vf = (vtabs env x T3 y) /\ fresh env = x /\ wf_env env tenv /\ has_type ((x,T3)::tenv) y (open (TSel x) T4) /\ sstpd2 true venv T1 env T3 [] /\ sstpd2 true ((x,vx)::env) (open (TSel x) T4) venv T2 []. (* (open T1 T2) []. *) Proof. intros venv0 vf vx T1 T2 VF VX STY. inversion VF; ev; try solve by inversion. inversion H2. subst. eexists. eexists. eexists. eexists. eexists. eexists. repeat split; eauto. remember (fresh venv1) as x. remember (x + fresh venv0) as xx. eapply stpd2_upgrade; eauto. (* -- new goal: result -- *) (* inversion of TAll < TAll *) assert (stpd2 false venv0 T1 venv1 T0 []) as ARG. eauto. assert (stpd2 false venv1 (open (TSelH 0) T3) venv0 (open (TSelH 0) T2) [(0,(venv0, T1))]) as KEY. { eauto. } eapply stpd2_upgrade in ARG. (* need reflexivity *) assert (stpd2 false venv0 T1 venv0 T1 []). eapply stpd2_wrapf. eapply stpd2_reg1. eauto. assert (closed 0 0 T1). eapply stpd2_closed1 in H1. simpl in H1. eauto. (* now rename *) assert (stpd2 false ((fresh venv1,vx) :: venv1) (open_rec 0 (TSel (fresh venv1)) T3) venv0 (T2) []). { (* T2 was open T1 T2 *) (* now that sela1/sela2 can use subtyping, it is better to dispatch on the valtp evidence (instead of the type, as before) *) eapply inv_vtp_half in VX. ev. assert (closed 0 (length ([]:aenv)) T2). eapply sstpd2_closed1; eauto. assert (open (TSelH 0) T2 = T2) as OP2. symmetry. eapply closed_no_open; eauto. eapply stpd2_substitute with (GH0:=nil). eapply stpd2_extend1. eapply stpd2_narrow. eapply H6. eapply KEY. eauto. simpl. eauto. eauto. left. repeat eexists. eapply index_hit2. eauto. eauto. eauto. eauto. rewrite (subst_open_zero 0 1). eauto. eauto. right. left. split. rewrite OP2. eauto. eauto. eauto. } eapply stpd2_upgrade in H4. (* done *) subst. eauto. Qed. (* if not a timeout, then result not stuck and well-typed *) Theorem full_safety : forall n e tenv venv res T, teval n venv e = Some res -> has_type tenv e T -> wf_env venv tenv -> res_type venv res T. Proof. intros n. induction n. (* 0 *) intros. inversion H. (* S n *) intros. destruct e; inversion H. - Case "True". remember (ttrue) as e. induction H0; inversion Heqe; subst. + eapply not_stuck. eapply v_bool; eauto. + eapply restp_widen. eapply IHhas_type; eauto. eapply stpd2_upgrade. eapply stp_to_stp2; eauto. - Case "False". remember (tfalse) as e. induction H0; inversion Heqe; subst. + eapply not_stuck. eapply v_bool; eauto. + eapply restp_widen. eapply IHhas_type; eauto. eapply stpd2_upgrade. eapply stp_to_stp2; eauto. - Case "Var". remember (tvar i) as e. induction H0; inversion Heqe; subst. + destruct (index_safe_ex venv0 env T1 i) as [v [I V]]; eauto. rewrite I. eapply not_stuck. eapply V. + SCase "pack". admit. + SCase "unpack". admit. + eapply restp_widen. eapply IHhas_type; eauto. eapply stpd2_upgrade. eapply stp_to_stp2; eauto. - Case "Typ". remember (ttyp t) as e. induction H0; inversion Heqe; subst. + admit. (* TODO: insert v_pack! *) (*eapply not_stuck. eapply v_pack. eapply v_ty; eauto. eapply stpd2_upgrade. eapply stp_to_stp2; eauto. econstructor. *) + eapply restp_widen. eapply IHhas_type; eauto. eapply stpd2_upgrade. eapply stp_to_stp2; eauto. - Case "App". remember (tapp e1 e2) as e. induction H0; inversion Heqe; subst. + remember (teval n venv0 e1) as tf. remember (teval n venv0 e2) as tx. destruct tx as [rx|]; try solve by inversion. assert (res_type venv0 rx T1) as HRX. SCase "HRX". subst. eapply IHn; eauto. inversion HRX as [? vx]. destruct tf as [rf|]; subst rx; try solve by inversion. assert (res_type venv0 rf (TFun T1 T2)) as HRF. SCase "HRF". subst. eapply IHn; eauto. inversion HRF as [? vf]. destruct (invert_abs venv0 vf T1 T2) as [env1 [tenv [f0 [x0 [y0 [T3 [T4 [EF [FRF [FRX [WF [HTY [STX STY]]]]]]]]]]]]]. eauto. (* now we know it's a closure, and we have has_type evidence *) assert (res_type ((x0,vx)::(f0,vf)::env1) res T4) as HRY. SCase "HRY". subst. eapply IHn. eauto. eauto. (* wf_env f x *) econstructor. eapply valtp_widen; eauto. eapply sstpd2_extend2. eapply sstpd2_extend2. eauto. eauto. eauto. (* wf_env f *) econstructor. eapply v_abs; eauto. eapply sstpd2_extend2. eapply sstpd2_downgrade in STX. eapply sstpd2_downgrade in STY. repeat eu. assert (stpd2 false env1 T3 env1 T3 []) as A3. { eapply stpd2_wrapf. eapply stpd2_reg2. eauto. } inversion A3 as [na3 HA3]. assert (stpd2 false env1 T4 env1 T4 []) as A4 by solve [eapply stpd2_wrapf; eapply stpd2_reg1; eauto]. inversion A4 as [na4 HA4]. eexists. eapply stp2_fun. eassumption. eassumption. eauto. eauto. (* TODO: sstpd2_fun constructor *) inversion HRY as [? vy]. eapply not_stuck. eapply valtp_widen; eauto. eapply sstpd2_extend1. eapply sstpd2_extend1. eauto. eauto. eauto. + eapply restp_widen. eapply IHhas_type; eauto. eapply stpd2_upgrade. eapply stp_to_stp2; eauto. - Case "Abs". remember (tabs i i0 e) as xe. induction H0; inversion Heqxe; subst. + eapply not_stuck. eapply v_abs; eauto. rewrite (wf_fresh venv0 env H1). eauto. eapply stpd2_upgrade. eapply stp_to_stp2. eauto. eauto. econstructor. + eapply restp_widen. eapply IHhas_type; eauto. eapply stpd2_upgrade. eapply stp_to_stp2; eauto. - Case "TApp". remember (ttapp e1 e2) as e. induction H0; inversion Heqe; subst. + remember (teval n venv0 e1) as tf. remember (teval n venv0 e2) as tx. destruct tx as [rx|]; try solve by inversion. assert (res_type venv0 rx T11) as HRX. SCase "HRX". subst. eapply IHn; eauto. inversion HRX as [? vx]. subst rx. destruct tf as [rf|]; try solve by inversion. assert (res_type venv0 rf (TAll T11 T12)) as HRF. SCase "HRF". subst. eapply IHn; eauto. inversion HRF as [? vf]. destruct (invert_tabs venv0 vf vx T11 T12) as [env1 [tenv [x0 [y0 [T3 [T4 [EF [FRX [WF [HTY [STX STY]]]]]]]]]]]. eauto. eauto. eapply stpd2_upgrade. eapply stp_to_stp2; eauto. (* now we know it's a closure, and we have has_type evidence *) assert (res_type ((x0,vx)::env1) res (open (TSel x0) T4)) as HRY. SCase "HRY". subst. eapply IHn. eauto. eauto. (* wf_env x *) econstructor. eapply valtp_widen; eauto. eapply sstpd2_extend2. eauto. eauto. eauto. inversion HRY as [? vy]. eapply not_stuck. eapply valtp_widen. eauto. eauto. + eapply restp_widen. eapply IHhas_type; eauto. eapply stpd2_upgrade. eapply stp_to_stp2; eauto. - Case "TAbs". remember (ttabs i t e) as xe. induction H0; inversion Heqxe; subst. + eapply not_stuck. eapply v_tabs; eauto. subst i. eauto. rewrite (wf_fresh venv0 env H1). eauto. eapply stpd2_upgrade. eapply stp_to_stp2. eauto. eauto. econstructor. + eapply restp_widen. eapply IHhas_type; eauto. eapply stpd2_upgrade. eapply stp_to_stp2; eauto. Grab Existential Variables. apply 0. apply 0. Qed. End FSUB.
From mathcomp Require Import ssreflect ssrbool ssrnat eqtype ssrfun seq. From fcsl Require Import pred. From scilla Require Import Automata2. From scilla Require Import options. Section Crowdfunding. (* Encoding of the Crowdfunding contract from the Scilla whitepaper *) (****************************************************** contract Crowdfunding (owner : address, max_block : uint, goal : uint) (* Mutable state description *) { backers : address => uint = []; funded : boolean = false; } (* Transition 1: Donating money *) transition Donate (sender : address, value : uint, tag : string) (* Simple filter identifying this transition *) if tag == "donate" => bs <- & backers; blk <- && block_number; let nxt_block = blk + 1 in if max_block <= nxt_block then send (<to -> sender, amount -> 0, tag -> main, msg -> "deadline_passed">, MT) else if not (contains(bs, sender)) then let bs1 = put(sbs, ender, value) in backers := bs1; send (<to -> sender, amount -> 0, tag -> "main", msg -> "ok">, MT) else send (<to -> sender, amount -> 0, tag -> "main", msg -> "already_donated">, MT) (* Transition 2: Sending the funds to the owner *) transition GetFunds (sender : address, value : uint, tag : string) (* Only the owner can get the money back *) if (tag == "getfunds") && (sender == owner) => blk <- && block_number; bal <- & balance; if max_block < blk then if goal <= bal then funded := true; send (<to -> owner, amount -> bal, tag -> "main", msg -> "funded">, MT) else send (<to -> owner, amount -> 0, tag -> "main", msg -> "failed">, MT) else send (<to -> owner, amount -> 0, tag -> "main", msg -> "too_early_to_claim_funds">, MT) (* Transition 3: Reclaim funds by a backer *) transition Claim (sender : address, value : uint, tag : string) if tag == "claim" => blk <- && block_number; if blk <= max_block then send (<to -> sender, amount -> 0, tag -> "main", msg -> "too_early_to_reclaim">, MT) else bs <- & backers; bal <- & balance; if (not (contains(bs, sender))) || funded || goal <= bal then send (<to -> sender, amount -> 0, tag -> "main", msg -> "cannot_refund">, MT) else let v = get(bs, sender) in backers := remove(bs, sender); send (<to -> sender, amount -> v, tag -> "main", msg -> "here_is_your_money">, MT) *******************************************************) Record crowdState := CS { owner_mb_goal : address * nat * value; backers : seq (address * value); funded : bool; }. (* Administrative setters/getters *) Definition get_owner cs : address := (owner_mb_goal cs).1.1. Definition get_goal cs : value := (owner_mb_goal cs).2. Definition get_max_block cs : nat := (owner_mb_goal cs).1.2. Definition set_backers cs bs : crowdState := CS (owner_mb_goal cs) bs (funded cs). Definition set_funded cs f : crowdState := CS (owner_mb_goal cs) (backers cs) f. (* Parameters *) Variable init_owner : address. Variable init_max_block : nat. Variable init_goal : value. (* Initial state *) Definition init_state := CS (init_owner, init_max_block, init_max_block) [::] false. (*********************************************************) (********************* Transitions ***********************) (*********************************************************) (* Transition 1 *) (* transition Donate (sender : address, value : uint, tag : string) (* Simple filter identifying this transition *) if tag == "donate" => bs <- & backers; blk <- && block_number; let nxt_block = blk + 1 in if max_block <= nxt_block then send (<to -> sender, amount -> 0, tag -> main, msg -> "deadline_passed">, MT) else if not (contains(bs, sender)) then let bs1 = put(sbs, ender, value) in backers := bs1; send (<to -> sender, amount -> 0, tag -> "main", msg -> "ok">, MT) else send (<to -> sender, amount -> 0, tag -> "main", msg -> "already_donated">, MT) *) (* Definition of the protocol *) Variable crowd_addr : address. Notation tft := (trans_fun_type crowdState). Definition ok_msg := [:: (0, [:: 1])]. Definition no_msg := [:: (0, [:: 0])]. Definition donate_tag := 1. Definition donate_fun : tft := fun id bal s m bc => if method m == donate_tag then let bs := backers s in let nxt_block := block_num bc + 1 in let from := sender m in if get_max_block s <= nxt_block then (s, Some (Msg 0 crowd_addr from 0 no_msg)) else if all [pred e | e.1 != from] bs (* new backer *) then let bs' := (from, val m) :: bs in let s' := set_backers s bs' in (s', Some (Msg 0 crowd_addr from 0 ok_msg)) else (s, Some (Msg 0 crowd_addr from 0 no_msg)) else (s, None). Definition donate := CTrans donate_tag donate_fun. (* Transition 2: Sending the funds to the owner *) (* transition GetFunds (sender : address, value : uint, tag : string) (* Only the owner can get the money back *) if (tag == "getfunds") && (sender == owner) => blk <- && block_number; bal <- & balance; if max_block < blk then if goal <= bal then funded := true; send (<to -> owner, amount -> bal, tag -> "main", msg -> "funded">, MT) else send (<to -> owner, amount -> 0, tag -> "main", msg -> "failed">, MT) else send (<to -> owner, amount -> 0, tag -> "main", msg -> "too_early_to_claim_funds">, MT) *) Definition getfunds_tag := 2. Definition getfunds_fun : tft := fun id bal s m bc => let: from := sender m in if (method m == getfunds_tag) && (from == (get_owner s)) then let blk := block_num bc + 1 in if (get_max_block s < blk) then if get_goal s <= bal then let s' := set_funded s true in (s', Some (Msg bal crowd_addr from 0 ok_msg)) else (s, Some (Msg 0 crowd_addr from 0 no_msg)) else (s, Some (Msg 0 crowd_addr from 0 no_msg)) else (s, None). Definition get_funds := CTrans getfunds_tag getfunds_fun. (* Transition 3: Reclaim funds by a backer *) (* transition Claim (sender : address, value : uint, tag : string) if tag == "claim" => blk <- && block_number; if blk <= max_block then send (<to -> sender, amount -> 0, tag -> "main", msg -> "too_early_to_reclaim">, MT) else bs <- & backers; bal <- & balance; if (not (contains(bs, sender))) || funded || goal <= bal then send (<to -> sender, amount -> 0, tag -> "main", msg -> "cannot_refund">, MT) else let v = get(bs, sender) in backers := remove(bs, sender); send (<to -> sender, amount -> v, tag -> "main", msg -> "here_is_your_money">, MT) *) Definition claim_tag := 3. Definition claim_fun : tft := fun id bal s m bc => let: from := sender m in if method m == claim_tag then let blk := block_num bc in if blk <= get_max_block s then (* Too early! *) (s, Some (Msg 0 crowd_addr from 0 no_msg)) else let bs := backers s in if [|| funded s | get_goal s <= bal] (* Cannot reimburse: campaign suceeded *) then (s, Some (Msg 0 crowd_addr from 0 no_msg)) else let n := seq.find [pred e | e.1 == from] bs in if n < size bs then let v := nth 0 (map snd bs) n in let bs' := filter [pred e | e.1 != from] bs in let s' := set_backers s bs' in (s', Some (Msg v crowd_addr from 0 ok_msg)) else (* Didn't back or already claimed *) (s, None) else (s, None). Definition claim := CTrans claim_tag claim_fun. Program Definition crowd_prot : Protocol crowdState := @CProt _ crowd_addr 0 init_state [:: donate; get_funds; claim] _. Lemma crowd_tags : tags crowd_prot = [:: 1; 2; 3]. Proof. by []. Qed. Lemma find_leq {A : eqType} (p : pred (A * nat)) (bs : seq (A * nat)) : nth 0 [seq i.2 | i <- bs] (seq.find p bs) <= sumn [seq i.2 | i <- bs]. Proof. elim: bs=>//[[a w]]bs/=Gi; case:ifP=>_/=; first by rewrite leq_addr. by rewrite (leq_trans Gi (leq_addl w _)). Qed. (***********************************************************) (** Correctness properties **) (***********************************************************) (************************************************************************ 1. The contract always has sufficient balance to reimburse everyone, unless it's successfully finished its campaign: The "funded" flag is set only if the campaign goals were reached, then all money goes to owner. Otherwise, the contract keeps all its money intact. Perhaps, we should make it stronger, adding a temporal property that one's reimbursement doesn't change. ************************************************************************) Definition balance_backed (st: cstate crowdState) : Prop := (* If the campaign not funded... *) ~~ (funded (state st)) -> (* the contract has enough funds to reimburse everyone. *) sumn (map snd (backers (state st))) <= balance st. Lemma sufficient_funds_safe : safe crowd_prot balance_backed. Proof. apply: safe_ind=>[|[id bal s]bc m M Hi]//. rewrite crowd_tags !inE in M. (* Get the exact transitions and start struggling... *) rewrite /= /apply_prot; case/orP: M; [|case/orP]=>/eqP M; rewrite M/=. (* Donate transition *) rewrite /donate_fun M eqxx. case: ifP=>/=_; [move=> {}/Hi Hi|]. - by rewrite subn0; apply: (leq_trans Hi (leq_addr (val m) bal)). case: ifP=>/=_; move=> {}/Hi Hi; last first. - by rewrite subn0; apply: (leq_trans Hi (leq_addr (val m) bal)). by rewrite subn0 /balance_backed/= in Hi *; rewrite addnC leq_add2r. (* Get funds transition. *) rewrite /getfunds_fun M eqxx. case: ifP=>//=_; case:ifP=>//=_;[|move=> {}/Hi Hi]; last first. - by rewrite subn0; apply: (leq_trans Hi (leq_addr (val m) bal)). case: ifP=>//=_; move=> {}/Hi Hi. by rewrite subn0; apply: (leq_trans Hi (leq_addr (val m) bal)). (* Claim funds back *) rewrite /claim_fun M eqxx. case: ifP=>//=_; [move=> {}/Hi Hi|]. - by rewrite subn0; apply: (leq_trans Hi (leq_addr (val m) bal)). case: ifP=>//=X. - case/orP: X; first by rewrite /balance_backed/==>->. by move=>_/Hi Z; rewrite subn0; apply: (leq_trans Z (leq_addr (val m) bal)). case: ifP=>//=G/=; move=> {}/Hi /= Hi. rewrite addnC. have H1: nth 0 [seq i.2 | i <- backers s] (seq.find [pred e | e.1 == sender m] (backers s)) <= sumn [seq i.2 | i <- backers s] by apply: find_leq. move: (leq_trans H1 Hi)=> H2. rewrite -(addnBA _ H2); clear H2. suff H3: sumn [seq i.2 | i <- backers s & [pred e | e.1 != sender m] i] <= bal - nth 0 [seq i.2 | i <- backers s] (seq.find [pred e | e.1 == sender m] (backers s)). - by apply: (leq_trans H3 (leq_addl (val m) _ )). clear M. suff H2: sumn [seq i.2 | i <- backers s & [pred e | e.1 != sender m] i] <= sumn [seq i.2 | i <- backers s] - nth 0 [seq i.2 | i <- backers s] (seq.find [pred e | e.1 == sender m] (backers s)). - by apply: (leq_trans H2); apply: leq_sub. clear Hi H1 X G bc bal id crowd_addr init_goal init_max_block init_owner. move: (backers s)=>bs{s}. elim:bs=>//[[a v]] bs/= Hi/=; case:ifP; last first. - move/negbT; case: ifP=>//= _ _; rewrite addnC -addnBA//subnn addn0. clear Hi; elim: bs=>//={a v}[[a v]]bs/=. case:ifP=>//=_ H; first by rewrite leq_add2l. by rewrite (leq_trans H (leq_addl _ _)). move/negbTE=>->/={a}; rewrite -(leq_add2l v) in Hi. by rewrite addnBA in Hi; last by apply: find_leq. Qed. (***********************************************************************) (****** Proving temporal properties ******) (***********************************************************************) (* Contribution of backer b is d is recorded in the `backers` *) Definition donated b (d : value) st := (filter [pred e | e.1 == b] (backers (state st))) == [:: (b, d)]. (* b doesn't claim its funding back *) Definition no_claims_from b (q : bstate * message) := sender q.2 != b. (************************************************************************ 2. The following lemma shows that the donation record is going to be preserved by the protocol since the moment it's been contributed, as long, as no messages from the corresponding backer b is sent to the contract. This guarantees that the contract doesn't "drop" the record about someone's donations. In conjunctions with sufficient_funds_safe (proved above) this guarantees that, if the campaign isn't funded, there is always a necessary amount on the balance to reimburse each backer, in the case of failure of the campaign. ************************************************************************) Lemma donation_preserved (b : address) (d : value): since_as_long crowd_prot (donated b d) (fun _ s' => donated b d s') (no_claims_from b). Proof. (* This is where we would need a temporal logic, but, well.. *) (* Let's prove it out of the definition. *) elim=>[|[bc m] sc Hi]st st' P R; first by rewrite /reachable'=>/=Z; subst st'. rewrite /reachable'/==>E. apply: (Hi (post (step_prot crowd_prot st bc m))); last 2 first; clear Hi. - by move=>q; move:(R q)=>{R}-R G; apply: R; apply/In_cons; right. - rewrite E; set st1 := (step_prot crowd_prot st bc m); clear E R P. by case: sc st1=>//=[[bc' m']] sc st1/=. clear E. have N: sender m != b. - suff B: no_claims_from b (bc, m) by []. by apply: R; apply/In_cons; left. case M: (method m \in tags crowd_prot); last first. - by move/negbT: M=>M; rewrite (bad_tag_step bc st M). case: st P=>id a s; rewrite /donated/==>D. case/orP: M; [|case/orP;[| rewrite orbC]]=>/eqP T; rewrite /apply_prot T/=. - rewrite /donate_fun T/=; case: ifP=>//_; case: ifP=>//_/=. by move/negbTE: N=>->. - by rewrite /getfunds_fun T/=; case: ifP=>//_; case: ifP=>//_; case:ifP. rewrite /claim_fun T/=; case:ifP=>//_; case: ifP=>//_; case: ifP=>//=X. rewrite -filter_predI/=; move/eqP:D=><-; apply/eqP. elim: (backers s)=>//=x xs Hi; rewrite Hi; clear Hi. case B: (x.1 == b)=>//=. by move/eqP: B=>?; subst b; move/negbTE: N; rewrite eq_sym=>/negbT=>->. Qed. (************************************************************************ 3. The final property: if the campaign has failed (goal hasn't been reached and the deadline has passed), every registered backer can get its donation back. TODO: formulate and prove it. ************************************************************************) Lemma can_claim_back b d st bc: (* We have donated, so the contract holds that state *) donated b d st -> (* Not funded *) ~~(funded (state st)) -> (* Balance is small: not reached the goal *) balance st < (get_goal (state st)) -> (* Block number exceeds the set number *) get_max_block (state st) < block_num bc -> (* Can emit message from b *) exists (m : message), sender m == b /\ out (step_prot crowd_prot st bc m) = Some (Msg d crowd_addr b 0 ok_msg). Proof. move=>D Nf Nb Nm. exists (Msg 0 b crowd_addr claim_tag [::]); split=>//. rewrite /step_prot. case: st D Nf Nb Nm =>id bal s/= D Nf Nb Nm. rewrite /apply_prot/=/claim_fun/=leqNgt Nm/= leqNgt Nb/=. rewrite /donated/= in D. move/negbTE: Nf=>->/=; rewrite -(has_find [pred e | e.1 == b]) has_filter. move/eqP: D=>D; rewrite D/=. congr (Some _); congr (Msg _ _ _ _ _). elim: (backers s) D=>//[[a w]]bs/=; case:ifP; first by move/eqP=>->{a}/=_; case. by move=>X Hi H; move/Hi: H=><-. Qed. (************************************************************************ 4. Can we have a logic that allows to express all these properties declaratively? Perhaps, we could do it in TLA? (This is going to be our future work.) ************************************************************************) End Crowdfunding.
! Solves for the new precursor solution vector ! with backward Euler time integration ! Input: ! ! Output: ! subroutine solve_precursor_backward_euler(isotope,delay_group,n, nl_iter ) USE flags_M USE material_info_M USE mesh_info_M USE time_info_M USE global_parameters_M USE solution_vectors_M USE element_matrices_M USE parameters_fe use Mod_GlobalConstants use Mod_SetupOutputFiles implicit none !---Dummy integer,intent(in) :: isotope integer,intent(in) :: delay_group integer,intent(in) :: nl_iter integer,intent(in) :: n !---Local integer :: i,j,f,g real(dp), dimension(3) :: A_inv_times_RHS A_inv_times_RHS(:) = 0.0 !---Multiply A^{-1}*f(u) ! do i = 1, nodes_per_elem ! do j =1, nodes_per_elem ! A_inv_times_RHS(i) = A_inv_times_RHS(i) + & ! inverse_A_matrix(i,j)*RHS_transient_final_vec(j) ! end do ! end do !---Solve for new precursor at delta t if(td_method_type == 0) then do i = 1, nodes_per_elem precursor_soln_new(isotope,delay_group, n,i) = & precursor_soln_prev(isotope, delay_group, n,i) + & delta_t*(H_times_soln_vec(i) + & (allPrecursorData(isotope) % groupBeta(delay_group)/gen_time)*elem_vec_A_times_q(i) + & A_times_W_times_upwind_elem_vec(i)) ! !---test to make sure values are not too small !if(precursor_soln_new(isotope, delay_group, n, i) < 1E-16_dp) then ! precursor_soln_new(isotope, delay_group, n, i) = 0.0 !end if end do end if if(td_method_type == 1) then do i = 1, nodes_per_elem precursor_soln_new(isotope,delay_group, n,i) = & precursor_soln_last_time(isotope, delay_group, n,i) + & delta_t*(H_times_soln_vec(i) + & (allPrecursorData(isotope) % groupBeta(delay_group)/gen_time)*elem_vec_A_times_q(i) + & A_times_W_times_upwind_elem_vec(i)) !---test to make sure values are not too small !if(precursor_soln_new(isotope, delay_group, n, i) < 1E-8_dp) then ! precursor_soln_new(isotope, delay_group, n, i) = 0.0 !end if end do end if !---End precursor solve !---Null transient unit test if( reactivity_input == 0.0) then !---Make sure change in the solution is zero for null transient do i = 1, nodes_per_elem if(A_inv_times_RHS(i) > 0.0) then !write(outfile_unit, fmt='(a)'), 'FAILING NULL TRANSIENT TEST' end if end do end if !************************************* if (DEBUG .eqv. .TRUE.) then !---Write out solution for current element write(outfile_unit,fmt='(a,1I6,a,1I6)'),'Previous Solution | element --> ',& n, ' Group -->',delay_group do j=1,nodes_per_elem write(outfile_unit,fmt='(a,1I6,f16.3)'), 'Node -->', & conn_matrix(n,j), precursor_soln_prev(isotope, delay_group,n,j) end do write(outfile_unit,fmt='(a)'), ' ' write(outfile_unit,fmt='(a,1I6,a,1I6)'),'New Solution | element --> ', & n, ' Group -->',delay_group do j=1,nodes_per_elem write(outfile_unit,fmt='(a,1I6,f16.3)'), 'Node -->', & conn_matrix(n,j), precursor_soln_new(isotope, delay_group,n,j) end do write(outfile_unit,fmt='(a)'), '********************************' end if end subroutine solve_precursor_backward_euler
using LinQu, LinearAlgebra, Test, Random include("extension_test.jl") include("interface_test.jl") include("qstates_test.jl") include("toffoli_test.jl") include("block_test.jl")
-- There was a bug where constructors of private datatypes were -- not made private. module Issue484 where module A where private data Foo : Set where foo : Foo foo′ = A.foo
r=0.55 https://sandbox.dams.library.ucdavis.edu/fcrepo/rest/collection/sherry-lehmann/catalogs/d7h59w/media/images/d7h59w-020/svc:tesseract/full/full/0.55/default.jpg Accept:application/hocr+xml
from __future__ import print_function, absolute_import, unicode_literals, division from nltk import word_tokenize import nltk from tabulate import tabulate from sklearn.metrics import accuracy_score, f1_score, recall_score, precision_score from collections import OrderedDict import json from scipy import stats from nltk.stem.porter import * import numpy as np import seaborn as sns import matplotlib.pyplot as plt import matplotlib.style as style import matplotlib.cm as cm sns.set_context('talk') class color: PURPLE = '\033[95m' CYAN = '\033[96m' DARKCYAN = '\033[36m' BLUE = '\033[94m' GREEN = '\033[92m' YELLOW = '\033[93m' RED = '\033[91m' BOLD = '\033[1m' UNDERLINE = '\033[4m' END = '\033[0m' def get_relative_increase(old, new): print(100.0 * (new - old) / old) def get_ttest_significance(results_method1, results_method2): if type(results_method1) == np.ndarray: results_method1 = results_method1.tolist() if type(results_method2) == np.ndarray: results_method2 = results_method2.tolist() # verify is list is nested + flatten it if it is if any(isinstance(i, list) for i in results_method1): results_method1 = [item for sublist in results_method1 for item in sublist] if any(isinstance(i, list) for i in results_method2): results_method2 = [item for sublist in results_method2 for item in sublist] results_method1 = map(int, results_method1) results_method2 = map(int, results_method2) # print(results_method1, results_method2) print(stats.ttest_rel(results_method1, results_method2)) def get_list_actions_for_label(dict_video_actions, miniclip, label_type): list_type_actions = [] list_action_labels = dict_video_actions[miniclip] for [action, label] in list_action_labels: if label == label_type: list_type_actions.append(action) return list_type_actions def get_nb_visible_not_visible(dict_video_actions): nb_visible_actions = 0 nb_not_visible_actions = 0 for miniclip in dict_video_actions.keys(): nb_visible_actions += len(get_list_actions_for_label(dict_video_actions, miniclip, 0)) nb_not_visible_actions += len(get_list_actions_for_label(dict_video_actions, miniclip, 1)) return nb_visible_actions, nb_not_visible_actions def calculate_metrics(dict_results): dict_results_method = {} for method in dict_results.keys(): print(color.UNDERLINE + "Results for " + color.PURPLE + color.BOLD + method + color.END) test_accuracy = [] train_accuracy = [] val_accuracy = [] test_precision = [] test_recall = [] test_f1 = [] for results in dict_results[method]: [acc_train, acc_val, acc_test, recall, precision, f1] = results test_accuracy.append(acc_test) train_accuracy.append(acc_train) val_accuracy.append(acc_val) test_precision.append(precision) test_recall.append(recall) test_f1.append(f1) n_repeats = len(dict_results[method]) mean_test_accuracy = sum(test_accuracy) / float(n_repeats) mean_train_accuracy = sum(train_accuracy) / float(n_repeats) mean_val_accuracy = sum(val_accuracy) / float(n_repeats) mean_test_recall = sum(test_recall) / float(n_repeats) mean_test_precision = sum(test_precision) / float(n_repeats) mean_test_f1 = sum(test_f1) / float(n_repeats) standard_error = np.std(test_accuracy) / np.sqrt(np.ma.count(test_accuracy)) interval = standard_error * 1.96 # the interval of 95% is (1.96 * standard_error) around the mean results. lower_interval = mean_test_accuracy - interval upper_interval = mean_test_accuracy + interval create_table(['Mean Test Acc', 'Std error', 'Lower interval', 'Upper interval'], [[mean_test_accuracy, standard_error, lower_interval, upper_interval]]) dict_results_method[method] = [[mean_train_accuracy, mean_val_accuracy, mean_test_accuracy, mean_test_recall, mean_test_precision, mean_test_f1, standard_error, lower_interval, upper_interval]] return dict_results_method def calculate_significance_between_2models(dict_mean_results_method): model1 = dict_mean_results_method.keys()[0] model2 = dict_mean_results_method.keys()[1] [[_, _, _, _, _, _, _, lower_interval1, upper_interval1]] = dict_mean_results_method[ model1] [[_, _, _, _, _, _, _, lower_interval2, upper_interval2]] = dict_mean_results_method[ model2] if lower_interval1 <= upper_interval2 and lower_interval2 <= upper_interval1: # intervals overlap print( "Models " + color.PURPLE + color.BOLD + model1 + color.END + " and " + color.PURPLE + color.BOLD + model2 + color.END + " are NOT significantly different") else: print( "Models " + color.BLUE + color.BOLD + model1 + color.END + " and " + color.BLUE + color.BOLD + model2 + color.END + " are significantly different") def print_scores_per_method(dict_results): headers = ['Method', 'Train Accuracy', 'Val Accuracy', 'Test Accuracy', 'Test Recall', 'Test Precision', 'Test F1'] list_results = [] for method in dict_results.keys(): for results in dict_results[method]: if len(results) == 6: [acc_train, acc_val, acc_test, recall, precision, f1] = results else: [acc_train, acc_val, acc_test, recall, precision, f1, _, _, _] = results list_results.append([method, acc_train, acc_val, acc_test, recall, precision, f1]) create_table(headers, list_results) def print_t_test_significance(dict_significance): method1 = dict_significance.keys()[0] method2 = dict_significance.keys()[1] print("T-test Significance for {0} and {1}:".format(method1, method2)) predicted_method1 = dict_significance[method1] predicted_method2 = dict_significance[method2] get_ttest_significance(predicted_method1, predicted_method2) def group_action_by_verb(unique_visibile_actions): lemma = nltk.wordnet.WordNetLemmatizer() stemmer = PorterStemmer() dict_verb_actions = {} for action in unique_visibile_actions: tokens = word_tokenize(action) pos_text = nltk.pos_tag(tokens) for (word, pos) in pos_text: if 'VB' in pos: word = lemma.lemmatize(word) if word in ['i', 'oh', 'red', 'bed']: continue if word[-3:] == 'ing': word = stemmer.stem(word) if word == 'ad': word = 'add' if word == 'drizzl': word = 'drizzle' if word == 'tri': word = 'try' if word == 'saut': word = 'saute' if word == 'cooked': word = 'cook' if word == 'fri': word = 'fry' if word == 'danc': word = 'dance' if word == 'hydrat': word = 'hydrate' if word not in dict_verb_actions.keys(): dict_verb_actions[word] = [] dict_verb_actions[word].append(action) ordered_d = OrderedDict(sorted(dict_verb_actions.viewitems(), key=lambda x: len(x[1]))) with open("data/dict_verb_actions.json", 'w') as f: json.dump(ordered_d, f) print("For visibile actions, nb of different verbs: {0}".format(len(ordered_d.keys()))) def find_miniclip_by_not_visible_action(dict_video_actions, label_type, action_to_search): list_miniclips = [] for miniclip in dict_video_actions.keys(): list_action_labels = dict_video_actions[miniclip] for [action, label] in list_action_labels: if label == label_type and action == action_to_search: list_miniclips.append(miniclip) continue return list_miniclips def measure_nb_unique_actions(dict_video_actions): all_visibile_actions = [] all_not_visibile_actions = [] for miniclip in dict_video_actions.keys(): visibile_actions = get_list_actions_for_label(dict_video_actions, miniclip, 0) not_visibile_actions = get_list_actions_for_label(dict_video_actions, miniclip, 1) all_visibile_actions = all_visibile_actions + visibile_actions all_not_visibile_actions = all_not_visibile_actions + not_visibile_actions for action in all_visibile_actions: if action in all_not_visibile_actions: # print (action) visibile_in_miniclips = find_miniclip_by_not_visible_action(dict_video_actions, 0, action) not_visibile_in_miniclips = find_miniclip_by_not_visible_action(dict_video_actions, 1, action) both_miniclips_visibile_not_visibile = set(visibile_in_miniclips).intersection( set(not_visibile_in_miniclips)) # if len(both_miniclips_visibile_not_visibile): # print(action) # print ("visible and not in miniclips: %", both_miniclips_visibile_not_visibile) # print ("visible in miniclips: %", visibile_in_miniclips) # print ("not visible in miniclips: %", not_visibile_in_miniclips) unique_all_actions = set(all_not_visibile_actions + all_visibile_actions) unique_visibile_actions = set(all_visibile_actions) unique_not_visibile_actions = set(all_not_visibile_actions) group_action_by_verb(unique_visibile_actions) # for visibile_action in all_visibile_actions: # print(visibile_action) both_visibile_not_visibile = unique_not_visibile_actions.intersection(unique_visibile_actions) # print(both_visibile_not_visibile) print("Number unique visible actions that can be not-visibile: {0}".format(len(both_visibile_not_visibile))) print("Number unique visible actions: {0}, not visibile: {1}, both: {2}".format(len(unique_visibile_actions), len(unique_not_visibile_actions), len(unique_all_actions))) def print_nb_actions_miniclips_train_test_eval(dict_train_data, dict_test_data, dict_val_data): nb_train_actions_visible, nb_train_actions_not_visible = get_nb_visible_not_visible(dict_train_data) nb_train_actions = nb_train_actions_visible + nb_train_actions_not_visible nb_test_actions_visible, nb_test_actions_not_visible = get_nb_visible_not_visible(dict_test_data) nb_test_actions = nb_test_actions_visible + nb_test_actions_not_visible nb_val_actions_visible, nb_val_actions_not_visible = get_nb_visible_not_visible(dict_val_data) nb_val_actions = nb_val_actions_visible + nb_val_actions_not_visible print(tabulate([['nb_actions', nb_train_actions, nb_test_actions, nb_val_actions], ['nb_miniclips', len(dict_train_data.keys()), len(dict_test_data.keys()), len(dict_val_data.keys())]], headers=['', 'Train', 'Test', 'Eval'], tablefmt='grid')) def call_print(balance, before_balance, string_to_print): if before_balance: string_to_print = "# --- Before Balance: " + str(string_to_print) if balance == "upsample": string_to_print = "# --- After upsample: " + str(string_to_print) elif balance == "downsample": string_to_print = "# --- After downsample: " + str(string_to_print) return string_to_print def print_bar_plots(): # set width of bar barWidth = 0.15 # set height of bar bars6 = [65.4] # yolo bars7 = [71.2] # concreteness bars1 = [74.5, 75.5, 76.7] # action # bars1 = [74.5, 75.5, 76.7, 76.1] # action bars0 = [76.1] bars2 = [73.0, 74.6, 75.7, 75.8] # action + pos bars3 = [75.2, 75.7, 75.9, 76.1] # action + context bars4 = [74.7, 75.4, 75.6, 75.9] # action + concreteness bars5 = [74.3, 74.4, 75.6, 76.4] # action + all error6 = [1.7]# yolo error7 = [2.6]# concreteness error1 = [2.1, 1.4, 1.6] # action error0 = [1.8] error2 = [2.4, 1.6, 1.7, 1.4] # action + pos error3 = [2.2, 1.7, 1.9, 1.7] # action + context error4 = [2.1, 1.4, 1.6, 1.5] # action + concreteness error5 = [2.2, 1.4, 1.6, 1.5] # action + all # Set position of bar on X axis r1 = np.arange(len(bars1)) rr = np.arange(len(bars1) + 1) r2 = [x + barWidth for x in rr] r3 = [x + barWidth for x in r2] r4 = [x + barWidth for x in r3] r5 = [x + barWidth for x in r4] r6 = [r5[-1] + 2 * barWidth] r7 = [r6[-1] + barWidth] r0 = [r1[-1] + 6.7 * barWidth] # Make the plot plt.axhline(y=71.1, color='black', linestyle='--') x = np.arange(8) ys = [i + x + (i * x) ** 2 for i in range(8)] colors = cm.rainbow(np.linspace(0, 1, len(ys))) plt.bar(r1, bars1, yerr=error1, color=colors[0], width=barWidth, edgecolor='white',capsize=10, label='Action') plt.bar(r0, bars0, yerr=error0, color=colors[1], width=barWidth, edgecolor='white', capsize=10, label='Action + Visual Feat.') plt.bar(r2, bars2, yerr=error2, color=colors[2], width=barWidth, edgecolor='white',capsize=10, label='+POS') plt.bar(r3, bars3, yerr=error3, color=colors[3], width=barWidth, edgecolor='white',capsize=10, label='+Context') plt.bar(r4, bars4, yerr=error4, color=colors[4], width=barWidth, edgecolor='white',capsize=10, label='+Concreteness') plt.bar(r5, bars5, yerr=error5, color=colors[5], width=barWidth, edgecolor='white',capsize=10, label='+All') plt.bar(r6, bars6, yerr=error6, color=colors[6], width=barWidth, edgecolor='white', capsize=10, label='Object Detection') # plt.bar(r7, bars7, yerr=error7, color=colors[7], width=barWidth, edgecolor='white',capsize=10, label='Concreteness') # Add xticks on the middle of the group bars plt.xlabel('Method', fontweight='bold') plt.ylabel('Accuracy', fontweight='bold') # plt.xticks([0], ['YOLO']) plt.xticks([r + barWidth for r in range(len(bars2))], ['SVM', 'LSTM', 'ELMO', 'MULTIMODAL', 'Object Detection', 'Concreteness']) plt.tick_params(axis='both', which='major', labelsize=20) # Create legend & Show graphic plt.legend(loc=4, prop={'size': 20}) #plt.savefig('data/plots/bar7.pdf', format='svg', dpi=1200) # for i, v in enumerate(bars1): # plt.text(i - .15, # v + 3, # bars1[i], # fontsize=20, # color='black') # for i, v in enumerate(bars0): # plt.text(i + 2.9, # v + 3, # bars0[i], # fontsize=20, # color='black') # # for i, v in enumerate(bars2): # plt.text(i + 0.05, # v + 3, # bars2[i], # fontsize=18, # color='black') # # for i, v in enumerate(bars3): # plt.text(i + .23, # v + 3, # bars3[i], # fontsize=18, # color='black') # # for i, v in enumerate(bars4): # plt.text(i + .43, # v + 3, # bars4[i], # fontsize=18, # color='black') # for i, v in enumerate(bars5): # plt.text(i + .55, # v + 3, # bars5[i], # fontsize=20, # color='black') # # for i, v in enumerate(bars6): # plt.text(i + .75, # v + 3, # bars5[i], # fontsize=20, # color='black') # # for i, v in enumerate(bars7): # plt.text(i + .85, # v + 3, # bars5[i], # fontsize=20, # color='black') plt.show() # fig, ax = plt.subplots() # # labels = ['MAJORITY', 'SVM', 'LSTM', 'ELMo', 'MULTIMODAL'] # labels = ['MAJORITY', 'SVM'] # x = np.arange(len(labels)) # y = [71.1, 75.2] # # y = [71.1, 75.2, 75.5, 76.7, 76.4] # error = [1.3, 2.2] # # error = [1.3, 2.2, 1.4, 1.6, 1.5] # # width = 0.35 # the width of the bars # # # color_dict = {'MAJORITY': 'aquamarine', 'SVM': 'cadetblue', 'LSTM': 'darkcyan', 'ELMO': 'darkolivegreen', 'MULTIMODAL': 'darkgreen'} # # rect_main = ax.bar(x - width / 4, y, yerr=error, align='center', alpha=0.9, ecolor='black',color=[color_dict[r] for r in labels], capsize=10, label = 'action') # # rect_main = ax.bar(x - width / 2, y, yerr=error,color='aquamarine', capsize=10, label = 'Action') # rect_pos = ax.bar(x + width / 2, y, yerr=error, color='cadetblue', capsize=10, label = 'POS') # # #rect_context = ax.bar(x, y, yerr=error, align='center', alpha=0.9, ecolor='black',color='darkcyan', capsize=10, label = 'Context') # # rect_concretness = ax.bar(x + width / 2, y, yerr=error, align='center', alpha=0.9, ecolor='black',color='darkolivegreen', capsize=10, label = 'Concreteness') # # ax.set_ylabel('Accuracy') # ax.set_xticks(x) # ax.set_xticklabels(labels) # ax.legend() # ax.yaxis.grid(True) # for i, v in enumerate(y): # ax.text(i - .25, # # v / y[i] + 75, # v + 3, # y[i], # fontsize=17, # color='black') def print_action_balancing_stats(balance, before_balance, dict_video_actions, dict_train_data, dict_test_data, dict_val_data, test_data): string_to_print = "in total there are {0} visible actions and {1} not visible" string_to_print = call_print(balance, before_balance, string_to_print) nb_visible_actions, nb_not_visible_actions = get_nb_visible_not_visible(dict_video_actions) print(string_to_print.format(nb_visible_actions, nb_not_visible_actions)) string_to_print = "in train there are {0} visible actions and {1} not visible" string_to_print = call_print(balance, before_balance, string_to_print) train_nb_visible_actions, train_nb_not_visible_actions = get_nb_visible_not_visible(dict_train_data) print(string_to_print.format(train_nb_visible_actions, train_nb_not_visible_actions)) string_to_print = "in test there are {0} visible actions and {1} not visible" string_to_print = call_print(balance, before_balance, string_to_print) test_nb_visible_actions, test_nb_not_visible_actions = get_nb_visible_not_visible(dict_test_data) print(string_to_print.format(test_nb_visible_actions, test_nb_not_visible_actions)) string_to_print = "in val there are {0} visible actions and {1} not visible" string_to_print = call_print(balance, before_balance, string_to_print) val_nb_visible_actions, val_nb_not_visible_actions = get_nb_visible_not_visible(dict_val_data) print(string_to_print.format(val_nb_visible_actions, val_nb_not_visible_actions)) most_common_label = 0 if train_nb_visible_actions > train_nb_not_visible_actions else 1 predicted = (test_nb_visible_actions + test_nb_not_visible_actions) * [most_common_label] test_labels = [label for (video, action, label) in test_data] acc = accuracy_score(test_labels, predicted) f1 = f1_score(test_labels, predicted) recall = recall_score(test_labels, predicted) precision = precision_score(test_labels, predicted) print("# Most common label Test: Acc: {0}, Precision:{1}, Recall:{2}, F1:{3} ".format(acc, precision, recall, f1)) # print("# Baseline Acc Most common label Train: {0} ".format(1 - 1.0 * nb_visible_actions / (nb_not_visible_actions + nb_visible_actions))) # print("# Baseline Acc Most common label Val: {0} ".format(1 - 1.0 * val_nb_visible_actions / (val_nb_not_visible_actions + val_nb_visible_actions))) # print("# Baseline Acc Most common label Test: {0} ".format(1 - 1.0 * test_nb_visible_actions / (test_nb_not_visible_actions + test_nb_visible_actions))) def create_table(headers, list_all_results): final_list = [] for elem in list_all_results: list_results = [] list_results += elem final_list.append(list_results) print(tabulate(final_list, headers=headers, tablefmt='orgtbl')) def create_table_concreteness(): # Visible actions with low concreteness score final_list = [['give them a really nice full look', 2.96, 'look'], ['put the instructions on how', 2.5, 'put'], ['give them a really nice full look', 2.96, 'look'], ['make my markings', 2.67, 'make'], ['using this', 2.78, 'using'], ['make something hearty', 2.78, 'make'], ['making diy', 2.34, 'making'], ['do this in their home', 2.46, 'do'], ] print(' Examples visible actions with low concreteness score:') print(tabulate(final_list, headers=['Action', 'Score', 'Verb / Noun'], tablefmt='orgtbl')) # Not visible actions with high concreteness score: final_list = [['making a rustic necklace', 4.96, 'necklace'], ['throw away', 4.04, 'throw'], ['found this great piece of wood', 4.85, 'wood'], ['chopping the wood i', 4.85, 'wood'], ['use this method daily shower cleaner even though i', 4.89, 'shower'], ['get to bed sometimes i', 5.0, 'bed'], ['throw my hair in braids', 4.97, 'hair'], ['do every single night depending on how tired i', 5.0, 'tired'], ['making a diy dog toy this', 4.93, 'toy'], ] print("\n") print(' Examples of not visible actions with high concreteness score:') print(tabulate(final_list, headers=['Action', 'Score', 'Verb / Noun'], tablefmt='orgtbl')) if __name__ == '__main__': print_bar_plots() # headers = ['', 'Method', 'Test Accuracy', 'Test Recall', 'Test Precision', 'Test F1'] # dict_results = [['SVM + GloVe', 0.69, 0.7, 0.69, 0.67], # ['SVM + GloVe + pos_tag', 0.69, 0.67, 0.71, 0.69], # ['SVM + GloVe + context', 0.67, 0.65, 0.69, 0.67], # ['SVM + GloVe + pos_tag + context', 0.67, 0.65, 0.7, 0.67], # ['LSTM + GloVe', 0.64, 0.61, 0.76, 0.67], # ['ELMO', 0.62, 0.6, 0.67, 0.63], # ['3 Dense layers + GloVe', 0.67, 0.64, 0.74, 0.68], # ['concreteness score', 0.61, 0.79, 0.59, 0.68], # ['YOLO v3 + wup-similarity', 0.57, 0.53, 0.64, 0.58], # ['Inception V3 features + GloVe', '-', '-', '-', '-'] # ] # create_table(headers, dict_results) # # create_table_concreteness()
```python import scipy as sc import numpy as np from scipy import linalg as LS from numpy import linalg as LA import matplotlib.pyplot as plt import math import os %matplotlib notebook from matplotlib.animation import FuncAnimation ``` Le but de ce TP est, dans un premier temps, d'étudier numériquement la méthode des éléments finis pour approcher la solution de l'équation de la chaleur. Dans un second temps, on va s'intéresser à un autre type d'approximation de Galerkin, appelée méthode Proper Orthogonal Decomposition (POD), qui est basée sur la décomposition en composantes principales que vous avez étudiée dans le DM préparatoire. Le but de la première partie du TP est d'implémenter la méthode des éléments finis. Dans la deuxième partie, nous allons étudier l'évolution de l'erreur commise par la méthode des élements finis en fonction de la discrétisation en temps. La troisième partie est consacrée à l'erreur de discrétisation en espace. Enfin, la quatrième partie sera consacrée à l'étude et l'implémentation de la méthode POD. Remarques générales sur le déroulement du TP: *Ecrire vos réponses dans les cellules de texte commençant par REPONSE. Vous pouvez taper des formules en écrivant du code Latex usuel. *Pensez-bien à compiler les lignes de codes plt.close() après l'affichage de chaque figure! *A plusieurs reprises, on vous demande d'indiquer les abscisses, les ordonnées et les labels des courbes affichées. Voir la documentation en ligne de matplotlib pour plus de détails. *Rendre le fichier .ipynb en l'envoyant à l'adresse e-mail [email protected] pour le 26 mai 2020. Tout au long de ce TP, nous considèrerons la solution $u(t,x)$ de l'équation de la chaleur sur le domaine $\Omega = (0,1)$ avec un terme source $f\in L^2(]0,T[, L^2(0,1))$ et une condition initiale $g\in L^2(0,1)$. Le temps final est noté $T>0$. Nous allons choisir ici un terme source $f(t,x)$ de la forme $$ f(t,x) = r(t) s(x), $$ avec $$ r(t) = 10 \cos(4\pi t) $$ et $$ s(x) = 0.5 - |x-0.5|. $$ Le temps final est donné par $T=0.5$ et la condition initiale est $g = 0$. ```python #Temps final T = 0.5 ``` ```python #Fonction qui renvoie la valeur du terme source f(t,x). def r(t) : return 10*np.cos(4*math.pi*t) def s(x): return (0.5- abs(x-0.5)) def f(t,x) : return r(t)*s(x) ``` ```python #Fonction qui renvoie la valeur de la condition initiale g(x) def g(x) : return 0 ``` # I- Implémentation de la méthode des éléments finis Dans cette première partie, nous commençons par mettre en oeuvre la méthode des éléments finis $\mathbb{P}_1$ associée à une grille de dsicrétisation uniforme de l'intervalle $(0,1)$ que nous avons vue dans le cours. Nous commençons par définir les matrices intervenant dans la discrétisation en espace. Pour un entier $N_h \in \mathbb{N}^*$, on notera $$ \Delta x = \frac{1}{N_h +1}, \quad x_i = i \Delta x, \quad \forall 0\leq i \leq N_h +1, $$ $$ \forall 1\leq i \leq N_h, \quad \phi^h_i(x) = \left\{ \begin{array}{ll} 1 - \frac{|x-x_i|}{\Delta x} & \mbox{ si } x\in [x_{i-1}, x_{i+1}],\\ 0 & \mbox{sinon.}\\ \end{array} \right. $$ On notera également $$ V_h:= {\rm Vect}\left\{ \phi_1^h, \cdots, \phi_{N_h}^h\right\} $$ Notez que ${\rm dim}(V_h) = N_h$. On prendra garde à la chose suivante: dans le texte, les fonctions de forme sont numérotées de $i=1$ à $i=N_h$, alors que dans le code, elles sont numérotées de $i=0$ à $i=N_h-1$. Les matrices $S_h:=\left( S_{h,ij}\right)_{1\leq i,j \leq N_h}$ et $K_h:= \left( K_{h,ij}\right)_{1\leq i,j \leq N_h}$ sont définies telles que pour tout $1\leq i, j \leq N_h$, $$ S_{h,ij} = \langle \phi^h_i, \phi^h_j \rangle_{L^2(0,1)} \quad K_{h,ij} = \int_{(0,1)}\frac{d}{dx}\phi^h_i(x)\frac{d}{dx}\phi_j^h(x)\,dx. $$ 1) Vérifier que pour tout $1\leq i\neq j \leq N_h$, $$ S_{h,ii} = \frac{2}{3}\Delta x, \quad S_{h,ij} = \frac{1}{6}\Delta x \mbox{ si }j=i+1 \mbox{ ou }j=i-1, \quad S_{h,ij} = 0 \mbox{ sinon} $$ et $$ K_{h,ii} = \frac{2}{\Delta x}, \quad K_{h,ij} = - \frac{1}{\Delta x} \mbox{ si }j=i+1 \mbox{ ou }j=i-1, \quad K_{h,ij} = 0 \mbox{ sinon}. $$ $\color{blue}{\textrm{REPONSE 1}\\}$ Calcul de $S_{h,ii}$ : Pour tout $1\leq i \leq N_h$ : $\begin{array}{lcl} S_{h,ii}&=&\int_{(0,1)}(\phi^h_i(x))^2 dx \\ S_{h,ii}&=&\int_{(x_{i-1},x_i)}(1 - \frac{x_i-x}{\Delta x})^2 dx + \int_{(x_{i},x_{i+1})}(1 - \frac{x-x_i}{\Delta x})^2 dx \\ S_{h,ii}&=&[\frac{\Delta_x}{3}(1 - \frac{x_i-x}{\Delta x})^3]_{x_{i-1}}^{x_i}-[\frac{\Delta_x}{3}(1 - \frac{x-x_i}{\Delta x})^3]_{x_{i}}^{x_{i+1}}\\ S_{h,ii}&=&2\frac{\Delta_x}{3} \end{array}$ Calcul de $S_{h,ij}$ pour j=i+1: Pour tout $1\leq i\ \leq N_h-1$ : $\begin{array}{lcl} S_{h,ij}&=&\int_{(0,1)}\phi^h_i(x)\phi^h_j(x) dx \\ S_{h,ij}&=&\int_{x_i}^{x_{i+1}}(1 - \frac{x-x_i}{\Delta x})(1 - \frac{x_{i+1}-x}{\Delta x}) dx \\ S_{h,ij}&=&\int_{x_i}^{x_{i+1}}1 + \frac{x_i-x_{i+1}}{\Delta_x}+\frac{-x^2+x(x_{i+1}+x_i)-x_ix_{i+1}}{\Delta_x^2}dx \\ S_{h,ij}&=&\frac{1}{\Delta_x^2}[-\frac{x^3}{3}+\frac{x^2}{2}(x_{i+1}+x_i)-x_ix_{i+1}x]_{x_i}^{x_{i+1}}\\ S_{h,ij}&=&\Delta_x[\frac{i^3-(i+1)^3}{3}+\frac{(i+1)^2-i^2}{2}(2i+1)-i(i+1)]\\ S_{h,ij}&=&\frac{\Delta_x}{6}\\ \end{array}$ Calcul de $S_{h,ij}$ pour j=i-1: On suit la même démarche, pour j=i-1 on montre que $S_{h,ij}=\frac{\Delta_x}{6}$ Calcul de $S_{h,ij}$ pour j $\notin [i-1,i+1]$: Enfin, si j $\notin [i-1,i+1]$, on montre aisément que $S_{h,ij}=0$. Calcul de $K_{h,ii}$ : Pour tout $1\leq i\ \leq N_h$ : $\begin{array}{lcl} K_{h,ii} &=& \int_{(0,1)}(\frac{d}{dx}\phi^h_i(x))^2\,dx. \\ K_{h,ii}&=&\int_{(x_{i-1},x_i)}(\frac{d}{dx}(1 - \frac{x_i-x}{\Delta x}))^2 dx + \int_{(x_{i},x_{i+1})}(\frac{d}{dx}(1 - \frac{x-x_i}{\Delta x}))^2 dx \\ K_{h,ii}&=&\int_{(x_{i-1},x_i)}(\frac{1}{\Delta_x})^2 dx + \int_{(x_{i},x_{i+1})}(\frac{1}{\Delta_x})^2 dx \\ K_{h,ii}&=&\frac{2}{\Delta_x} \end{array}$ Calcul de $K_{h,ij}$ pour j=i+1 : Pour tout $1\leq i\ \leq N_h-1$ : $\begin{array}{lcl} K_{h,ij} &=& \int_{(0,1)}\frac{d}{dx}\phi^h_i(x)\frac{d}{dx}\phi_{i+1}^h(x)\,dx \\ K_{h,ij} &=& \int_{(x_i,x_{i+1})}\frac{d}{dx}(1 - \frac{x-x_i}{\Delta x})\frac{d}{dx}(1 - \frac{x_{i+1}-x}{\Delta x})\,dx. \\ K_{h,ij} &=&\int_{(x_i,x_{i+1})}-\frac{1}{\Delta_x^2}\\ K_{h,ij} &=&-\frac{1}{\Delta_x} \end{array}$ Calcul de $K_{h,ij}$ pour j=i-1 : Pour tout $2\leq i\ \leq N_h$ : $\begin{array}{lcl} K_{h,ij} &=& \int_{(0,1)}\frac{d}{dx}\phi^h_i(x)\frac{d}{dx}\phi_{i-1}^h(x)\,dx \\ K_{h,ij} &=& \int_{(x_{i-1},x_i)}\frac{d}{dx}(1 - \frac{x_i-x}{\Delta x})\frac{d}{dx}(1 - \frac{x-x_{i-1}}{\Delta x})\,dx. \\ K_{h,ij} &=&\int_{(x_i,x_{i+1})}-\frac{1}{\Delta_x^2}\\ K_{h,ij} &=&-\frac{1}{\Delta_x} \end{array}$ Calcul de $K_{h,ij}$ pour j $\notin [i-1,i+1]$: Enfin, si j $\notin [i-1,i+1]$, on montre aisément que $K_{h,ij}=0$. ```python #Définition du pas de discrétisation en espace Deltax en fonction de Nh def Deltax(Nh): return 1.0/(Nh+1) ``` ```python #Définition de la grille de discrétisation def xgrid(Nh): xvec = np.zeros(Nh) for i in range(0,Nh): xvec[i]= (i+1)*Deltax(Nh) return xvec ``` ```python #Définition de la matrice Sh en fonction de Nh def Sh(Nh): Sh = np.zeros((Nh, Nh)) dx = Deltax(Nh) for i in range(0,Nh): Sh[i,i] = 2.0/3.0*dx if (i>0): Sh[i-1,i] = 1.0/6.0*dx if (i<(Nh-1)): Sh[i+1,i] = 1.0/6.0*dx return Sh ``` ```python #Définition de la matrice Kh en fonction de Nh def Kh(Nh): Kh = np.zeros((Nh, Nh)) dx = Deltax(Nh) for i in range(0,Nh): Kh[i,i] = 2.0/dx if (i>0): Kh[i-1,i] = -1.0/dx if (i<(Nh-1)): Kh[i+1,i] = -1.0/dx return Kh ``` Nous définissons ensuite le vecteur $U_h^0\in \mathbb{R}^{N_h}$ correspondant à la condition initiale. Celui-ci est la solution du problème $S_h U_h^0 = G_h$ où $G_h:= \left(\langle g, \phi_i^h \rangle_{L^2(0,1)}\right)_{1\leq i \leq N_h}$ 2) Montrer que $U_h^0 = 0$. $\color{blue}{\textrm{REPONSE 2}\\}$ $S_h U_h^0 =0$ car $g=0$ Donc, pour tout $1\leq i\ \leq N_h : (S_h U_h^0)_i=0$. Montrons que $(U_h^0)_i=0$ pour tout $1\leq i\ \leq N_h$ : $(S_h U_h^0)_i=\sum_k^{N_h}(S_h)_{ik}(U_h^0)_k = \sum_k^{N_h}\langle \phi^h_i, \phi^h_j \rangle_{L^2(0,1)}(U_h^0)_k $. On peut écrire ces $N_h$ égalités de la manière suivante : $\left\{ \begin{array}{llr} 2 (U_h^0)_1+ (U_h^0)_2 &=&0 \\ (U_h^0)_1+ 2(U_h^0)_2+(U_h^0)_3 &=&0\\ \vdots\\ (U_h^0)_{N_h-2}+ 2(U_h^0)_{N_h-1}+(U_h^0)_{N_h} &=&0\\ (U_h^0)_{N_h-1}+2(U_h^0)_{N_h}&=&0 \end{array} \right.$ Une récurrence simple permet de montrer que pour $n \in [1,N_h-1], (U_h^0)_{n}=-\frac{n}{n+1}(U_h^0)_{n+1} $ Si l'on applique cette égalité à la dernière ligne du système suivant, on montre que $(U_h^0)_{N_h}=0$ A l'aide d'un raisonnement en cascade, on montre alors que $(U_h^0)_i=0$ pour tout $1\leq i\ \leq N_h$. ```python #Définition de la condition initiale U_h(0) en fonction de Nh def U0h(Nh) : return np.zeros(Nh) ``` Le but des lignes de code ci-dessous est d'afficher la condition initiale. ```python def plot_condition_initiale(Nh): print("Affichage de la fonction U0 initiale") plt.plot(xgrid(Nh), U0h(Nh)) plt.xlabel('$x$') plt.ylabel('$u_0(x)$') plt.axis([0, 1, -0.1, 0.1]) plt.show() ``` ```python plot_condition_initiale(10) ``` Affichage de la fonction U0 initiale <IPython.core.display.Javascript object> ```python plt.close() ``` Les lignes de code suivantes permettent de renvoyer la valeur du vecteur $F_h(t) = (F_{h,i}(t))_{1\leq i \leq N_h}$ où $$ F_{h,i}(t) = \langle f(t), \phi^h_i\rangle_{L^2(0,1)}. $$ 3) Montrer que comme $f(t,x) = r(t) s(x)$, on a alors $$ F_h(t) = r(t) \overline{F}_h $$ pour un vecteur $\overline{F}_h = (\overline{F}_{h,i})_{1\leq i \leq N_h}$ dont on donnera l'expression en fonction de $s$ et de $\phi_i^h$ pour $1\leq i \leq N_h$. $\color{blue}{\textrm{REPONSE 3}\\}$ Pour tout $1\leq i\ \leq N_h :$ $\begin{array}{lcl} F_{h,i}(t) &=& \langle f(t), \phi^h_i\rangle_{L^2(0,1)} \\ F_{h,i}(t) &=&\langle r(t) s(x), \phi^h_i\rangle_{L^2(0,1)} \\ F_{h,i}(t) &=&r(t)\langle s(x), \phi^h_i\rangle_{L^2(0,1)} \\ F_{h,i}(t) &=&r(t)\overline{F}_{h,i}\\ \end{array}$ avec pour tout $1\leq i\ \leq N_h, \quad \overline{F}_{h,i}=\langle s(x), \phi^h_i\rangle_{L^2(0,1)}$ ```python #Fonction qui renvoie la valeur du vecteur Fh(t) def Fbarh(Nh): Fh= np.zeros(Nh) for i in range(0,Nh): Fh[i] = s(xgrid(Nh)[i]) Gh = np.dot(Sh(Nh),Fh) return Gh def Fh(t,Nh): return r(t)*Fbarh(Nh) ``` Nous introduisons ensuite les différents paramètres de discrétisation en temps, en particulier le pas de temps $$ \Delta t = T/P $$ avec $P\in \mathbb{N}^*$ un entier. ```python #Fonction qui renvoie la valeur du pas de temps Deltat en fonction de l'entier P def Deltat(P) : return T/P ``` Le but des lignes de code suivantes est de montrer une animation illustrant l'évolution du terme source $f(t,x)$ au cours du temps. Faire tourner le code pour visualiser l'évolution de $f$. ```python ## Le but de cette fonction est d'afficher l'évolution de f(t,x) au cours du temps Nhplot = 21 Pplot = 50 Fplot = np.zeros((Nhplot,Pplot+1)) xplot = xgrid(Nhplot) dtplot = Deltat(Pplot) for p in range(0,Pplot+1): for i in range(0,Nhplot): Fplot[i,p]= f(p*dtplot, xplot[i]) fig1, ax1 = plt.subplots(1, figsize = (6,6)) plotf, = ax1.plot(xplot,Fplot[:,0]) def animate(p): f = Fplot[:,p] plotf.set_ydata(f) def init(): ax1.set_xlim(0,1) ax1.set_ylim(-6,6) return plotf, step = 1 steps = np.arange(1,Pplot,step) ani = FuncAnimation(fig1, animate,steps, init_func = init, interval = 100, blit = True) ``` <IPython.core.display.Javascript object> ```python plt.close() ``` Nous définissons ensuite une fonction qui permet de résoudre l'équation de la chaleur, avec une discrétisation en espace caractérisée par un entier $N_h$, une discrétisation en temps caractérisée par un entier $P$, et à l'aide d'un $\theta$-schéma caractérisé par un réel $\theta\in [0,1]$. 4) Remplir les lignes de code correspondantes pour implémenter un theta-schéma pour résoudre l'équation de la chaleur pour un pas de temps $\Delta t = \frac{T}{P}$ et un pas d'espace d'espace $\Delta x = \frac{1}{N_h +1}$. Les solutions aux différents pas de temps sont stockées dans une matrice $W\in \mathbb{R}^{N_h \times (P+1)}$ telle que $W_{i,p} = U_{h,i}^p$. $\color{blue}{\textrm{REPONSE 4}\\}$ Expression de A et B dans le code ci-dessous. ```python # Résolution de l'équation de la chaleur par la méthode des éléments finis avec un theta-schéma def sol_chaleur(Nh, P, theta): dt = Deltat(P) S = Sh(Nh) K = Kh(Nh) W = np.zeros((Nh,P+1)); Uold = U0h(Nh) W[:,0] = Uold; ## Uold représente U^p ## Unew représente U^{p+1} for p in range(0,P): B = np.dot((S-(1-theta)*dt*K),Uold)+dt*(theta*Fh((p+1)*dt,Nh)+(1-theta)*Fh(p*dt,Nh)) A = S+theta*dt*K Unew = LA.solve(A,B) ## Calcul la solution du problème A^{-1}B W[:,p+1] = Unew Uold = Unew return W ``` Nous allons maintenant tester cette fonction avec des valeurs tests, à savoir $N_{h,try} = 50$, $P_{try}= 500$ et $\theta_{try}= 1$ (ce qui correspond à un schéma d'Euler implicite). Le code peut prendre quelques secondes à tourner. ```python Ptry = 50 Nhtry = 21 thetatry = 1 Wtry = sol_chaleur(Nhtry, Ptry,thetatry) ``` Les lignes de code suivantes permettent de voir l'évolution de la solution obtenue. ```python fig2, ax2 = plt.subplots(1, figsize = (6,6)) xtry = xgrid(Nhtry) plotu, = ax2.plot(xtry,Wtry[:,0]) def animate2(p): f = Wtry[:,p] plotu.set_ydata(f) def init2(): ax2.set_xlim(0,1) ax2.set_ylim(-0.3,0.3) return plotu, step = 1 steps = np.arange(1,Ptry,step) ani = FuncAnimation(fig2, animate2,steps, init_func = init2, interval = 100, blit = True) ``` <IPython.core.display.Javascript object> ```python plt.close() ``` 5) Qu'observez-vous quant à la régularité de la solution $u$ en $x$ (en comparaison de la régularité du terme source $f$ en $x$)? $\color{blue}{\textrm{REPONSE 5}\\}$ On observe que la solution $u$ en $x$ est beaucoup plus régulière que le terme source $f$ en $x$. Le point anguleux est lissé, il n'y a pas de discontinuité dans la solution. # II- Etude de l'évolution de l'erreur en fonction de la discrétisation en temps Le but de cette partie est d'étudier l'influence du pas de temps $\Delta t$ sur l'erreur d'approximation donnée par ce schéma, pour une valeur de discrétisation en espace $N_h$ fixée. ```python #Valeur de Nh fixée dans cette partie Nh = 31 ``` Nous allons tout d'abord étudier la stabilité du schéma en temps, en fonction de la valeur de $\theta$ et du pas de temps $\Delta t$. Les lignes de code ci-dessous permettent de calculer la solution de l'équation de la chaleur pour différentes valeurs de $P$ (i.e. de $\Delta t$) et de $\theta$. 1) Faites tourner les lignes de code contenues dans les deux cellules ci-dessous pour calculer et visualiser l'évolution de la solution approchée pour les valeurs de $\theta = 1$ (schéma implicite) puis $0.5$ (schéma de Cranck-Nicholson) puis $0$ (schéma explicite). Que constatez-vous? $\color{blue}{\textrm{REPONSE 1}\\}$ Pour le schéma implicite et le schéma de Cranck-Nicholson, la solution approchée est bien régulière. Le comportement de la solution pour ces deux schéma semble par ailleurs similaire. En revanche, pour le schéma explicite on observe un comportement singulier. La forme de la solution est très différente des formes rencontrées précédemment. La condition de stabilité pour le schéma explicite n'est certainement pas vérifiée. ```python # Paramètres de discrétisation en temps P = 3049 theta = 0 W = sol_chaleur(Nh, P,theta) ``` ```python fig3, ax3 = plt.subplots(1, figsize = (6,6)) xvec = xgrid(Nh) plotu, = ax3.plot(xvec,W[:,0]) def animate3(p): f = W[:,p] plotu.set_ydata(f) def init3(): ax3.set_xlim(0,1) ax3.set_ylim(-0.3,0.3) return plotu, step = 1 steps = np.arange(1,P,step) ani = FuncAnimation(fig3, animate3,steps, init_func = init3, interval = 10, blit = True) ``` <IPython.core.display.Javascript object> ```python plt.close() ``` Nous allons maintenant calculer les valeurs propres de la matrice $C := S_h^{-1/2} K_h S_h^{1/2}$. 2) Remplir les lignes de code correspondantes dans la cellule ci-dessous. Quelle est la valeur de la plus grande valeur propre de cette matrice? $\color{blue}{\textrm{REPONSE 2}\\}$ La valeur de la plus grande valeur propre de cette matrice est environ égale à 12199. ```python S = Sh(Nh) K = Kh(Nh) #On calcule tout d'abord la racine carrée de la matrice Sh, puis son inverse Racine = LS.sqrtm(S) invRacine = LA.inv(Racine) C1=np.dot(invRacine, K) C=np.dot(C1,invRacine) #print(C) vals, vecs = LA.eigh(C) print(np.max(vals)) ``` 12199.670214084039 3) En déduire la valeur de $P$ la plus petite possible pour que le schéma d'Euler explicite soit stable. $\color{blue}{\textrm{REPONSE 3}\\}$ Le schéma d'Euler explicite est stable sous la condition : $\begin{equation} max \lambda_i \Delta_t \leq 2 \end{equation}$ $\begin{array}{lcl} max \lambda_i \Delta_t \leq 2&\Leftrightarrow&max \lambda_i \frac{T}{P} \leq 2\\ &\Leftrightarrow& \frac{max \lambda_i T}{2}\leq P \\ &\Leftrightarrow& \frac{12199.670214084039}{4}\leq P \\ &\Leftrightarrow& 3050\leq P \end{array}$ On peut vérifier ce résultat en affichant la solution du schéma d'Euler explicite dans le cas où la condition de stabilité n'est pas respectée. On observe bien un comportement chaotique de la solution. 4) Faire maintenant varier la valeur de $N_h$ ci-dessus et observez comment la plus grande valeur propre de la matrice $S_h^{-1/2}K_h S_h^{-1/2}$ évolue en fonction de $N_h$. Que constatez-vous? ```python P = 500 theta = 0 list_Nh=np.arange(10,101,1) list_max_eigen_value=[] list_P_min=[] for Nh in list_Nh: S = Sh(Nh) K = Kh(Nh) Racine = LS.sqrtm(S) invRacine = LA.inv(Racine) C1=np.dot(invRacine, K) C=np.dot(C1,invRacine) vals, vecs = LA.eigh(C) list_max_eigen_value.append(max(vals)) P_min=max(vals)*T/2 list_P_min.append(P_min) plt.plot(list_Nh,list_max_eigen_value, label="maximum eigen value of C") plt.plot(list_Nh,list_P_min, label="minimum value of P for the Euler explicit method") plt.xlabel("Nh") plt.legend() plt.grid() ``` <IPython.core.display.Javascript object> ```python plt.close() ``` $\color{blue}{\textrm{REPONSE 4}\\}$ La plus grande valeur propre de la matrice $S_h^{-1/2}K_h S_h^{-1/2}$ et la valeur minimale de P assurant la stabilité du schéma d'Euler augmentent fortement en fonction de $N_h$. Dans la suite du TP, nous allons étudier comment l'erreur d'approximation évolue en fonction du pas de temps $\Delta t$ pour une valeur de discrétisation spatiale fixée pour le schéma d'Euler implicite et le schéma de Cranck-Nicholson. Pour ce faire, nous allons fixer la valeur de $N_h$. ```python #Valeur de Nh fixée dans cette partie Nh = 31 ``` Pour calculer ces erreurs, nous avons besoin de calculer une solution de référence. Comme on ne dispose pas de la solution exacte, la solution de référence est ici la solution numérique calculée pour une valeur $P_{ref}$ très grande. On supposera que celle-ci fournit une approximation suffisamment précise de la solution exacte. Ensuite, nous calculerons les erreurs entre cette solution numérique de référence et la solution obtenue pour des valeurs de $P$ beaucoup plus petites que $P_{ref}$. Nous commençons par fixer une très grande valeur $P_{ref}$ de référence et nous calculons la solution de référence associée avec un schéma de Cranck-Nicholson. Nous allons supposer que cette solution est suffisamment proche de la solution exacte de l'équation de la chaleur pour pouvoir la comparer à d'autres solutions. Ce calcul peut prendre quelques minutes. On notera également $$ \Delta t_{ref}:= \frac{T}{P_{ref}}. $$ ```python Pref = 2048 Wref = sol_chaleur(Nh,Pref,0.5) ``` Nous allons comparer cette solution de référence avec des solutions obtenues pour des valeurs de $P$ telles que $$ P_{ref} = m P. $$ avec $m\in \mathbb{N}^*$. Dans toute la suite, nous noterons, pour tout $P\in \mathbb{N}^*$, et pour tout $0\leq p \leq P$, $$ u_{h,P}^p:= \sum_{i=1}^{N_h} U_{h,P,i}^p \phi_i^h, $$ où $\left( U_{h,P}^p\right)_{0\leq p \leq P}$ est la solution donnée par le schéma numérique considéré pour un pas de temps $\Delta t = \frac{T}{P}$ et où pour tout $0\leq p\leq P$, $U_{h,P}^p:= \left( U_{h,P,i}^p\right)_{1\leq i \leq N_h}$. La fonction $u_{h,P}^p$ est donc une approximation après discrétisation en temps de la solution $u_h(t^P_p)$ où $[0,T] \ni t \mapsto u_h(t)$ est la solution en temps continu de l'approximation de Galerkin de l'équation de la chaleur obtenue avec l'espace de discrétisation $V_h$, et où $t^P_p := p\Delta t= p\frac{T}{P}$. 5) Montrer que pour tout $1\leq p \leq P$, on a $$ t^P_p = mp \Delta t_{ref} = t^{P_{ref}}_{mp}. $$ $\color{blue}{\textrm{REPONSE 5}\\}$ $\begin{equation}t^P_p =p\frac{T}{P} = p\frac{P_{ref}\Delta t_{ref} }{P}= mp \Delta t_{ref} =t^{P_{ref}}_{mp}. \end{equation}$ Nous allons calculer l'erreur $$ \max_{0\leq p \leq P} \| u_{h,P}^p - u_{h,P_{ref}}^{mp}\|_{L^2(0,1)}. $$ Notez que $u_{h,P}^p$ et $u_{h,P_{ref}}^{mp}$, d'après les questions précédentes, sont deux approximations de $u_h(t_p^P)$. 6) Montrer que $$ \|u_{h,P}^p - u_{h,P_{ref}}^{mp}\|_{L^2(0,1)}^2 = (U_{h,P}^p - U_{h, P_{ref}}^{mp})^T S_h (U_{h,P}^p - U_{h, P_{ref}}^{mp}). $$ $\color{blue}{\textrm{REPONSE 6}\\}$ $\begin{array}{lcl} \|u_{h,P}^p - u_{h,P_{ref}}^{mp}\|_{L^2(0,1)}^2 &=&\langle \sum_{i=1}^{N_h} (U_{h,P,i}^p-U_{h,P_{ref},i}^{mp}) \phi_i^h, \sum_{j=1}^{N_h} (U_{h,P,j}^p-U_{h,P_{ref},j}^{mp}) \phi_i^h \rangle_{L^2(0,1)}\\ \|u_{h,P}^p - u_{h,P_{ref}}^{mp}\|_{L^2(0,1)}^2 &=& \sum_{i=1}^{N_h}\sum_{j=1}^{N_h} (U_{h,P,i}^p-U_{h,P_{ref},i}^{mp}) \langle \phi_i^h, \phi_j^h \rangle (U_{h,P,j}^p-U_{h,P_{ref},j}^{mp}) \\ \|u_{h,P}^p - u_{h,P_{ref}}^{mp}\|_{L^2(0,1)}^2 &=& \sum_{i=1}^{N_h}\sum_{j=1}^{N_h} (U_{h,P,i}^p-U_{h,P_{ref},i}^{mp}) (S_h)_{ij}(U_{h,P,j}^p-U_{h,P_{ref},j}^{mp}) \\ \|u_{h,P}^p - u_{h,P_{ref}}^{mp}\|_{L^2(0,1)}^2 &=&(U_{h,P}^p - U_{h, P_{ref}}^{mp})^T S_h (U_{h,P}^p - U_{h, P_{ref}}^{mp}) \end{array}$ Remplir les lignes de code ci-dessous pour pouvoir calculer $$ \max_{0\leq p \leq P} \| u_{h,P}^p - u_{h,P_{ref}}^{mp}\|_{L^2(0,1)} $$ pour un schéma d'Euler implicite et pour un schéma de Cranck-Nicholson. ```python #Tableau contenant les différentes valeurs de P pour lesquelles nous allons calculer les erreurs. Ptab = [2,4,8,16,32,64,128] #Tableaux vides qui vont contenir les valeurs des différentes erreurs pour le schéma d'Euler implicite et le schéma de Cranck-Nicholson. errtab_imp = [] errtab_CN = [] for P in Ptab: m = int(Pref/P) W_imp = sol_chaleur(Nh,P,1) ##Contient la solution de l'équation de la chaleur par un schéma implicite avec \Delta t = T/P W_CN = sol_chaleur(Nh,P,0.5) ##Contient la solution de l'équation de la chaleur par un schéma de Cranck-Nicholson avec \Delta t = T/P err_max_imp = 0; for p in range(1,P+1): time = p*m Usol_ref = Wref[:,time] ## contient le vecteur des coordonnées de u_{h, P_{ref}}^{mp} Usol_app = W_imp[:,p] ## contient le vecteur des coordonnées de u_{h, P}^{p} avec le schéma implicite # err = \| u_{h, P}^{p} - u_{h, P_{ref}}^{mp} \|_{L^2(0,1)} err =np.dot(np.dot((Usol_ref-Usol_app).T,Sh(Nh)),(Usol_ref-Usol_app)) err_max_imp = max(err_max_imp, err); errtab_imp.append(err_max_imp) err_max_CN = 0; for p in range(1,P+1): time = p*m Usol_ref = Wref[:,time] ## contient le vecteur des coordonnées de u_{h, P_{ref}}^{mp} Usol_app= W_CN[:,p] ## contient le vecteur des coordonnées de u_{h, P}^{p} avec le schéma de Cranck-Nicholson # err = \| u_{h, P}^{p} - u_{h, P_{ref}}^{mp} \|_{L^2(0,1)} err =np.dot(np.dot((Usol_ref-Usol_app).T,Sh(Nh)),(Usol_ref-Usol_app)) err_max_CN = max(err_max_CN, err); errtab_CN.append(err_max_CN) ``` Les lignes de code ci-dessous permettent de tracer ces erreurs en échelle logarithmique en fonction de $P$ pour les deux types de schémas. Compléter ces lignes de code pour afficher les abscisses, les ordonnées et les labels des différentes courbes tracées. ```python plt.loglog(Ptab,errtab_imp,label="Error, Euleur explicit method", marker='x') plt.loglog(Ptab,errtab_CN,label="Error, Cranck-Nicholson method", marker='x') plt.grid() plt.xlabel("P") plt.ylabel("max error") plt.legend() plt.show() ``` <IPython.core.display.Javascript object> ```python plt.close() ``` 7) Quelles sont les vitesses de convergence de ces erreurs pour ces deux schémas en fonction de $\Delta t$? (Faire une régression linéaire si besoin). ```python #Regression linéaire pour le schéma d'Euler explicite #On retire les premiers points car ils ne suivent pas la tendance globale de la courbe. reg_imp=np.polyfit(np.log10(Ptab[1:]),np.log10(errtab_imp[1:]),1,rcond=False, full=True) alpha_imp=reg_imp[0][0] beta_imp=reg_imp[0][1] residuals_imp=reg_imp[1][0] print("alpha_imp=",alpha_imp) print("beta_imp=",beta_imp) print("residuals_imp",residuals_imp,'\n') #Regression linéaire pour le schéma de Crank-Nicholson #On retire les premiers points car ils ne suivent pas la tendance globale de la courbe. reg_CN=np.polyfit(np.log10(Ptab[1:]),np.log10(errtab_CN[1:]),1,rcond=False, full=True) alpha_CN=reg_CN[0][0] beta_CN=reg_CN[0][1] residuals_CN=reg_CN[1][0] print("alpha_CN=",alpha_CN) print("beta_CN=",beta_CN) print("residuals_CN",residuals_CN) ``` alpha_imp= -1.860235108688803 beta_imp= -0.7706401229718983 residuals_imp 0.003896682018981623 alpha_CN= -4.027359436025191 beta_CN= -0.4901921142164779 residuals_CN 0.0008513421781706016 ```python #plt.loglog(Ptab[1:],errtab_imp[1:],label="Euleur explicit method") #plt.loglog(Ptab[1:],errtab_CN[1:],label="Cranck-Nicholson method") plt.plot(np.log10(Ptab[1:]),np.log10(errtab_imp[1:]),label="Error, Euleur explicit method", marker="+") plt.plot(np.log10(Ptab[1:]),alpha_imp*np.log10(Ptab[1:])+beta_imp, label="Regression of the error for the Euleur explicit method",marker="+") plt.plot(np.log10(Ptab[1:]),np.log10(errtab_CN[1:]),label="Error, Cranck-Nicholson method",marker="+") plt.plot(np.log10(Ptab[1:]),alpha_CN*np.log10(Ptab[1:])+beta_CN, label="Regression of the error for the Cranck-Nicholson method",marker="+") plt.xlabel("ln(P)") plt.ylabel("ln(max error)") plt.legend() plt.grid() ``` <IPython.core.display.Javascript object> ```python plt.close() ``` $\color{blue}{\textrm{REPONSE 7}\\}$ Soit $\epsilon$ l'erreur considérée. A l'aide du script précédent on remarque que le logarithme de l'erreur peut être appproché par une fonction affine du logarithme de P. En effet, les résidus des deux régressions linéaires sont très petits devant 1. $\begin{equation} \log(\epsilon)=\alpha \log(P) + \beta \Rightarrow \epsilon = (\frac{T}{\Delta_t})^{\alpha}10^{\beta} \end{equation}$ ```python print("Pour le schéma d'Euleur explicite, l'erreur décroit en \Delta_t à la puissance", round(-alpha_imp,2)) print("Pour le schéma de Cranck-Nicholson, l'erreur décroit en \Delta_t à la puissance",round(-alpha_CN,2)) ``` Pour le schéma d'Euleur explicite, l'erreur décroit en \Delta_t à la puissance 1.86 Pour le schéma de Cranck-Nicholson, l'erreur décroit en \Delta_t à la puissance 4.03 # III- Etude de l'évolution de l'erreur en fonction de la discrétisation en espace Dans cette partie, nous étudions l'effet de la discrétisation en espace sur l'approximation donnée par la méthode des éléments finis. Nous allons fixer la discrétisation en temps, c'est-à-dire la valeur de $P$ (et donc du pas de temps). ```python #Valeur de P fixée dans cette partie P = 100 dt = Deltat(P) ``` Comme précédemment, nous commençons par fixer une très grande valeur $N_{h_{ref}}$ de référence et nous calculons la solution de référence associée avec un schéma de Cranck-Nicholson. Nous allons supposer que cette solution est suffisamment proche de la solution exacte pour pouvoir la comparer à d'autres solutions calculées pour des valeurs de $N_h$ beaucoup plus faibles que $N_{h_{ref}}$. 1) Remarquez que nous avons ci-dessous choisi $N_{h_{ref}}$ de telle sorte que $h_{ref} = 2^{-K_{ref}}$. Que vaut $K_{ref}$? $\color{blue}{\textrm{REPONSE 1}\\}$ $\begin{equation} K_{ref}=-\frac{ln(h_{ref})}{ln(2))} \end{equation}$ ```python #Valeur Nhref de référence et calcul de la solution de la chaleur associée avec un schéma de Cranck-Nicholson Nhref = 1024 -1 xvec = xgrid(Nhref) Kref=-np.log(1/(Nhref+1))/np.log(2) print('K_ref est égal à '+str(Kref)) ``` K_ref est égal à 10.0 Ce calcul de référence peut être assez long. Ne vous étonnez pas si celui-ci prend quelques minutes. ```python Wref = sol_chaleur(Nhref,P,0.5) ``` 2) Prouver que pour tout entier $1\leq k \leq K_{ref}$, $V_{2^{-k}} \subset V_{2^{-K_{ref}}}$. Montrer aussi que pour tout $k\in \mathbb{N}^*$, $N_{2^{-k}} = 2^k -1$. $\color{blue}{\textrm{REPONSE 2.1}\\}$ Montrons que pour tout entier $1\leq k \leq K_{ref}$, $V_{2^{-k}} \subset V_{2^{-K_{ref}}}$ Pour $\Omega=(0,1)$ h représente en fait le pas de discrétisation spatial. D'après l'énoncé, on a en effet $h=\frac{1}{N_h+1}$. Ainsi $V_{2^{-k}}$ représente la base de discrétisation de l'espace (0,1) en éléments de taille $h=2^{-k}$. De même, $V_{2^{-K_{ref}}}$ est la base de discrétisation de l'espace (0,1) en éléments de taille $h_{ref}=2^{-K_{ref}}$. Puisque $k$ et $K_{ref}$ sont des entiers on peut montrer que $h=h_{ref}2^m$ avec $m$ un entier. Donc le pas de discretisation h est $2^m$ fois plus grand que le pas de discrétisation $h_{ref}$ qui est le pas de discretisation plus fin. En d'autres termes, la discrétisation spatiale associée à $h_{ref}$ est obtenue en subdivisant chaque élément de la discrétisation associée à $h$, $2^m$ fois. Pour $N_h \in \mathbb{N}^*$, on a $V_h:= {\rm Vect}\left\{ \phi_1^h, \cdots, \phi_{N_h}^h\right\}$ On a donc $V_{2^{-k}} \subset V_{2^{-K_{ref}}}$ $\color{blue}{\textrm{REPONSE 2.2}\\}$ Montrons que pour tout $k\in \mathbb{N}^*$, $N_{2^{-k}} = 2^k -1$. $\begin{equation} h=\frac{1}{N_h+1} \Rightarrow 2^{-k}=\frac{1}{N_{2^{-k}}+1} \Rightarrow N_{2^{-k}} = 2^k -1 \end{equation}$ 3) Soit $u\in V_h$ avec $h = 2^{-k}$ pour un certain $1\leq k \leq K_{ref}$, qu'on écrit sous la forme $$ u = \sum_{i=1}^{N_h} U_i \phi_i^h. $$ Déduire de la question précédente qu'il existe un vecteur $W = (W_i)_{1\leq i \leq N_{h_{ref}}}$ tel que $$ u = \sum_{i=1}^{N_{h_{ref}}} W_i \phi_i^{h_{ref}}. $$ Attention! On ne demande pas de calculer $W$ en fonction de $U = (U_i)_{1\leq i \leq N_h}$! $\color{blue}{\textrm{REPONSE 3}\\}$ D'après la question précédente, $V_{2^{-k}} \subset V_{2^{-K_{ref}}}$. Ainsi, on peut écrire tout vecteur de $V_h$ comme un vecteur de $V_{2^{-K_{ref}}}$. Si $u = \sum_{i=1}^{N_h} U_i \phi_i^h$ alors il existe un vecteur $W = (W_i)_{1\leq i \leq N_{h_{ref}}}$ tel que $u = \sum_{i=1}^{N_{h_{ref}}} W_i \phi_i^{h_{ref}}$. Le but des lignes de code suivantes est de calculer ce vecteur $W$ en fonction du vecteur $U$. On appellera dans la suite $W$ le vecteur des coordonnées transformées de $U$. En fait, de manière plus générale, la fonction suivante transforme un tableau Utab de taille $N_h * k$ en un tableau Wtab de taille $N_{h_{ref}} * k$ de telle sorte que la $j^{eme}$ colonne de Wtab soit le vecteur des coordonnées transformées de la $j^{eme}$ colonne de Utab. ```python ## Fonction qui transforme un vecteur U de taille Nh = 2^{k}-1 correspondant aux paramètres de discrétisation d'une grille grossière ## en un vecteur W de taille Nhref = 2^{Kref}-1 correspondant aux paramètres de discrétisation d'une grille fine ## Il faut que Nref + 1 = 2^p * (N+1) pour un certain entier p ## Plus généralement, cette fonction prend un tableau U de taille Nh *k et le transforme en ## un tableau W de taille Nhref * k. ## Attention! Surtout ne pas modifier cette fonction. def convert(Utab): K = Utab.shape; k = K[1]; N = K[0]; M = 2*(N+1); Utemp = np.zeros((N+2,k)); Utemp[1:(N+1),:] = Utab; Ntemp = N+1; while (M <= (Nhref+1)): Wnew = np.zeros((M-1,k)); for i in range(0,Ntemp-1): Wnew[2*i,:] = 0.5*(Utemp[i,:] + Utemp[i+1,:]); Wnew[2*i+1,:] = Utemp[i+1,:]; Wnew[2*Ntemp-2,:] = 0.5*(Utemp[Ntemp-1,:] + Utemp[Ntemp,:]); Utemp = np.zeros((M+1,k)); Utemp[1:M,:] = Wnew; Ntemp = 2*Ntemp; M = 2*M; return Wnew; ``` Le but des lignes de code suivantes est de tester cette fonction convert. 4) Quel test sommes-nous en train d'effectuer dans la cellule de code ci-dessous? Est-ce que le résultat vous semble raisonnable? $\color{blue}{\textrm{REPONSE 4}\\}$ Dans le code ci-dessous on dispose tout d'abord d'une discretisation de l'espace (0,1) en deux éléments. Notons que l'on pourrait discrétiser l'espace avec un pas plus fin en écrivant Utab=np.zeros(($2^k$-1,1)) avec k un entier. Ensuite, la ligne de code Utab[0,0] = 1 permet de dire que la valeur de la solution u est égale à 1 pour $x=\Delta_x=h$, c'est à dire entre le premier et le second élement. La ligne de code suivante fait appel à la fonction Wtab. Comme c'est indiqué en commentaire, cette fonction transforme un vecteur U de taille Nh = 2^{k}-1 correspondant aux paramètres de discrétisation d'une grille grossière en un vecteur W de taille Nhref = 2^{Kref}-1 correspondant aux paramètres de discrétisation d'une grille fine. Les dernières lignes de code ont pour but d'afficher la fonction u sur le nouvel espace de discrétisation. On vérifie ainsi que la solution présente bien l'allure attendue. ```python ##Test pour vérifier que la fonction convert fonctionne bien Utab = np.zeros((1,1)) print("Nombre d'élements initiaux :", len(Utab)+1) Utab[0,0] = 1 Wtab = convert(Utab) plt.plot(xvec, Wtab) plt.show() print("Nombre d'élements finaux :", len(Wtab)+1) ``` Nombre d'élements initiaux : 2 <IPython.core.display.Javascript object> Nombre d'élements finaux : 1024 ```python plt.close() ``` Dans la suite du code, nous allons tracer l'évolution des erreurs $$ \|u_h - u_{h_{ref}}\|_{L^2(]0,T[,H^1_0(0,1))} $$ et $$ \max_{t\in [0,T]} \|u_h(t) - u_{h_{ref}}(t)\|_{L^2(0,1)} $$ en fonction de $h$ pour des valeurs de $h$ bien plus grandes que $h_{ref}$, ou du moins une approximation de ces normes. Pour cela, une première étape va être de calculer la norme $L^2(0,1)$ et la norme $H^1_0(0,1)$ d'un élement de $V_{h_{ref}}$. 5) Soit $u\in V_{h_{ref}}$ tel que $$ u = \sum_{i=1}^{N_{h_{ref}}} U_i \phi_i^{h_{ref}}. $$ Montrer que $$ \|u \|_{L^2(0,1)}^2 = U^T S_{h_{ref}} U $$ et que $$ \left\|\frac{d}{dx}u\right\|^2_{L^2(0,1)} = U^T K_{h_{ref}}U, $$ où $U = (U_i)_{1\leq i \leq N_{h_{ref}}}$. $\color{blue}{\textrm{REPONSE 5}\\}$ Montrons que $ \|u \|_{L^2(0,1)}^2 = U^T S_{h_{ref}} U$ : $\begin{array}{lcl} \|u \|_{L^2(0,1)}^2&=& \langle \sum_{i=1}^{N_{h_{ref}}} U_i \phi_i^{h_{ref}}, \sum_{j=1}^{N_{h_{ref}}} U_j \phi_j^{h_{ref}}\rangle_{L^2(0,1)} \\ \|u \|_{L^2(0,1)}^2&=& \sum_{i=1}^{N_{h_{ref}}}\sum_{j=1}^{N_{h_{ref}}} U_i \langle\phi_i^{h_{ref}},\phi_j^{h_{ref}}\rangle_{L^2(0,1)} U_j \\ \|u \|_{L^2(0,1)}^2&=& U^T S_{h_{ref}} U \end{array}$ Montrons que $\left\|\frac{d}{dx}u\right\|^2_{L^2(0,1)} = U^T K_{h_{ref}}U$ : $\begin{array}{lcl} \left\|\frac{d}{dx}u\right\|^2_{L^2(0,1)}&=& \langle\frac{d}{dx} \sum_{i=1}^{N_{h_{ref}}} U_i \phi_i^{h_{ref}}, \frac{d}{dx}\sum_{j=1}^{N_{h_{ref}}} U_j \phi_j^{h_{ref}}\rangle_{L^2(0,1)} \\ \left\|\frac{d}{dx}u\right\|^2_{L^2(0,1)}&=& \sum_{i=1}^{N_{h_{ref}}}\sum_{j=1}^{N_{h_{ref}}} U_i \langle\frac{d}{dx}\phi_i^{h_{ref}},\frac{d}{dx}\phi_j^{h_{ref}}\rangle_{L^2(0,1)} U_j \\ \left\|\frac{d}{dx}u\right\|^2_{L^2(0,1)}&=& U^T K_{h_{ref}} U \end{array}$ Remplir les lignes de code correspondantes dans les cellules ci-dessous. ```python ##Calcule \|u\|_{L^2(0,1)} # Ici U est un tableau de taille Nhref def normL2_space(U,Nhref): Shref = Sh(Nhref) return np.sqrt(np.dot(np.dot(Shref,U),U)) ``` ```python ##Calcule \|d_x u\|_{L^2(0,1)} # Ici U est un tableau de taille Nhref def normL2_derivative_space(U,Nhref): Khref = Kh(Nhref) return np.sqrt(np.dot(np.dot(Khref,U),U)) ``` Dans la suite, pour une fonction $u\in L^2(]0,T[, V_{h_{ref}})$ suffisamment régulière, nous allons approcher la quantité $$ \|u \|_{L^2(]0,T[; L^2(0,1))}^2 $$ par une formule des trapèzes en temps, c'est-à-dire par $$ A_1:=\frac{1}{2}\Delta t\|u(t_0)\|_{L^2(0,1)}^2 + \sum_{p=1}^{P-1} \Delta t \|u(t_p)\|_{L^2(0,1)}^2 + \frac{1}{2}\Delta t\|u(t_P)\|_{L^2(0,1)}^2. $$ Le temps initial $t_0=0$ et le temps final $t_P=T$ sont donc pris en compte avec un facteur moitié. De la même manière, nous allons approcher $$ \left\|\frac{d}{dx}u \right\|_{L^2(]0,T[; L^2(0,1))}^2 $$ par $$ A_2:=\frac{1}{2}\Delta t \left\|\frac{d}{dx}u(t_0)\right\|_{L^2(0,1)}^2 + \sum_{p=1}^{P-1} \Delta t \left\|\frac{d}{dx}u(t_p)\right\|_{L^2(0,1)}^2 + \frac{1}{2}\Delta t\left\|\frac{d}{dx}u(t_P)\right\|_{L^2(0,1)}^2. $$ Ainsi, la quantité $\|u \|_{L^2(]0,T[; H_0^1(0,1))}^2$ sera approchée par $A_1+A_2$. Remplir l'expression de ces normes en utilisant les fonctions normL2_space et normL2_derivative_space définies précédemment. Attention à ne pas calculer les normes au carré, mais bien les normes! ```python ##Calcule l'approximation de \|u\|_{L^2(]0,T[,L^2(0,1))} # Ici U est un tableau de taille Nhref * (P+1) def normL2_space_time(U,Nhref,P): a10=0.5*dt*normL2_space(U[:,0],Nhref)**2 a1P=0.5*dt*normL2_space(U[:,P],Nhref)**2 a1=0 for k in range (1,P): a1+=dt*normL2_space(U[:,k],Nhref)**2 return np.sqrt(a10+a1+a1P) ``` ```python ##Calcule l'approximation de \|\d_x u\|_{L^2(]0,T[,L^2(0,1))} # Ici U est un tableau de taille Nhref * (P+1) def normL2_derivative_space_time(U,Nhref,P): a20=0.5*dt*normL2_derivative_space(U[:,0],Nhref)**2 a2P=0.5*dt*normL2_derivative_space(U[:,P],Nhref)**2 a2=0 for k in range (1,P): a2+=dt*normL2_derivative_space(U[:,k],Nhref)**2 return np.sqrt(a20+a2+a2P) ``` ```python ##Calcule l'approximation de \|u\|_{L^2(]0,T[,H^1_0(0,1))} # Ici U est un tableau de taille Nhref * (P+1) def normH1_space_time(U,Nhref,P): return np.sqrt(normL2_space_time(U,Nhref,P)**2+normL2_derivative_space_time(U,Nhref,P)**2) ``` Passons maintenant au calcul de ces erreurs. Nous n'utiliserons ici que le schéma de Cranck-Nicholson pour la discrétisation en temps. Remplir les lignes de code correspondantes. ```python ## Contient les différentes valeurs de Nh pour lesquelles nous allons calculer les erreurs Nhtab = [2-1,4-1,8-1,16-1,32-1,64-1,128-1, 256-1] ##Tableaux qui vont contenir les valeurs des différentes erreurs obtenues ## soit max en temps et L^2 en espace errtab_max_L2_Nh = [] ## soit L^2 en temps et H^1_0 en espace errtab_L2_H10_Nh = [] for Nh in Nhtab: U = sol_chaleur(Nh,P,0.5) # contient l'approximation de la solution de la chaleur pour Nh et P # convertit les coordonnées de U dans la base des \phi_i^h en ses coordonnées transformées dans la base des \phi_i^{h_{ref}} W = convert(U) err_max_L2 = 0; for p in range(1,P+1): #Contient l'erreur L^2 en espace à l'instant t_p entre la solution calculée avec Nh et la solution calculée avec Nhref err = normL2_space(W[:,p]-Wref[:,p],Nhref) err_max_L2 = max(err_max_L2,err); errtab_max_L2_Nh.append(err_max_L2) #Contient l'erreur L^2 en temps et H^1_0 en espace entre la solution calculée avec Nh et la solution calculée avec Nhref err_L2_H10 = normH1_space_time(W-Wref,Nhref,P) errtab_L2_H10_Nh.append(err_L2_H10) ``` Les lignes de code ci-dessous permettent de tracer ces erreurs en échelle logarithmique en fonction de $N_h$ pour les deux normes choisies ci-dessus. Compléter ces lignes de code pour afficher les abscisses, les ordonnées et les labels des différentes courbes tracées. ```python plt.loglog(Nhtab,errtab_max_L2_Nh,label="errtab_max_L2_Nh",marker="+") plt.loglog(Nhtab,errtab_L2_H10_Nh,label="errtab_L2_H10_Nh",marker="+") plt.legend() plt.xlabel("$N_h$") plt.ylabel("$\epsilon$") plt.grid() plt.show() ``` <IPython.core.display.Javascript object> ```python plt.close() ``` ```python #Regression linéaire pour l'erreur L^2 en espace #On retire les premiers points car ils ne suivent pas la tendance globale de la courbe. reg_L2=np.polyfit(np.log10(Nhtab[1:]),np.log10(errtab_max_L2_Nh[1:]),1,rcond=False, full=True) alpha_L2=reg_L2[0][0] beta_L2=reg_L2[0][1] residuals_L2=reg_L2[1][0] print("alpha_L2=",alpha_L2) print("beta_L2=",beta_L2) print("residuals_L2",residuals_L2,'\n') #Regression linéaire pour l'erreur L^2 en temps et H^1_0 en espace #On retire les premiers points car ils ne suivent pas la tendance globale de la courbe. reg_L2_H1=np.polyfit(np.log10(Nhtab[1:]),np.log10(errtab_L2_H10_Nh[1:]),1,rcond=False, full=True) alpha_L2_H1=reg_L2_H1[0][0] beta_L2_H1=reg_L2_H1[0][1] residuals_L2_H1=reg_L2_H1[1][0] print("alpha_L2_H1=",alpha_L2_H1) print("beta_L2_H1=",beta_L2_H1) print("residuals_L2_H1",residuals_L2_H1,'\n') ``` alpha_L2= -1.8949796728728743 beta_L2= -1.182652751995043 residuals_L2 0.012532414739740207 alpha_L2_H1= -0.9449184614223167 beta_L2_H1= -0.7586494211484436 residuals_L2_H1 0.004004090331639706 6) A quelle vitesse en fonction de $h$ décroissent les erreurs $$ \max_{t\in[0,T]} \|u(t) - u_h(t)\|_{L^2(0,1)} $$ et $$ \| u - u_h \|_{L^2([0,T], H^1_0(0,1))} $$ (ou plutôt leurs approximations discrétisées en temps)? Si besoin faire une régression linéaire. $\color{blue}{\textrm{REPONSE 6}\\}$ Soit $\epsilon$ l'erreur considérée. A l'aide du script précédent on remarque que le logarithme de l'erreur peut être appproché par une fonction affine du logarithme de P. En effet, les résidus des deux régressions linéaires sont très petits devant 1. $\begin{equation} \log(\epsilon)=\alpha \log(N_h) + \beta \Rightarrow \epsilon = N_h^{\alpha}10^{\beta} \end{equation}$ ```python print("Pour l'erreur L^2 en espace, l'erreur décroit en N_h à la puissance", -round(alpha_L2,2)) print("Pour l'erreur L^2 en temps et H^1_0 en espace, l'erreur décroit en N_h à la puissance", -round(alpha_L2_H1,2)) ``` Pour l'erreur L^2 en espace, l'erreur décroit en N_h à la puissance 1.89 Pour l'erreur L^2 en temps et H^1_0 en espace, l'erreur décroit en N_h à la puissance 0.94 ```python plt.plot(np.log10(Nhtab[1:]),np.log10(errtab_max_L2_Nh[1:]),label="$\epsilon_1$, error max in time and $L^2$ in space", marker="+") plt.plot(np.log10(Nhtab[1:]),alpha_L2*np.log10(Nhtab[1:])+beta_L2,label="$\epsilon_1$ reg", marker="+") plt.plot(np.log10(Nhtab[1:]),np.log10(errtab_L2_H10_Nh[1:]),label="$\epsilon_2$, error $L^2$ in time and $H^1_0$ in space",marker="+") plt.plot(np.log10(Nhtab[1:]),alpha_L2_H1*np.log10(Nhtab[1:])+beta_L2_H1,label="$\epsilon_2$ reg", marker="+") plt.grid() plt.xlabel("log$(N_h)$") plt.ylabel("log$(\epsilon)$") plt.legend() ``` <IPython.core.display.Javascript object> <matplotlib.legend.Legend at 0x1aab9c2f1c8> ```python plt.close() ``` # IV- Méthode Proper Orthogonal Decomposition Le but de la dernière partie de ce TP est de vous présenter une introduction à la méthode de réduction de modèles appelée Proper Orthogonal Decomposition. Celle-ci est typiquement utilisée dans le contexte suivant: imaginez que vous ayez besoin d'approcher numériquement la solution d'une équation de la chaleur dans un milieu hétérogène du type $$ \left\{ \begin{array}{ll} \partial_t u(t,x) - \partial_x (c(x) \partial_x u(t,x)) = f(t,x), & \quad (t,x)\in ]0,T[\times (0,1)\\ u(0,x) = g(x), & \quad x\in (0,1),\\ \end{array} \right. $$ pour un grand nombre de fonctions $c:(0,1) \to \mathbb{R}$, appelées coefficient de diffusion. Nous ferons ici l'hypothèse que tous ces coefficients de diffusion vérifieront l'hypothèse qu'il existe $0< \alpha, \beta < +\infty$ tels que $$ \alpha \leq c(x) \leq \beta. $$ Nous admettrons que sous ces hypothèses, il existe toujours une unique solution faible au problème ci-dessus. La méthode POD consiste à: Etape 1: Résoudre numériquement avec une méthode d'éléments finis (avec une discrétisation spatiale a priori très fine) l'équation ci-dessus pour une valeur du coefficient de diffusion $c_0(x)$ particulière. Dans notre cas, nous prendrons $c_0(x) = 1$, de sorte que le problème ci-dessus sera tout simplement l'équation de la chaleur vue dans les premières parties du TP. Notons $u_0(t,x)$ la solution de cette équation. Etape 2: Calculer la décomposition en composantes principales (vue dans le DM) de la fonction $u_0(t,x)$. Plus précisément pour une certaine valeur $n\in \mathbb{N}^*$, nous allons calculer $(e_1,\cdots,e_n)\in H^1_0(0,1)$ de telle sorte que $$ A_{u_0} e_k = \mu_k e_k $$ où $A_{u_0}$ est l'opérateur défini dans le DM pour l'espace $V = H^1_0(0,1)$. Etape 3: L'équation ci-dessus (avec un coefficient de diffusion $c$ quelconque) est approchée numériquement par une méthode de Galerkin utilisant l'espace de discrétisation $V^n:= {\rm Vect}\{e_1, \cdots, e_n\}$ où les fonctions $e_1, \cdots, e_n$ sont celles qui ont été calculées à l'étape 2 (ou une approximation numérique de celles-ci). Le but de cette dernière partie du TP est d'étudier numériquement le comportement de cette méthode. Commençons par la mise en oeuvre de l'étape 1 de la méthode POD. Commençons par résoudre l'équation de la chaleur pour une certaine valeur de $N_h$ et $P$. On utilisera toujours ici un schéma de Cranck-Nicholson. ```python ##Nouvelles valeurs de Nh et P qui seront fixées une fois pour toutes dans la suite Nh = 299 P = 500 dt = Deltat(P) dx = Deltax(Nh) U_0 = sol_chaleur(Nh,P,0.5) ``` Passons maintenant à l'étape 2 de la méthode POD: nous allons calculer la décomposition en valeurs singulières (approchée) de $u_0(t,x)$ en utilisant la méthode décrite dans votre DM préparatoire. Nous reprenons ici les mêmes notations que dans votre DM et notons, pour tout $n\in \mathbb{N}^*$, $(\mu_n^{app}, E_n^{app})\in \mathbb{R}\times \mathbb{R}^{N_h}$ les solutions du problème aux valeurs propres généralisés $$ B^{app}E_n^{app} = \mu_n^{app} M E_n^{app} $$ où les matrices $B^{app}$ et $M$ sont les matrices définies dans la deuxième partie du DM. On rappelle que $\mu_n^{app}$ est une approximation de $\mu_n$ la $n^{eme}$ plus grande valeur propre de l'opérateur $A_{u_0}$ et que $$ e_n^{app}:= \sum_{i=1}^{N_h} E_{n,i}^{app} \phi_i^h $$ est une approximation de $e_n$, vecteur propre de $A_{u_0}$ associé à la valeur propre $\mu_n$. 1) Rappeler l'expression de la matrice $M$ introduite dans le DM. Remplir son expression dans les lignes de code ci-dessous $\color{blue}{\textrm{REPONSE 1}\\}$ La matrice M est définie de la manière suivante : $M=(\langle \phi_i,\phi_j\rangle_{L^2(0,1)})_{1\leq i,j\leq N} $ Donc $M=S_h$ ```python M = Sh(Nh) ``` 2) Rappeler l'expression de la matrice $C$ introduite dans le DM. Remplir son expression dans les lignes de code ci-dessous. $\color{blue}{\textrm{REPONSE 2}\\}$ Si on écrit $u(t)=\sum_{i=1}^{N_h}c_i(t)\phi_i$, la colonne p de C donne le vecteur $c(t_p)$. Puisque $U_0$ est la matrice dont la pième colonne est égale à $c(t_p)$ on montre que $U_0=C$. ```python C=U_0 ``` 3) Rappeler l'expression de la matrice $B^{app}$ introduite dans le DM. Remplir son expression dans les lignes de code ci-dessous. $\color{blue}{\textrm{REPONSE 3}\\}$ La matrice $B^{app}$ est définie de la manière suivante : $B^{app}=\Delta_t MC(MC)^T$ ```python B1=np.dot(M,C) B2=np.transpose(B1) Bapp=dt*np.dot(B1,B2) ``` Dans les lignes de code ci-dessous, on calcule la décomposition en composantes principales (approchée) du signal $u_0$. On rappelle que celle-ci est obtenue en résolvant un problème aux valeurs propres généralisés. ```python #On calcule la décomposition en composantes principales du signal U_0 print("Calcul de la décomposition en composantes principales du signal U_0") vals, vecs = LS.eigh(Bapp,M) ``` Calcul de la décomposition en composantes principales du signal U_0 Les lignes de code suivantes permettent de tracer les valeurs propres $(\mu_n)_{1\leq n \leq N_h}$ en fonction de $n$. Attention! Celles-ci sont automatiquement ordonnées de la valeur la plus petite à la plus grande (donc l'ordre inverse de celui que l'on souhaiterait). Compléter ces lignes de code pour afficher les abscisses, ordonnées et labels. ```python #Vals_rev contient les valeurs propres ordonées dans l'ordre décroissant. plt.semilogy(np.linspace(1,Nh,Nh), vals, label="eigen values") plt.ylabel("$\mu_n$") plt.xlabel("n") plt.legend() plt.grid() plt.show() ``` <IPython.core.display.Javascript object> ```python plt.close() ``` 4) Qu'observez-vous quant à la vitesse de décroissance des $(\mu_n)_{1\leq n \leq N_h}$? $\color{blue}{\textrm{REPONSE 4}\\}$ En traçant l'évolution les valeurs propres $(\mu_n)_{1\leq n \leq N_h}$ en fonction de $n$ sur une échelle semilog, on distingue trois comportements : -Pour un premier affinement du maillage on observe une croissance rapide du logarithme des valeurs propres en fonction du nombre d'éléments du maillage. -Pour un second rafinement du maillage, on observe une croissance quasi linéaire où le logarithme des valeurs propres évolue proportionnellement en fonction du nombre d'éléments du maillage. -Enfin pour un dernier raffinement du maillage, on observe une explosion exponentielle du logarithme des valeurs propres en fonction du nombre d'éléments du maillage. Nous pouvons maintenant passer à l'étape 3 de la méthode POD. Nous rappelons que pour tout $1\leq n\leq N_h$, on définit $$ e_n^{app}:= \sum_{i=1}^{N_h} (E_n^{app})_i \phi^h_i. $$ Nous allons commencer par étudier l'erreur d'approximation d'une méthode de Galerkin associée à l'espace $V^n = {\rm Vect}\{e_1^{app}, \cdots, e_n^{app}\}$ dans le cas où le coefficient de diffusion est égal à $c(x) = c_0(x) = 1$. Mais il faut garder en tête que, dans la méthode POD en pratique, si la valeur du coefficient de diffusion $c(x)$ est modifiée, l'espace de discrétisation reste quant à lui inchangé, ce qui fait qu'on ne calcule la décomposition en composantes principales que d'un seul signal. Cela fera l'objet de la dernière question du TP. Nous notons dans la suite $u^n$ la solution approchée de l'équation obtenue par l'approximation de Galerkin dans l'espace discrétisé $V^n$. Pour presque tout $t\in [0,T]$, soit $D(t):=(d_1(t), \cdots, d_n(t)) \in \mathbb{R}^n$ les coordonnées de $u^n(t)$ dans la base $(e_1^{app}, \cdots, e_n^{app})$. Nous noterons dans la suite, pour une certaine valeur de $1\leq n\leq N_h$, les matrices $K^n:=(K^n_{kl})_{1\leq k,l \leq n},\; S^n:=(S^n_{kl})_{1\leq k,l \leq n} \in \mathbb{R}^{n\times n}$ définies par $$ S^n_{kl} = \langle e^{app}_k, e^{app}_l \rangle_{L^2(0,1)} \quad \mbox{ et } \quad K_{kl} = \int_0^1 \frac{d}{dx}e_k^{app}(x) \frac{d}{dx}e_l^{app}(x)\,dx. $$ On note $E^n$ la matrice de taille $N_h \times n$ dont la $k^{eme}$ colonne est donnée par le vecteur $E^{app}_k$. 5) Montrer que $$ S^n = (E^n)^T S_h E^n \quad \mbox{ et } \quad K^n = (E^n)^T K_h E^n. $$ $\color{blue}{\textrm{REPONSE 5}\\}$ $\color{blue}{\textrm{Calcul de} \ S^n\\}$ Pour tout $1\leq i\leq N_h : (S_hE^n)_i = \sum_{k=1}^{N_h}(S_h)_{ik}(E^n)_{kj}= \sum_{k=1}^{N_h}\langle \phi_i,\phi_k\rangle_{L^2(0,1)} (E_j^{app})_k$ Pour tout $1\leq i,j\leq N_h :$ $\begin{array}{lcl} ((E^n)^T S_h E^n)_{ij}&=&\sum_{k=1}^{N_h}((E^n)^T)_{ik}(S_h E^n)_{kj}\\ ((E^n)^T S_h E^n)_{ij}&=&\sum_{k=1}^{N_h}(E^n)_{ki}(S_h E^n)_{kj}\\ ((E^n)^T S_h E^n)_{ij}&=&\sum_{k=1}^{N_h}(E_i^{app})_k \sum_{l=1}^{N_h}\langle \phi_k,\phi_l\rangle_{L^2(0,1)} (E_j^{app})_l\\ ((E^n)^T S_h E^n)_{ij}&=&\langle\sum_{k=1}^{N_h}(E_i^{app})_k\phi_k,\sum_{l=1}^{N_h}(E_j^{app})_l\phi_l\rangle_{L^2(0,1)}\\ ((E^n)^T S_h E^n)_{ij}&=&\langle e_i^{app},e_j^{app}\rangle_{L^2(0,1)}\\ ((E^n)^T S_h E^n)_{ij}&=&S^n_{ij} \end{array}$ $\color{blue}{\textrm{Calcul de} \ K^n\\}$ Pour tout $1\leq i\leq N_h : (K_hE^n)_i = \sum_{k=1}^{N_h}(K_h)_{ik}(E^n)_{kj}= \sum_{k=1}^{N_h}\int_0^1 \frac{d}{dx}\phi_i^h(x) \frac{d}{dx}\phi_k^h(x)\,dx. (E_j^{app})_k$ Pour tout $1\leq i,j\leq N_h :$ $\begin{array}{lcl} ((E^n)^T K_h E^n)_{ij}&=&\sum_{k=1}^{N_h}((E^n)^T)_{ik}(K_h E^n)_{kj}\\ ((E^n)^T S_h E^n)_{ij}&=&\sum_{k=1}^{N_h}(E^n)_{ki}(K_h E^n)_{kj}\\ ((E^n)^T S_h E^n)_{ij}&=&\sum_{k=1}^{N_h}(E_i^{app})_k \sum_{l=1}^{N_h}\int_0^1 \frac{d}{dx}\phi_k^h(x) \frac{d}{dx}\phi_l^h(x)\,dx. (E_j^{app})_l \\ ((E^n)^T S_h E^n)_{ij}&=&\int_0^1 \frac{d}{dx}[\sum_{k=1}^{N_h}(E_i^{app})_k \phi_k^h(x)] \frac{d}{dx}[\sum_{l=1}^{N_h}(E_j^{app})_l\phi_l^h(x)]\,dx. \\ ((E^n)^T S_h E^n)_{ij}&=&\int_0^1\frac{d}{dx}e_i^{app}(x) \frac{d}{dx}e_j^{app}(x)\,dx.\\ ((E^n)^T S_h E^n)_{ij}&=&K^n_{ij} \end{array}$ 6) Montrer que le vecteur $D(t)$ est solution de l'EDO $$ S^n \frac{d}{dt}D(t) + K^n D(t) = F^n(t) $$ où $$ F^n(t) = (E^n)^T F_h(t). $$ $\color{blue}{\textrm{REPONSE 6}\\}$ Soit $1\leq j\leq N_h$, $u^n$ est solution de : $\langle \frac{d}{dt}u^n(t),e_j^{app}\rangle_{L^2(0,1)}+\int_0^1\frac{d}{dx}u^n(t) \frac{d}{dx}e_j^{app}(x)\,dx = \langle f(t),e_j^{app}\rangle_{L^2(0,1)}$ $\begin{array}{lcl} \langle \frac{d}{dt}u^n(t),e_j^{app}\rangle_{L^2(0,1)}&=&\frac{d}{dt}\langle \sum_i^n d_i(t)e_i^{app} ,e_j^{app}\rangle_{L^2(0,1)}\\ &=&\sum_i^n \langle e_i^{app} ,e_j^{app}\rangle_{L^2(0,1)} \frac{d}{dt} d_i(t) \\ &=&\sum_i^n S^n_{ij}(\frac{d}{dt}D(t))_i\\ &=&\sum_i^n S^n_{ji}(\frac{d}{dt}D(t))_i\\ &=&(S^n\frac{d}{dt}D(t))_j \end{array}$ $\begin{array}{lcl} \int_0^1\frac{d}{dx}u^n(t) \frac{d}{dx}e_j^{app}(x)\,dx&=&\int_0^1\frac{d}{dx}\sum_i^n d_i(t)e_i^{app} \frac{d}{dx}e_j^{app}(x)\,dx\\ &=&\sum_i^n\int_0^1\frac{d}{dx}e_i^{app} \frac{d}{dx}e_j^{app} d_i(t)\\ &=&\sum_i K^n_{ji}(D(t))_i\\ &=&(K^nD(t))_j \end{array}$ $\begin{array}{lcl} \langle f(t),e_j^{app}\rangle_{L^2(0,1)}&=&\langle f(t),\sum_{i=1}^{N_h} (E_j^{app})_i \phi^h_i.\rangle_{L^2(0,1)} \\ &=&\sum_{i=1}^{N_h} (E_j^{app})_i \langle f(t),\phi^h_i.\rangle_{L^2(0,1)}\\ &=&\sum_{i=1}^{N_h} ((E^n)^T)_{ji} \langle f(t),F_h(t)_i\\ &=&(F^n(t))_j \end{array}$ Donc le vecteur $D(t)$ est solution de l'EDO $ S^n \frac{d}{dt}D(t) + K^n D(t) = F^n(t)$. 7) Montrer que $$ F^n(t) = r(t) \overline{F}^n, $$ où $$ \overline{F}^n = (E^n)^T \overline{F}_h. $$ $\color{blue}{\textrm{REPONSE 7}\\}$ $\begin{array}{lcl} F^n(t)&=&(E^n)^TF_h(t)\\ F^n(t)&=&(E^n)^T r(t)\overline{F_h}\\ F^n(t)&=&r(t)(E^n)^T \overline{F_h}\\ F^n(t)&=&r(t)\overline{F}^n\\ \end{array}$ 8) Ecrire l'expression du $\theta$-schéma associé à un pas de temps $\Delta t>0$ pour résoudre l'EDO dont $D(t)$ est solution. $\color{blue}{\textrm{REPONSE 8}\\}$ Soit $p \in \mathbb{N}^*$, notons $D^p$ l'approximation de $D(t_p)$ où $t_p=p\Delta_t>0$. L'expression du $\theta$-schéma dont D(t) est solution est donnée ci-dessous : $\begin{equation} S_n \frac{D^{p+1}-D^p}{\Delta_t}+K_n(\theta D^{p+1}+(1-\theta)D^p)=\theta F^n(t_{p+1})+(1-\theta)F^n(t_p) \end{equation}$ $\begin{equation} (S_n+\theta \Delta t K_n) D^{p+1}=(S_n-(1-\theta) \Delta t K_n) D^{p}+\Delta t\left(\theta F^n\left(t_{p+1}\right)+(1-\theta) F^n\left(t_{p}\right)\right) \end{equation}$ 9) Montrer que $D(0) = 0$. $\color{blue}{\textrm{REPONSE 9}\\}$ D'après l'équation de la chaleur et par construction de $u^n$ on montre que $u^n(0)=g=0$. Or $u^n(0)=\sum_{i=1}^n e_i^{app}d_i(0)=0$. Or la famille $(e_1^{app},...,e_n^{app})$ forme une base donc elle est libre. Ainsi, pour tout $1\leq i\leq n, d_i(0)=0$. Donc $D(0)=0$. 10) Montrer enfin que pour presque tout $t\in [0,T]$, $$ u^n(t) = \sum_{i=1}^{N_h} U^n_i(t) \phi^h_i, $$ où $U^n(t)\in \mathbb{R}^{N_h}$ est donné par $$ U^n(t) = E^n D(t). $$ $\color{blue}{\textrm{REPONSE 10}\\}$ $\begin{array}{lcl} u^n(t)&=&\sum_{j=1}^n d_j(t)e_j^{app}\\ u^n(t)&=&\sum_{j=1}^n d_j(t) \sum_{i=1}^{N_h} (E_j^{app})_i \phi^h_i.\\ u^n(t)&=&\sum_{i=1}^{N_h} \sum_{j=1}^n (E_j^{app})_i d_j(t)\phi^h_i \\ u^n(t)&=&\sum_{i=1}^{N_h} \sum_{j=1}^n (E^n)_{ij} (D(t))_j\phi^h_i \\ u^n(t)&=&\sum_{i=1}^{N_h} (E^nD(t))_i\phi^h_i \\ u^n(t)&=&\sum_{i=1}^{N_h} U^n_i\phi^h_i \\ \end{array}$ Le but des lignes de code suivantes est d'implémenter un $\theta$-schéma pour résoudre l'EDO dont le vecteur $D(t)$ est solution. Les arguments de la fonction ci-dessous sont $\theta$ et $n$. Remplir les lignes de code correspondantes. Les différentes approximations de $D(t_p)$ pour $0\leq p \leq P$ sont stockées dans un tableau appelé Dtab. La fonction renvoie un tableau Utab dans lequel sont stockées les approximations des vecteurs $U^n(t_p) = E^nD(t_p)$. ```python def sol_chaleur_POD(n,theta): #En est un tableau de taille Nh * n: la k^eme colonne de En contient le vecteur E^{app}_k En = np.zeros((Nh,n)) for k in range(0,n): En[:,k] = vecs[:,Nh-k-1] ##Définition des matrices Sn, Kn, Fbarn Sn = np.dot(En.T,np.dot(Sh(Nh),En)) Kn = np.dot(np.dot(En.T,Kh(Nh)),En) Fbarn = np.dot(En.T,Fbarh(Nh)) ## Dtab va contenir les valeurs de D^p pour tout 0\leq p \leq P Dtab = np.zeros((n,P+1)); ## Dold représente la valeur de D^p Dold = np.zeros(n) Dtab[:,0] = Dold; for p in range(0,P): B = np.dot((Sn-(1-theta)*dt*Kn),Dold)+dt*(theta*Fbarn*r((p+1)*dt)+(1-theta)*Fbarn*r(p*dt)) A = Sn+theta*dt*Kn #Dnew représente la valeur de $D^{p+1} Dnew = LA.solve(A,B) Dtab[:,p+1] = Dnew Dold = Dnew # Utab contient les coordonnées des approximations des vecteurs U^n(t_p) Utab = np.dot(En, Dtab) return Utab ``` Calculons la solution approchée de l'équation de la chaleur par la méthode POD pour $n = 5$ avec un schéma de Cranck-Nicholson. ```python Utab = sol_chaleur_POD(5, 0.5) ``` L'objectif des lignes suivantes est d'afficher une animation pour observer l'évolution de la solution approchée $u^n(t)$. ```python fig5, ax5 = plt.subplots(1, figsize = (6,6)) xPOD = xgrid(Nh) plotun, = ax5.plot(xPOD,Utab[:,0]) def animate5(p): f = Utab[:,p] plotun.set_ydata(f) def init5(): ax5.set_xlim(0,1) ax5.set_ylim(-0.3,0.3) return plotun, step = 1 steps = np.arange(1,P,step) ani = FuncAnimation(fig5, animate5,steps, init_func = init5, interval = 100, blit = True) ``` <IPython.core.display.Javascript object> ```python plt.close() ``` 11) Est-ce que la solution obtenue par la méthode POD vous semble proche visuellement de la solution de l'équation de la chaleur? Quelle est la dimension de l'espace de discrétisation utilisé ici? Quelle est la valeur de $N_h$? Commentez sur l'intérêt d'utiliser cette méthode POD ici. $\color{blue}{\textrm{REPONSE 11}\\}$ La solution obtenue par la méthode POD semble visuellement très proche de la solution de l'équation de la chaleur. A l'aide du script "Utab = sol_chaleur_POD(5, 0.5)" on génère un tableau de taille ($N_h$,$P+1$) ie de taille (299, 501). Ici $N_h$ = 299 Nous allons maintenant passer au calcul des erreurs $$ \|u_h -u^n\|_{L^2(]0,T[, H^1_0(0,1))} $$ et $$ {\max}_{t\in [0,T]}\|u_h(t) -u^n(t)\|_{L^2(0,1)} . $$ En utilisant les fonctions définies à la partie 3 du TP, remplir les lignes de code ci-dessous. ```python #Tableau qui contient les différentes valeurs de n pour lesquelles la solution approchée par méthode POD va être calculée ntab = [2,4,6,8,10,15,20,50] #Tableaux vides qui vont contenir les valeurs des différentes erreurs #soit max en temps L2 en espace errtab_max_L2_Nh = [] # soit L2 en temps et H^1_0 en espace errtab_L2_H10_Nh = [] for n in ntab: #Calcul de la solution approchée par méthode POD avec un schéma de Cranck-Nicholson Un = sol_chaleur_POD(n,0.5) err_max_L2 = 0; for p in range(1,P+1): err = normL2_space(U_0[:,p]-Un[:,p],Nh) err_max_L2 = max(err_max_L2,err); errtab_max_L2_Nh.append(err_max_L2) err_L2_H10 = normH1_space_time(U_0-Un,Nh,P) errtab_L2_H10_Nh.append(err_L2_H10) ``` Les lignes de code ci-dessous permettent de tracer ces erreurs en fonction de $n$. Compléter les abscisses, ordonnées et labels des courbes tracées. ```python plt.semilogy(ntab,errtab_max_L2_Nh,label="$\epsilon_1$, error max in time and $L^2$ in space") plt.semilogy(ntab,errtab_L2_H10_Nh, label="$\epsilon_2$, error $L^2$ in time and $H^1_0$ in space") plt.ylabel("error") plt.xlabel("n") plt.legend() plt.grid() plt.show() ``` <IPython.core.display.Javascript object> ```python plt.close() ``` 12) Comment est-ce que ces erreurs évoluent en fonction de $n$? Comparer avec les erreurs et les vitesses obtenues à la partie 3 en fonction de $h$ (ou de $N_h$). $\color{blue}{\textrm{REPONSE 12}\\}$ On observe que les deux erreurs décroissent d'abord rapidement en fonction de $n$. Pour $n\geq 20$ on observe un autre comportement puisque les erreurs décroissent alors très lentement en fonction de $n$. En effet, celles ci semblent quasiment constantes. Notons enfin que l'erreur max en temps et $L^2$ en espace est toujours inférieure à l'erreur $L^2$ en temps et $H^1_0$ en espace. De plus, on observe que ces erreurs sont bien plus faibles que celle que l'on a obtenues à la partie 3 en fonction de $N_h$. Prenons un exemple. Ici pour $n=10$, $\epsilon_1 \simeq 10^{-8}$ et $\epsilon_2 \simeq 10^{-7}$. Dans la partie 3, pour $n=10$, $\epsilon_1 \simeq 10^{-3}$ et $\epsilon_2 \simeq 10^{-2}$. Par ailleurs, en effectuant une regression linéaire sur la partie gauche de chaque courbe, on remarque également que les vitesses de décroissances des erreurs pour la méthode POD sont bien plus élevées que celles obtenues pour la partie 3. ```python #Regression linéaire pour l'erreur L^2 en espace #On retire les derniers points car ils ne nous intéressent pas pour calculer la vitesse de décroissante initiale reg_L2=np.polyfit(np.log10(ntab[:5]),np.log10(errtab_max_L2_Nh[:5]),1,rcond=False, full=True) alpha_L2=reg_L2[0][0] beta_L2=reg_L2[0][1] residuals_L2=reg_L2[1][0] print("alpha_L2=",alpha_L2) print("beta_L2=",beta_L2) print("residuals_L2",residuals_L2,'\n') #Regression linéaire pour l'erreur L^2 en temps et H^1_0 en espace #On retire les derniers points car ils ne nous intéressent pas pour calculer la vitesse de décroissante initiale reg_L2_H1=np.polyfit(np.log10(ntab[:5]),np.log10(errtab_L2_H10_Nh[:5]),1,rcond=False, full=True) alpha_L2_H1=reg_L2_H1[0][0] beta_L2_H1=reg_L2_H1[0][1] residuals_L2_H1=reg_L2_H1[1][0] print("alpha_L2_H1=",alpha_L2_H1) print("beta_L2_H1=",beta_L2_H1) print("residuals_L2_H1",residuals_L2_H1,'\n') ``` alpha_L2= -5.7027654422707235 beta_L2= -1.9683841385748617 residuals_L2 0.05048564327879834 alpha_L2_H1= -4.416231432971872 beta_L2_H1= -2.264205581493301 residuals_L2_H1 0.026268372997144074 ```python print("Pour l'erreur L^2 en espace, l'erreur décroit en n à la puissance", -round(alpha_L2,2)) print("Pour l'erreur L^2 en temps et H^1_0 en espace, l'erreur décroit en n à la puissance", -round(alpha_L2_H1,2)) ``` Pour l'erreur L^2 en espace, l'erreur décroit en n à la puissance 5.7 Pour l'erreur L^2 en temps et H^1_0 en espace, l'erreur décroit en n à la puissance 4.42 ```python plt.plot(np.log10(ntab[:5]),np.log10(errtab_max_L2_Nh[:5]),label="$\epsilon_1$, error max in time and $L^2$ in space", marker="+") plt.plot(np.log10(ntab[:5]),alpha_L2*np.log10(ntab[:5])+beta_L2,label="$\epsilon_1$ reg", marker="+") plt.plot(np.log10(ntab[:5]),np.log10(errtab_L2_H10_Nh[:5]),label="$\epsilon_2$, error $L^2$ in time and $H^1_0$ in space",marker="+") plt.plot(np.log10(ntab[:5]),alpha_L2_H1*np.log10(ntab[:5])+beta_L2_H1,label="$\epsilon_2$ reg", marker="+") plt.grid() plt.xlabel("log$(n)$") plt.ylabel("log$(\epsilon)$") plt.legend() ``` <IPython.core.display.Javascript object> <matplotlib.legend.Legend at 0x1aabbeadd08> ```python plt.close() ``` 13) (Question facultative) Nous pouvons à présent passer à l'étape 3 de la méthode POD, mais cette fois-ci pour une valeur différente du coefficient de diffusion c(x). Implémenter la méthode POD pour approcher la solution de l'équation définie en début de partie pour une valeur du coefficient de diffusion $c(x) = 2$, par une méthode de Galerkin avec l'espace de discrétisation $V^n = {\rm Vect}\{e_1^{app}, \cdots, e_n^{app}\}$. On rappelle que les étapes 1 et 2 de la méthode POD sont indépendantes du choix de $c$, qu'elles ont été faites une bonne fois pour toute (en considérant le coefficient $c_0$), et que seule l'étape 3 de la méthode POD doit être refaite ici. Calculer et afficher les différents types d'erreur étudiés dans cette partie par rapport à une solution de référence (pour calculer cette solution de référence, on pourra utiliser une approximation de Galerkin de l'équation de la chaleur avec le coefficient c sur un espace d'eléments finis Vh avec un maillage fin). ```python ```
\documentclass[../thesis.tex]{subfiles} \begin{document} \begin{quote} For the rational study of the law the blackletter man may be the man of the present, but the man of the future is the man of statistics and the master of economics. It is revolting to have no better reason for a rule of law than that so it was laid down in the time of Henry IV. It is still more revolting if the grounds upon which it was laid down have vanished long since, and the rule simply persists from blind imitation of the past. - Oliver Wendell Holmes, Jr., ``The Path of the Law'', 1897 \cite{holmes1897path}) \end{quote} This dissertation addresses one of the the great scientific, economic, and political challenge of our time: the design and regulation of the social and technical platforms such as the major commercially provided web services made available through the Internet. Its core contention is that no scholarly domain has yet comprehended the data economics driving the development and impact of this infrastructure well enough to predict and regulate its systemic impact. This scholarship labors to combine the necessary expertise in the correct mixture for progress. \section{The problem} \citet{lessig2009code} has argued that cyberspace is regulated in four modalities: technical infrastructure, social norms, the law, and the market. Each modality has its corresponding fields of academic inquiry. The construction of technical infrastructure is guided by principles from electrical engineering, computer science, and statistics. Social norms are studied in philosophy and sociology. The law is both a practice and the study of statutes and judgements. Market institutions are design according to principles of economics. It would be convenient for scholars if these domains were as distinct from each other in practice as they are in theory. Of course, they are not, and so each branch of scholarship is partial and inadequate to the task of managing the Internet. Thoughtful leadership of technical infrastructure now comes primarily from the corporate leadership of private entities that are not tied to the academic traditions that tie down the institutions of public expertise. Since what is beyond public understanding is beyond democratic legal rule, the status quo is that these corporations are only weakly governed by law and social norms. This has created a public crisis and an opportunity for scientific advance \cite{benthall2016philosophy}. \section{The form of solution} The challenge is to construct a solution to this problem. What would such a scientific theory of information infrastructure need to be, to suffice? It must develop a new formal theory of strategic information flow and demonstrate its applicability across and at the intersection of all four regulatory modalities. This is what this dissertation does (See Figure 1.1). % \ref{fig:outline} \begin{figure} \begin{center} \includegraphics{chapters/outline.eps} \label{fig:outline} \end{center} \caption[Graphical outline of this dissertation]{ A graphical outline of the dissertation. Boxed components are the four modalities of the regulation of cyberspace. Round components refer to chapters and appendices of this document. Octagonal components refer to formal constructs. Taken as a whole, the dissertation argues that these formal constructs constitute scientific progress towards an understanding of strategic data flow that is applicable across all four modalities. } \end{figure} \subsection{Social norms and technical architecture} A priori, we know that at the very least a solution must be consistent with the mathematical foundations of electrical engineering, computer science, and statistics. These are robust and objective truths that are proven by scientific practice and everyday experience. Formal, mathematical specification is a prerequisite to technical design, and we won't shy away from this desideratum. We also know that our theory must be sensitive to social norms. Herein lies the first major obstacle: the sociologists, anthropologists, and philosophers who best understand social norms are often alienated by mathematical formalism. Most (though not all) would reject the possibility that norms may be understood well enough by technologists that the latter could be adequately responsive to them. But not all. Contextual integrity (CI) is a social theory of privacy norms that has been actively offered to computer scientists as a guide to technical design. This work at the intersection of social theory and privacy engineering is the subject of Chapter \ref{chapter:CI-through-CS} of this dissertation, ``Contextual Integrity through the Lens of Computer Science'', co-authored by myself, Seda G{\"u}rses and Helen Nissenbaum \cite{benthall2017contextual}. It is a survey of computer science papers that have been inspired by CI. We compare the original social theory with its technical projection, and identify both opportunities for contextual integrity to be made more technically actionable and calls to action for computer scientists to better accomodate social processes and meaning. Contextual integrity, which is described in detail in Section \ref{CI2.1}, defines privacy as contextually appropriate information flow. It envisions a social world differentiated into multiple social contexts or spheres, each with well-defined roles, purposes, and meanings of information. In Chapter \ref{chapter:CI-through-CS}, we discover that computer scientists see the world differently. They design infrastructure for a messy reality in which information crosses contextual boundaries. In short, technical and social platforms are not well regulated by social norms because they exist outside of our shared understanding of social contexts. Chapter \ref{chapter:bridge} briefly assesses these conclusions and identifies the heart of the problem: the ambiguity inherent in our socially shared understanding of \textit{information flow}. That understanding is based on a flawed ontology in which data's meaning is contained within it. This is not the case \cite{horvitz2015data}; the meaning of information depends on the context, or contexts, in which it flows. Effective design and regulation of information infrastructure requires a scientific definition of information flow that addresses this fact precisely. \subsection{Law, technical architecture and situated information law} Such a definition of information flow is provided in Chapter \ref{chapter:origin-privacy}, ``Origin Privacy: Causality and Data Protection'', originally written as a technical report with Michael Tschantz and Anupam Datta. It is targetted at another dyad in the regulation of information infrastructure: the interaction between technical architecture and information law. This chapter builds on previous work in the automation of regulatory compliance. Businesses and other organizations are motivated to comply with privacy policies even as their information processing systems get more complex \cite{barth2007privacy} \cite{deyoung2010experiences} \cite{sen2014bootstrapping}. This business interest has driven scholarhsip in the mathematical formulation and implementation of law in computer science. The concept of information implicit in privacy policies has ambiguities that are similar to those identified in Chapter \ref{chapter:bridge}: information is sometimes restricted based on its topic, and other times restricted based on its origin. What theory of information can capture how information flows from source to destination with meanings that depend on context? Building on \citet{dretske1981knowledge} and \citet{pearl2009causality}, we posit a definition of information flow as a causal flow within a greater context of causally structure probabilistic events. The context provides each event with \textit{nomic associations}, or law-like, regular correspondences with other events in the causal system. The nomic associations are what make information useful for inference and thereby meaningful. Chapter \ref{chapter:origin-privacy} develops this theoretical understanding of situated information flow as a tool for understanding the security of information processing systems. It develops the Embedded Causal System (ECS) model, a generic way of modeling an information processing system embedded in an environment. We use this model to define variations of well-known security properties such as noninterference and semantic security in terms of Pearlian causation, and prove sufficient conditions for systems to have these properties. We consider a new class of security properties based on Origin Privacy, the principle that a system designer must control information flow based on that information's origin. We further extend this model to the GDPR's regulation of biometric data and differential privacy. We also introduce a game theoretic variation on the model which relates the causal security properties to the tactical and strategic presence of an attacker. Developing this style of strategic modeling is the project of Chapter \ref{chapter:games-and-rules}. \subsection{Information law and data economics} It is just a fact that most information infrastructure today is developed by industry, military, or both. No sufficient theory of infrastructure design can deny that there is a strategic aspect to its creation and use. Though there is a tradition of economics literature on the business of information goods \cite{shapiro1998information} \cite{varian2001economics} \cite{acquisti2016economics}, this scholarship has not captured the economics of data flow and reuse in a way that is commensurable with technical design and available to legal scholars for regulatory design. Chapter \ref{chapter:games-and-rules} fills this gap. Chapter \ref{chapter:games-and-rules} works with the definition of situated information flow introduced in Chapter \ref{chapter:origin-privacy} and builds it into a framework for economic mechanism design (detailed in Appendix \ref{appendix:maid}) using the Multi-Agent Influence Diagrams of \citet{koller2003multi}. This framework is the basis for a formal method for determining the value of information flow within a \textbf{data game}. This framework can capture well-understood economic contexts such as principal-agent contracts and price differentiation. It can also support the modeling and analysis of newly introduced economic situations, such as the provision of personalized expert services and the value of the cross-context use of personal data. The model of cross-context use of personal data reveals that when firms trade in the personal data of their users, they can benefit at their user's expense. Because the user is not a party to this transaction, effects on their welfare may be considered a market externality, which invites the discussion of what form of regulation is appropriate to fix the market deficiency. What this chapter demonstrates is that information is not, contrary to many traditional economic models, a kind of good that is consumed. Rather, information is a strategic resource, something that changes the very nature of the game played by economic actors. A thorough study of data economics through the modeling, simulation, and empirical analysis of data games may be the scholarly lens needed to understand how technical architecture, social norms, law, and the market interact and resolve in equilibrium. Chaper \ref{chapter:conclusion} concludes this dissertation with a discussion of future work. \end{document}
/- Copyright (c) 2022 Junyan Xu. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Damiano Testa, Junyan Xu ! This file was ported from Lean 3 source module data.dfinsupp.lex ! leanprover-community/mathlib commit dde670c9a3f503647fd5bfdf1037bad526d3397a ! Please do not edit these lines, except to modify the commit id ! if you have ported upstream changes. -/ import Mathlib.Data.Dfinsupp.Order import Mathlib.Data.Dfinsupp.NeLocus import Mathlib.Order.WellFoundedSet /-! # Lexicographic order on finitely supported dependent functions This file defines the lexicographic order on `Dfinsupp`. -/ variable {ι : Type _} {α : ι → Type _} namespace Dfinsupp section Zero variable [∀ i, Zero (α i)] /-- `Dfinsupp.Lex r s` is the lexicographic relation on `Π₀ i, α i`, where `ι` is ordered by `r`, and `α i` is ordered by `s i`. The type synonym `Lex (Π₀ i, α i)` has an order given by `Dfinsupp.Lex (· < ·) (· < ·)`. -/ protected def Lex (r : ι → ι → Prop) (s : ∀ i, α i → α i → Prop) (x y : Π₀ i, α i) : Prop := Pi.Lex r (s _) x y #align dfinsupp.lex Dfinsupp.Lex -- Porting note: Added `_root_` to match more closely with Lean 3. Also updated `s`'s type. theorem _root_.Pi.lex_eq_dfinsupp_lex {r : ι → ι → Prop} {s : ∀ i, α i → α i → Prop} (a b : Π₀ i, α i) : Pi.Lex r (s _) (a : ∀ i, α i) b = Dfinsupp.Lex r s a b := rfl #align pi.lex_eq_dfinsupp_lex Pi.lex_eq_dfinsupp_lex -- Porting note: Updated `s`'s type. instance [LT ι] [∀ i, LT (α i)] : LT (Lex (Π₀ i, α i)) := ⟨fun f g ↦ Dfinsupp.Lex (· < ·) (fun _ ↦ (· < ·)) (ofLex f) (ofLex g)⟩ theorem lex_lt_of_lt_of_preorder [∀ i, Preorder (α i)] (r) [IsStrictOrder ι r] {x y : Π₀ i, α i} (hlt : x < y) : ∃ i, (∀ j, r j i → x j ≤ y j ∧ y j ≤ x j) ∧ x i < y i := by obtain ⟨hle, j, hlt⟩ := Pi.lt_def.1 hlt classical have : (x.neLocus y : Set ι).WellFoundedOn r := (x.neLocus y).finite_toSet.wellFoundedOn obtain ⟨i, hi, hl⟩ := this.has_min { i | x i < y i } ⟨⟨j, mem_neLocus.2 hlt.ne⟩, hlt⟩ refine' ⟨i, fun k hk ↦ ⟨hle k, _⟩, hi⟩ exact of_not_not fun h ↦ hl ⟨k, mem_neLocus.2 (ne_of_not_le h).symm⟩ ((hle k).lt_of_not_le h) hk #align dfinsupp.lex_lt_of_lt_of_preorder Dfinsupp.lex_lt_of_lt_of_preorder theorem lex_lt_of_lt [∀ i, PartialOrder (α i)] (r) [IsStrictOrder ι r] {x y : Π₀ i, α i} (hlt : x < y) : Pi.Lex r (· < ·) x y := by simp_rw [Pi.Lex, le_antisymm_iff] exact lex_lt_of_lt_of_preorder r hlt #align dfinsupp.lex_lt_of_lt Dfinsupp.lex_lt_of_lt instance Lex.isStrictOrder [LinearOrder ι] [∀ i, PartialOrder (α i)] : IsStrictOrder (Lex (Π₀ i, α i)) (· < ·) := let i : IsStrictOrder (Lex (∀ i, α i)) (· < ·) := Pi.Lex.isStrictOrder { irrefl := toLex.surjective.forall.2 fun _ ↦ @irrefl _ _ i.toIsIrrefl _ trans := toLex.surjective.forall₃.2 fun _ _ _ ↦ @trans _ _ i.toIsTrans _ _ _ } #align dfinsupp.lex.is_strict_order Dfinsupp.Lex.isStrictOrder variable [LinearOrder ι] /-- The partial order on `Dfinsupp`s obtained by the lexicographic ordering. See `Dfinsupp.Lex.linearOrder` for a proof that this partial order is in fact linear. -/ instance Lex.partialOrder [∀ i, PartialOrder (α i)] : PartialOrder (Lex (Π₀ i, α i)) := PartialOrder.lift (fun x ↦ toLex (⇑(ofLex x))) (FunLike.coe_injective (F := Dfinsupp fun i => α i)) #align dfinsupp.lex.partial_order Dfinsupp.Lex.partialOrder section LinearOrder variable [∀ i, LinearOrder (α i)] /-- Auxiliary helper to case split computably. There is no need for this to be public, as it can be written with `Or.by_cases` on `lt_trichotomy` once the instances below are constructed. -/ private def lt_trichotomy_rec {P : Lex (Π₀ i, α i) → Lex (Π₀ i, α i) → Sort _} (h_lt : ∀ {f g}, toLex f < toLex g → P (toLex f) (toLex g)) (h_eq : ∀ {f g}, toLex f = toLex g → P (toLex f) (toLex g)) (h_gt : ∀ {f g}, toLex g < toLex f → P (toLex f) (toLex g)) : ∀ f g, P f g := Lex.rec fun f ↦ Lex.rec fun g ↦ match (motive := ∀ y, (f.neLocus g).min = y → _) _, rfl with | ⊤, h => h_eq (neLocus_eq_empty.mp <| Finset.min_eq_top.mp h) | (wit : ι), h => by apply (mem_neLocus.mp <| Finset.mem_of_min h).lt_or_lt.by_cases <;> intro hwit · exact h_lt ⟨wit, fun j hj ↦ not_mem_neLocus.mp (Finset.not_mem_of_lt_min hj h), hwit⟩ · exact h_gt ⟨wit, fun j hj ↦ not_mem_neLocus.mp (Finset.not_mem_of_lt_min hj <| by rwa [neLocus_comm]), hwit⟩ /-- The less-or-equal relation for the lexicographic ordering is decidable. -/ irreducible_def Lex.decidableLE : @DecidableRel (Lex (Π₀ i, α i)) (· ≤ ·) := lt_trichotomy_rec (fun h ↦ isTrue <| Or.inr h) (fun h ↦ isTrue <| Or.inl <| congr_arg _ <| congr_arg _ h) fun h ↦ isFalse fun h' ↦ lt_irrefl _ (h.trans_le h') #align dfinsupp.lex.decidable_le Dfinsupp.Lex.decidableLE /-- The less-than relation for the lexicographic ordering is decidable. -/ irreducible_def Lex.decidableLT : @DecidableRel (Lex (Π₀ i, α i)) (· < ·) := lt_trichotomy_rec (fun h ↦ isTrue h) (fun h ↦ isFalse h.not_lt) fun h ↦ isFalse h.asymm #align dfinsupp.lex.decidable_lt Dfinsupp.Lex.decidableLT -- Porting note: Added `DecidableEq` for `LinearOrder`. instance : DecidableEq (Lex (Π₀ i, α i)) := lt_trichotomy_rec (fun h ↦ isFalse fun h' => h'.not_lt h) (fun h ↦ isTrue h) fun h ↦ isFalse fun h' => h'.symm.not_lt h /-- The linear order on `Dfinsupp`s obtained by the lexicographic ordering. -/ instance Lex.linearOrder : LinearOrder (Lex (Π₀ i, α i)) := { Lex.partialOrder with le_total := lt_trichotomy_rec (fun h ↦ Or.inl h.le) (fun h ↦ Or.inl h.le) fun h ↦ Or.inr h.le decidable_lt := decidableLT decidable_le := decidableLE decidable_eq := inferInstance } #align dfinsupp.lex.linear_order Dfinsupp.Lex.linearOrder end LinearOrder variable [∀ i, PartialOrder (α i)] theorem toLex_monotone : Monotone (@toLex (Π₀ i, α i)) := by intro a b h refine' le_of_lt_or_eq (or_iff_not_imp_right.2 fun hne ↦ _) classical exact ⟨Finset.min' _ (nonempty_neLocus_iff.2 hne), fun j hj ↦ not_mem_neLocus.1 fun h ↦ (Finset.min'_le _ _ h).not_lt hj, (h _).lt_of_ne (mem_neLocus.1 <| Finset.min'_mem _ _)⟩ #align dfinsupp.to_lex_monotone Dfinsupp.toLex_monotone theorem lt_of_forall_lt_of_lt (a b : Lex (Π₀ i, α i)) (i : ι) : (∀ j < i, ofLex a j = ofLex b j) → ofLex a i < ofLex b i → a < b := fun h1 h2 ↦ ⟨i, h1, h2⟩ #align dfinsupp.lt_of_forall_lt_of_lt Dfinsupp.lt_of_forall_lt_of_lt end Zero section Covariants variable [LinearOrder ι] [∀ i, AddMonoid (α i)] [∀ i, LinearOrder (α i)] /-! We are about to sneak in a hypothesis that might appear to be too strong. We assume `CovariantClass` with *strict* inequality `<` also when proving the one with the *weak* inequality `≤`. This is actually necessary: addition on `Lex (Π₀ i, α i)` may fail to be monotone, when it is "just" monotone on `α i`. -/ section Left variable [∀ i, CovariantClass (α i) (α i) (· + ·) (· < ·)] instance Lex.covariantClass_lt_left : CovariantClass (Lex (Π₀ i, α i)) (Lex (Π₀ i, α i)) (· + ·) (· < ·) := ⟨fun _ _ _ ⟨a, lta, ha⟩ ↦ ⟨a, fun j ja ↦ congr_arg _ (lta j ja), add_lt_add_left ha _⟩⟩ #align dfinsupp.lex.covariant_class_lt_left Dfinsupp.Lex.covariantClass_lt_left instance Lex.covariantClass_le_left : CovariantClass (Lex (Π₀ i, α i)) (Lex (Π₀ i, α i)) (· + ·) (· ≤ ·) := Add.to_covariantClass_left _ #align dfinsupp.lex.covariant_class_le_left Dfinsupp.Lex.covariantClass_le_left end Left section Right variable [∀ i, CovariantClass (α i) (α i) (Function.swap (· + ·)) (· < ·)] instance Lex.covariantClass_lt_right : CovariantClass (Lex (Π₀ i, α i)) (Lex (Π₀ i, α i)) (Function.swap (· + ·)) (· < ·) := ⟨fun f _ _ ⟨a, lta, ha⟩ ↦ ⟨a, fun j ja ↦ congr_arg (· + ofLex f j) (lta j ja), add_lt_add_right ha _⟩⟩ #align dfinsupp.lex.covariant_class_lt_right Dfinsupp.Lex.covariantClass_lt_right instance Lex.covariantClass_le_right : CovariantClass (Lex (Π₀ i, α i)) (Lex (Π₀ i, α i)) (Function.swap (· + ·)) (· ≤ ·) := Add.to_covariantClass_right _ #align dfinsupp.lex.covariant_class_le_right Dfinsupp.Lex.covariantClass_le_right end Right end Covariants end Dfinsupp
(** CoLoR, a Coq library on rewriting and termination. See the COPYRIGHTS and LICENSE files. - Adam Koprowski, 2004-09-06 This file provides an implementation of finite multisets using list representation. *) Set Implicit Arguments. From Coq Require Import Permutation PermutSetoid Omega Multiset. From CoLoR Require Import LogicUtil RelExtras MultisetCore ListExtras. Module MultisetList (ES : Eqset_dec) <: MultisetCore with Module Sid := ES. Module Export Sid := ES. Section Operations. Definition Multiset := list A. Definition empty : Multiset := nil. Definition singleton a : Multiset := a :: nil. Definition union := app (A:=A). Definition meq := permutation eqA eqA_dec. Definition mult := countIn eqA eqA_dec. Definition rem := removeElem eqA eqA_dec. Definition diff := removeAll eqA eqA_dec. Definition intersection := inter_as_diff diff. Definition fold_left := fun T : Type => List.fold_left (A := T) (B := A). End Operations. Infix "=mul=" := meq (at level 70) : msets_scope. Notation "X <>mul Y" := (~meq X Y) (at level 50) : msets_scope. Notation "{{ x }}" := (singleton x) (at level 5) : msets_scope. Infix "+" := union : msets_scope. Infix "-" := diff : msets_scope. Infix "#" := intersection (at level 50, left associativity) : msets_scope. Infix "/" := mult : msets_scope. Delimit Scope msets_scope with msets. Open Scope msets_scope. Bind Scope msets_scope with Multiset. Section ImplLemmas. Lemma empty_empty : forall M, (forall x, x / M = 0) -> M = empty. Proof. intros M mulM; destruct M. trivial. absurd (a / (a::M) = 0). simpl. destruct (eqA_dec a a); auto with sets. auto. Qed. End ImplLemmas. Section SpecConformation. Lemma mult_eqA_compat : forall M x y, x =A= y -> x / M = y / M. Proof. induction M. auto. intros; simpl. destruct (eqA_dec x a); destruct (eqA_dec y a); intros; solve [ absurd (y =A= a); eauto with sets | assert (x / M = y / M); auto ]. Qed. Lemma mult_comp : forall l a, a / l = multiplicity (list_contents eqA eqA_dec l) a. Proof. induction l. auto. intro a0; simpl. destruct (eqA_dec a0 a); destruct (eqA_dec a a0); simpl; rewrite <- (IHl a0); (reflexivity || absurd (a0 =A= a); auto with sets). Qed. Lemma multeq_meq : forall M N, (forall x, x / M = x / N) -> M =mul= N. Proof. unfold meq. intros M N mult_MN x. rewrite <- !mult_comp. exact (mult_MN x). Qed. Lemma meq_multeq : forall M N, M =mul= N -> forall x, x / M = x / N. Proof. unfold meq, permutation, Multiset.meq. intros M N eqMN x. rewrite !mult_comp. exact (eqMN x). Qed. Lemma empty_mult : forall x, mult x empty = 0. Proof. auto. Qed. Lemma union_mult : forall M N x, (x/(M + N))%msets = ((x/M)%msets + (x/N)%msets)%nat. Proof. induction M; auto. intros N x; simpl. destruct (eqA_dec x a); auto. rewrite IHM. auto. Qed. Lemma diff_empty_l : forall M, empty - M = empty. Proof. induction M; auto. Qed. Lemma diff_empty_r : forall M, M - empty = M. Proof. induction M; auto. Qed. Lemma mult_remove_in : forall x a M, x =A= a -> (x / (rem a M))%msets = ((x / M)%msets - 1)%nat. Proof. induction M. auto. intro x_a. simpl; destruct (eqA_dec x a0); destruct (eqA_dec a a0); simpl; try solve [absurd (x =A= a); eauto with sets]. auto with arith. destruct (eqA_dec x a0). contr. auto. Qed. Lemma mult_remove_not_in : forall M a x, ~ x =A= a -> x / (rem a M) = x / M. Proof. induction M; intros. auto. simpl; destruct (eqA_dec a0 a). destruct (eqA_dec x a); solve [absurd (x =A= a); eauto with sets | trivial]. simpl; destruct (eqA_dec x a). rewrite (IHM a0 x); trivial. apply IHM; trivial. Qed. Lemma remove_perm_single : forall x a b M, x / (rem a (rem b M)) = x / (rem b (rem a M)). Proof. intros x a b M. case (eqA_dec x a); case (eqA_dec x b); intros x_b x_a. (* x=b, x=a *) rewrite !mult_remove_in; trivial. (* x<>b, x=a *) rewrite mult_remove_in; trivial. do 2 (rewrite mult_remove_not_in; trivial). rewrite mult_remove_in; trivial. (* x=b, x<>a *) rewrite mult_remove_not_in; trivial. do 2 (rewrite mult_remove_in; trivial). rewrite mult_remove_not_in; trivial. (* x<>b, x<>a *) rewrite !mult_remove_not_in; trivial. Qed. Lemma diff_mult_comp : forall x N M M', M =mul= M' -> x / (M - N) = x / (M' - N). Proof. induction N. intros; apply meq_multeq; trivial. intros M M' MM'. simpl. apply IHN. apply multeq_meq. intro x'. case (eqA_dec x' a). intro xa; rewrite !mult_remove_in; trivial. rewrite (meq_multeq MM'); trivial. intro xna; rewrite !mult_remove_not_in; trivial. apply meq_multeq; trivial. Qed. Lemma diff_perm_single : forall x a b M N, x / (M - (a::b::N)) = x / (M - (b::a::N)). Proof. intros x a b M N. simpl; apply diff_mult_comp. apply multeq_meq. intro x'; apply remove_perm_single. Qed. Lemma diff_perm : forall M N a x, x / ((rem a M) - N) = x / (rem a (M - N)). Proof. intros M N; gen M; clear M. induction N. auto. intros M b x. change (rem b M - (a::N)) with (M - (b::a::N)). rewrite diff_perm_single. simpl; apply IHN. Qed. Lemma diff_mult_step_eq : forall M N a x, x =A= a -> x / (rem a M - N) = ((x / (M - N))%msets - 1)%nat. Proof. intros M N a x x_a. rewrite diff_perm. rewrite mult_remove_in; trivial. Qed. Lemma diff_mult_step_neq : forall M N a x, ~ x =A= a -> x / (rem a M - N) = x / (M - N). Proof. intros M N a x x_a. rewrite diff_perm. rewrite mult_remove_not_in; trivial. Qed. Lemma diff_mult : forall M N x, x / (M - N) = ((x / M)%msets - (x / N)%msets)%nat. Proof. induction N. (* induction base *) simpl; intros; omega. (* induction step *) intro x; simpl. destruct (eqA_dec x a); simpl. (* x = a *) fold rem. rewrite (diff_mult_step_eq M N e). rewrite (IHN x). omega. (* x <> a *) fold rem. rewrite (diff_mult_step_neq M N n). exact (IHN x). Qed. Definition intersection_mult := inter_as_diff_ok mult diff diff_mult. Lemma singleton_mult_in : forall x y, x =A= y -> x / {{y}} = 1. Proof. intros; compute. case (eqA_dec x y); [trivial | contr]. Qed. Lemma singleton_mult_notin : forall x y, ~x =A= y -> x / {{y}} = 0. Proof. intros; compute. case (eqA_dec x y); [contr | trivial]. Qed. Lemma rev_list_ind_type : forall P : Multiset -> Type, P nil -> (forall a l, P (rev l) -> P (rev (a :: l))) -> forall l, P (rev l). Proof. induction l; auto. Defined. Lemma rev_ind_type : forall P : Multiset -> Type, P nil -> (forall x l, P l -> P (l ++ x :: nil)) -> forall l, P l. Proof. intros. gen (rev_involutive l). intros E; rewrite <- E. apply (rev_list_ind_type P). auto. simpl in |- *. intros. apply (X0 a (rev l0)). auto. Defined. Lemma mset_ind_type : forall P : Multiset -> Type, P empty -> (forall M a, P M -> P (union M {{a}})) -> forall M, P M. Proof. induction M as [| x M] using rev_ind_type. exact X. exact (X0 M x IHM). Defined. End SpecConformation. Hint Unfold meq empty singleton mult union diff : multisets. Hint Resolve mult_eqA_compat meq_multeq multeq_meq empty_mult union_mult diff_mult intersection_mult singleton_mult_in singleton_mult_notin : multisets. Hint Rewrite empty_mult union_mult diff_mult intersection_mult using trivial : multisets. End MultisetList.
[STATEMENT] lemma (in is_tm_semifunctor) is_tm_semifunctor_op: "op_smcf \<FF> : op_smc \<AA> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> op_smc \<BB>" [PROOF STATE] proof (prove) goal (1 subgoal): 1. op_smcf \<FF> : op_smc \<AA> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> op_smc \<BB> [PROOF STEP] by (intro is_tm_semifunctorI', unfold smc_op_simps) (cs_concl cs_intro: smc_cs_intros smc_op_intros smc_small_cs_intros)
Parameter Location : Type. Parameter Pile : Type. Parameter Robot : Type. Parameter Crane : Type. Parameter Container : Type. Parameter adjacent : Location -> Location -> Prop. Record RobotAtLocation (L:Location) := {robot1 :> Robot}. Parameter NotOccupiedLocation : Type. Axiom notOccupiedLocation : NotOccupiedLocation -> Location. Coercion notOccupiedLocation : NotOccupiedLocation >-> Location. Record CraneBelongingTo (L:Location) := {crane1 :> Crane}. Record RobotLoadedWith (C:Container) := {robot2 :> Robot}. Record EmptyCraneBelongingTo (L:Location) := {emptyCrane :> CraneBelongingTo L}. Record CraneHolding(C:Container) := {crane2 :> Crane}. Definition move3(from:Location)(r:RobotAtLocation from)(to:NotOccupiedLocation) (p1:adjacent from to):= RobotAtLocation to. Definition unload2(c:Container)(l:Location)(k:EmptyCraneBelongingTo l) (r:RobotAtLocation l) := CraneHolding c. Variable l1 : Location. Variable l2 : NotOccupiedLocation. Variable l1AdjacentL2 : adjacent l1 l2. Variable r : RobotAtLocation l1. Variable rAtTo : move3 l1 r l2 l1AdjacentL2. Variable k2 : EmptyCraneBelongingTo l2. Variable c : Container. Variable kHoldingC : unload2 c l2 k2 rAtTo. Variable kHoldingC1 : unload2 c l1 k2 rAtTo.
Formal statement is: corollary\<^marker>\<open>tag unimportant\<close> maximum_real_frontier: assumes holf: "f holomorphic_on (interior S)" and contf: "continuous_on (closure S) f" and bos: "bounded S" and leB: "\<And>z. z \<in> frontier S \<Longrightarrow> Re(f z) \<le> B" and "\<xi> \<in> S" shows "Re(f \<xi>) \<le> B" Informal statement is: If $f$ is holomorphic on the interior of a bounded set $S$ and continuous on the closure of $S$, and if $f$ is bounded above on the boundary of $S$, then $f$ is bounded above on $S$.
\subsection{gammapy.catalog} \label{ssec:gammapy-catalog} \todo{Atreyee} Gamma-ray catalog access Comprehensive source catalogs are increasingly being provided by many high energy astrophysics experiments. gammapy.catalog provides a convenient access to some common gamma-ray catalogs. A global catalog table is provided, along with source models flux points and light curves (if available) for individual objects, which are internally created from the supplied FITS tables. This module works independently from the rest of the package, and the required catalogs are supplied in GAMMAPY\_DATA. Presently, catalogs from Fermi-LAT (standard~\citep{3FGL, 4FGL} and high energy~\citep{2FHL, 3FHL}), H.E.S.S. galactic plane survey~\citep{HGPS}, HAWC~\citep{2HWC, 3HWC} and gamma-cat ~\citep{gamma-cat}; an open source gamma ray catalog combining information from multiple catalogs) are supported. \begin{figure} \import{code-examples/generated/}{gp_catalogs} \caption{Using gammapy.catalogs: Accessing underlying model, flux points and lightcurve from the Fermi-LAT 4FGL catalog for the blazar PKS 2155-304} \label{codeexample:data} \end{figure}
= = Early history = =
[GOAL] α : Type u_1 p : α → Prop inst✝ : DecidablePred p x : α ⊢ ↑(countp p) (of x) = if p x = (true = true) then 1 else 0 [PROOFSTEP] simp [countp, List.countp, List.countp.go] [GOAL] α : Type u_1 p : α → Prop inst✝¹ : DecidablePred p inst✝ : DecidableEq α x y : α ⊢ ↑(count x) (of y) = Pi.single x 1 y [PROOFSTEP] simp [Pi.single, Function.update, count, countp, List.countp, List.countp.go, Bool.beq_eq_decide_eq] [GOAL] α : Type u_1 p : α → Prop inst✝ : DecidablePred p x : α ⊢ ↑(countp p) (of x) = if p x then ↑Multiplicative.ofAdd 1 else ↑Multiplicative.ofAdd 0 [PROOFSTEP] erw [FreeAddMonoid.countp_of] [GOAL] α : Type u_1 p : α → Prop inst✝ : DecidablePred p x : α ⊢ (if p x = (true = true) then 1 else 0) = if p x then ↑Multiplicative.ofAdd 1 else ↑Multiplicative.ofAdd 0 [PROOFSTEP] simp only [eq_iff_iff, iff_true, ofAdd_zero] [GOAL] α : Type u_1 p : α → Prop inst✝ : DecidablePred p x : α ⊢ (if p x then 1 else 0) = if p x then ↑Multiplicative.ofAdd 1 else 1 [PROOFSTEP] rfl [GOAL] α : Type u_1 p : α → Prop inst✝ : DecidablePred p x : α ⊢ ↑(countp p) (of x) = if p x then ↑Multiplicative.ofAdd 1 else 1 [PROOFSTEP] rw [countp_of', ofAdd_zero] [GOAL] α : Type u_1 p : α → Prop inst✝¹ : DecidablePred p inst✝ : DecidableEq α x y : α ⊢ ↑(count x) (of y) = Pi.mulSingle x (↑Multiplicative.ofAdd 1) y [PROOFSTEP] simp [count, countp_of, Pi.mulSingle_apply, eq_comm, Bool.beq_eq_decide_eq]
////////////////////////////////////////////////////////////////////////////// // Boost.Assign v2 // // // // Copyright (C) 2003-2004 Thorsten Ottosen // // Copyright (C) 2011 Erwann Rogard // // Use, modification and distribution are subject to the // // Boost Software License, Version 1.0. (See accompanying file // // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // ////////////////////////////////////////////////////////////////////////////// #ifndef BOOST_ASSIGN_V2_OPTION_ER_2011_HPP #define BOOST_ASSIGN_V2_OPTION_ER_2011_HPP #include <boost/assign/v2/option/data.hpp> #include <boost/assign/v2/option/list.hpp> #include <boost/assign/v2/option/modifier.hpp> #endif // BOOST_ASSIGN_V2_OPTION_ER_2011_HPP
! NetworkMaker software (General Node Model) ! Computational model to simulate morphogenetic processes in living organs and tissues. ! Copyright (C) 2014 Roland Zimm & Isaac Salazar-Ciudad ! 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 3 of the License, or ! 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 should have received a copy of the GNU General Public License ! along with this program. If not, see <http://www.gnu.org/licenses/>. module basics use gtk use gdk use gtk_hl use iso_c_binding, only: c_ptr, c_char, c_int implicit none type(c_ptr) :: window end module basics module functions use basics contains subroutine my_destroy2(widget, gdata) bind(c) type(c_ptr), value :: widget, gdata integer(kind=c_int) :: ok call gtk_widget_destroy(window) call gtk_main_quit () end subroutine my_destroy2 function choose_input (widget, gdata ) result(ret) bind(c) use iso_c_binding, only: c_ptr, c_int use basics !use Input_handlers implicit none type(c_ptr) :: base, jb, junk type(c_ptr), value :: widget, gdata integer(c_int) :: ret character(len=30), dimension(3) :: filters character(len=30), dimension(3) :: filtnames character(len=240) :: filename3 filters(3) = "text/plain" filters(2) = "*.f90" filters(1) = "*" filtnames(3) = "Text files" filtnames(2) = "Fortran code" filtnames(1) = "All files" ! Initialize GTK call gtk_init() ! Create a window and a column boxi window = hl_gtk_window_new("Choose an input file from this or a child folder!"//c_null_char, & & destroy=c_funloc(my_destroy2)) base = hl_gtk_box_new() call gtk_container_add(window, base) jb = hl_gtk_box_new(horizontal=TRUE, homogeneous=TRUE) call hl_gtk_box_pack(base, jb) junk = hl_gtk_file_chooser_button_new(title="Choose an input file"//c_null_char, & & filter=filters, filter_name=filtnames, file_set=c_funloc(do_open)) !junk = hl_gtk_button_new("CHOOSE (FROM THE SAME FOLDER)!"//c_null_char, clicked=c_funloc(open_file)) call hl_gtk_box_pack(jb, junk) ! junk = hl_gtk_button_new("Print choices"//c_null_char, clicked=c_funloc(display_file)) ! call hl_gtk_box_pack(base, junk) ! junk = hl_gtk_button_new("Display choices"//c_null_char, clicked=c_funloc(read_data_again_ini)) ! call hl_gtk_box_pack(base, junk) junk = hl_gtk_button_new("-----------------Quit-----------------"//c_null_char, clicked=c_funloc(my_destroy2)) call hl_gtk_box_pack(base, junk) call gtk_widget_show_all(window) call gtk_main() !filename3=filename end function choose_input subroutine do_open(widget, gdata) bind(c) use gtk_hl use gtk_os_dependent use basics use iso_c_binding, only: c_ptr, c_int type(c_ptr), value :: widget, gdata type(c_ptr) :: c_string character(len=200) :: inln integer :: ios integer :: idxs character(len=120) :: filename, filenamen='' character(len=140) :: input call gtk_window_set_title(window, "Choose an input file"//c_null_char) c_string = gtk_file_chooser_get_filename(widget) call convert_c_string(c_string, filenamen) call g_free(c_string) idxs = index(filenamen, '/', .true.)+1 call gtk_window_set_title(window, trim(filenamen(idxs:))//c_null_char) print*, filenamen filename=trim(filenamen) print*, "FILENAME", filename input="cp "//trim(filename)//" newchoice.dat" ! saves the file as a local "newchoice.dat" call system(input) input="./NetworkMaker newchoice.dat" ! This launches the interface directly call system(input) end subroutine do_open subroutine open_file(widget, gdata) bind(c) use g use gtk_hl use gtk_hl_container use gtk_hl_entry use gtk_hl_button use gtk_hl_chooser use gdk_events use gdk use gtk use gtk_os_dependent use gtk_sup type(c_ptr), value :: widget, gdata type(c_ptr) :: window integer(kind=c_int) :: isel character(len=240), dimension(:), allocatable :: chfile character(len=240) :: filename character(len=30), dimension(4) :: filters character(len=30), dimension(4) :: filtnames print*, "EINS" filters(1) = "*" filters(2) = "*.txt,*.lis" filters(3) = "*.f90" filters(4) = "*.dat,*.log" filtnames(1) = "All files" filtnames(2) = "Text files" filtnames(3) = "Fortran code" filtnames(4) = "Output files" print*, "EINSKOMMAFÜNF" isel = hl_gtk_file_chooser_show(chfile, create=FALSE,& & title="Select input file"//c_null_char, filter=filters, & & filter_name=filtnames, wsize=(/ 600_c_int, 400_c_int /), & & edit_filters=TRUE, & & parent=window, all=TRUE) print*, "ZWEI" if (isel == FALSE) return ! No selection made print*, "DREI" filename = chfile(1) deallocate(chfile) print*, "VIER" !!!call gtk_widget_destroy(window) end subroutine open_file function Start_program (widget, gdata ) result(ret) bind(c) use iso_c_binding, only: c_ptr, c_int implicit none type(c_ptr), value :: widget, gdata integer(c_int) :: ret character*140 :: dir character*150 :: ddir call getarg(1,dir) if(len(dir).lt.1)then ddir="./NetworkMaker "//trim(dir) else ddir="./NetworkMaker " endif call system(ddir) end function Start_program function Start_program_0 (widget, gdata ) result(ret) bind(c) use iso_c_binding, only: c_ptr, c_int implicit none type(c_ptr), value :: widget, gdata integer(c_int) :: ret character*140 :: dir character*150 :: ddir call getarg(1,dir) ddir="./NetworkMaker " call system(ddir) end function Start_program_0 function End_program (widget, gdata ) result(ret) bind(c) use iso_c_binding, only: c_ptr, c_int implicit none type(c_ptr), value :: widget, gdata integer(c_int) :: ret call gtk_main_quit() end function End_program end module functions program grn_interface use iso_c_binding, only: c_ptr, c_char, c_int use gtk use gdk, only: gdk_cairo_create, gdk_cairo_set_source_pixbuf use gdk_pixbuf, only: gdk_pixbuf_get_n_channels, gdk_pixbuf_get_pixels, gdk_pix& &buf_get_rowstride, gdk_pixbuf_new use functions use basics !use event_handlers !use global_widgets !use on_display_handlers !use io !use basic_handlers !use rb_handlers !>>Miquel8-10-14 implicit none type(c_ptr) :: table, box, my_window, button1, button2, button3, button4, my_pixbuf, base, junk, jb integer :: width_e, height_e real*8 :: newval real*4 :: xal, yal real*8 :: parval character(kind=c_char), dimension(:), pointer :: pixel integer(kind=c_int) :: nch, rowstride, pixwidth_e, pixheight_e logical :: computing = .false. character(LEN=80) :: string character*140 :: di character*150 :: ddi integer(c_int) :: ret character(len=30), dimension(3) :: filters character(len=30), dimension(3) :: filtnames character(len=240) :: filename3 filters(3) = "text/plain" filters(2) = "*.f90" filters(1) = "*" filtnames(3) = "Text files" filtnames(2) = "Fortran code" filtnames(1) = "All files" !type(c_ptr) :: labeltc call getarg(1,di) ddi="./NetworkMaker "//trim(di) print*, "STARTTTTTTTTTTT", di, len(trim(di)) if(len(trim(di))>1) call system(ddi) if(len(trim(di))==1)then ddi="./NetworkMaker void" call system(ddi) end if call gtk_init () ! Properties of the main_1 window : width_e = 300 height_e = 150 ! Define all widgets my_window = gtk_window_new (GTK_WINDOW_TOPLEVEL) button1 = gtk_label_new (" Choose a new input file "//c_null_char) button2 = gtk_button_new_with_mnemonic ("*** START ***"//c_null_char) button3 = gtk_button_new_with_mnemonic ("Quit"//c_null_char) button4 = gtk_button_new_with_mnemonic ("Create a new GRN"//c_null_char) table = gtk_table_new (2_c_int, 2_c_int, TRUE) box = gtk_hbox_new (FALSE, 2_c_int) call gtk_window_set_default_size(my_window, width_e, height_e) call gtk_window_set_title(my_window, "Launch NetworkMaker"//c_null_char) call g_signal_connect (button2, "clicked"//c_null_char, c_funloc(Start_program)) call g_signal_connect (button4, "clicked"//c_null_char, c_funloc(Start_program_0)) call g_signal_connect (button3, "clicked"//c_null_char, c_funloc(End_program)) call gtk_table_attach_defaults(table, button1, 0_c_int, 2_c_int, 0_c_int, 1_c_int) !>>Miquel8-10-14 call gtk_table_attach_defaults(table, button2, 0_c_int, 4_c_int, 2_c_int, 4_c_int) ! call gtk_table_attach_defaults(table, button3, 0_c_int, 4_c_int, 4_c_int, 5_c_int) call gtk_table_attach_defaults(table, button4, 0_c_int, 4_c_int, 1_c_int, 2_c_int) junk = hl_gtk_file_chooser_button_new(title="Choose an input file"//c_null_char, & & filter=filters, filter_name=filtnames, file_set=c_funloc(do_open)) call gtk_table_attach_defaults(table, junk, 2_c_int, 4_c_int, 0_c_int, 1_c_int) ! show all call gtk_box_pack_start (box, table, FALSE, FALSE, 0_c_int) call gtk_container_add (my_window, box) call gtk_window_set_mnemonics_visible (my_window, TRUE) call gtk_widget_show_all (my_window) call gtk_main () end program grn_interface !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!gfortran -w general.mod.f90 io.mod.f90 genetic.mod.f90 grn_editor_whole.f90 -o grnee.e `pkg-config --cflags --libs /home/rolazimm/Desktop/gtk-fortran/gtk-fortran-master/build/src/gtk-2-fortran.pc gtk+-2.0`
if(FALSE){ "Time series is a series of data points in which each data point is associated with a timestamp. A simple example is the price of a stock in the stock market at different points of time on a given day. Another example is the amount of rainfall in a region at different months of the year. R language uses many functions to create, manipulate and plot the time series data. The data for the time series is stored in an R object called time-series object. It is also a R data object like a vector or data frame." #The time series object is created by using the ts() function #timeseries.object.name <- ts(data, start, end, frequency) "data is a vector or matrix containing the values used in the time series. start specifies the start time for the first observation in time series. end specifies the end time for the last observation in time series. frequency specifies the number of observations per unit time." } function1 <- function(){ #We create an R time series object for a period of 12 months and plot it. # Get the data points in form of a R vector. rainfall <- c(799,1174.8,865.1,1334.6,635.4,918.5,685.5,998.6,784.2,985,882.8,1071) # Convert it to a time series object. rainfall.timeseries <- ts(rainfall,start = c(2012,1),frequency = 12) # Print the timeseries data. print(rainfall.timeseries) # Give the chart file a name. png(file = "rainfall.png") # Plot a graph of the time series. plot(rainfall.timeseries) # Save the file. dev.off() } # function1() if(FALSE){ "The value of the frequency parameter in the ts() function decides the time intervals at which the data points are measured" "frequency = 12 pegs the data points for every month of a year. frequency = 4 pegs the data points for every quarter of a year. frequency = 6 pegs the data points for every 10 minutes of an hour. frequency = 24*6 pegs the data points for every 10 minutes of a day." } function2 <- function(){ # Get the data points in form of a R vector. rainfall1 <- c(799,1174.8,865.1,1334.6,635.4,918.5,685.5,998.6,784.2,985,882.8,1071) rainfall2 <- c(655,1306.9,1323.4,1172.2,562.2,824,822.4,1265.5,799.6,1105.6,1106.7,1337.8) # Convert them to a matrix. combined.rainfall <- matrix(c(rainfall1,rainfall2),nrow = 12) # Convert it to a time series object. rainfall.timeseries <- ts(combined.rainfall,start = c(2012,1),frequency = 12) # Print the timeseries data. print(rainfall.timeseries) # Give the chart file a name. png(file = "rainfall_combined.png") # Plot a graph of the time series. plot(rainfall.timeseries, main = "Multiple Time Series") # Save the file. dev.off() } function2()
% =============================================================================================== % =============================================================================================== % PARALLELISM BASICS % % - Flynn % - Amdahl's law % - Gustaffson's law % - speedup, etc.. % - Roofline model % % =============================================================================================== % =============================================================================================== \subsection{Parallelism basics} \begin{frame}[containsverbatim] \frametitle{Parallel computer} \begin{center} {\includegraphics[height=7cm]{Day0/images/bellatrix2.jpg}} \end{center} \end{frame} \begin{frame}[containsverbatim] \frametitle{Parallel computer (cluster) HW components} \begin{itemize} \item{\textbf{Nodes :} composed of \begin{itemize} \item{one or more \textbf{CPU} each with multiple \textbf{cores}} \item{\textbf{shared memory among the cores}} \item{\textbf{a NIC} (Networking Interface Card)} \end{itemize} } \item{\textbf{Interconnection network}} \item{\textbf{one (or more) Frontend} to access the cluster remotely} \end{itemize} \end{frame} \begin{frame}[containsverbatim] \frametitle{Parallel computer (cluster) SW components} \begin{itemize} \item{\textbf{A scheduler} in order to share the resources among multiple users} \item{\textbf{A basic software stack} with compilers, linkers and basic parallel libraries} \item{\textbf{An application stack} with specific ready-to-use scientific applications} \end{itemize} \end{frame} \begin{frame}[containsverbatim] \frametitle{Vocabulary} \begin{itemize} \item{\textbf{parallel computing :} data and/or task parallelism} \item{\textbf{supercomputing :} use of the fastest and largest machines in the world EFFICIENTLY} \item{\textbf{high performance computing (HPC) :} buzzword} \end{itemize} \end{frame} \begin{frame}[containsverbatim] \frametitle{Flynn taxonomy (1966)} \begin{center} \begin{tabular}{ l | c | c | } & Single instruction & Multiple instructions \\ \hline Single data & SISD & MISD \\ & Sequential processing & n/a \\ \hline Multiple data & SIMD & MIMD \\ & vector processing & distributed processing \\ \hline \end{tabular} \end{center} \end{frame} \begin{frame}[containsverbatim] \frametitle{Flynn taxonomy : examples} \begin{center} \begin{tabular}{ l | l | l | } & Single instruction & Multiple instructions \\ \hline Single data & - one core & - very rare \\ \hline Multiple data & - Intel AVX512 (vectorization) & - Clusters \\ & - GPU & \\ \hline \end{tabular} \end{center} \end{frame} \begin{frame}[containsverbatim] \frametitle{Parallelism ?} Decomposition \begin{itemize} \item{\textbf{on the data :} DATA PARALLELISM (SIMD)} \item{\textbf{on the tasks :} TASK PARALLELISM (MISD, MIMD)} \end{itemize} ... or a mix of both ! \end{frame} \begin{frame}[containsverbatim] \frametitle{Data parallelism} \begin{itemize} \item{loop-level parallelism} \item{data is distributed} \item{data resides on a global memory address space} \end{itemize} \end{frame} \begin{frame}[containsverbatim] \frametitle{Task parallelism} \begin{itemize} \item{pipelining} \item{like an assembly chain} \item{a task is divided into a sequence of smaller tasks} \item{each task is executed on a specialized piece of hardware} \item{concurrently} \end{itemize} \end{frame} \begin{frame}[containsverbatim] \frametitle{Back to HPL (High Performance Linpack)} \begin{itemize} \item{Remainder : solves $A x = b$ using Gauss partial pivoting} \item{We ran it on one node, but what about if we distribute the matrix A (and $x$ and $b$) over $p$ nodes ?} \item{Needs for a \textit{Message Passing API}. Choice is \textbf{MPI} (Message Passing Interface)} \item{HPL is used to rate supercomputers worldwide} \item{TOP500} \end{itemize} \end{frame} \begin{frame}[containsverbatim] \frametitle{HPL : parallel algorithm} \begin{itemize} \item{Solves $A x = b$, where $A \in \mathbb{R}^{n \times n}$ and $x,b \in \mathbb{R}^n$} \item{by computing LU factorization with row partial pivoting of the $n$ by $n+1$ coefficient matrix $[A,b]$ : $P_r[A,b] = [[L \cdot U],y]$, where $P_r,L,U \in \mathbb{R}^{n \times n}$ and $y \in \mathbb{R}^n$} \item{Finally : $U x = y$} \end{itemize} The data is ditributed onto a 2D grid (of dimension $P\times Q$) of processes using a block-cyclic scheme : \begin{center} \begin{tabular}{| p{0.5cm} | p{0.5cm} | p{0.5cm} | p{0.5cm} |} \hline $P_0$ & $P_1$ & $P_0$ & $P_1$ \\ \hline $P_2$ & $P_3$ & $P_2$ & $P_3$ \\ \hline $P_0$ & $P_1$ & $P_0$ & $P_1$ \\ \hline $P_2$ & $P_3$ & $P_2$ & $P_3$ \\ \hline \end{tabular} \end{center} \end{frame} \begin{frame}[containsverbatim] \frametitle{TOP500} \begin{center} {\includegraphics[height=5cm]{Day0/images/Top500_logo.png}} \end{center} \end{frame} \begin{frame}[containsverbatim] \frametitle{TOP500 : current list (November 2019)} \scriptsize \begin{tabular}{| l | l | l | l | l | l | l | } \hline \textbf{Rank} & \textbf{Machine} & \textbf{\# cores} & \textbf{$R_{\infty}$} & \textbf{$R_{max}$} & \textbf{Power} & \textbf{Country}\\ & & & in TFlop/s & in TFlop/s & in KW & \\ \hline \hline 1 & Summit & 2,414,592&148,600.0 &200,794.9 & 10,096 & USA\\ \hline 2 & Sierra & 1,572,480 &94,640.0 &125,712.0 & 7,438 & USA\\ \hline 3 & Sunway & 10,649,600 &93,014.6 &125,435.9 &15,371 & China\\ & TaihuLight & & & & &\\ \hline 4 & Tianhe-2A & 4,981,760 &61,444.5 & 100,678.7 &18,482 & China\\ \hline 5 & Frontera & 448,448 &23,516.4 &38,745.9 &n/a& USA\\ \hline 6 & Piz Daint & 387,872 &21,230.0 &27,154.3 &2,384& Switzerland\\ \hline 7 & Trinity & 979,072 &20,158.7 &41,461.2 &7,578& USA\\ \hline 8 & Al Bridging & 391,680 &19,880.0 &32,576.6 &1,649& Japan\\ \hline 9 & SuperMUC & 305,856 &19,476.6 &26,873.9 &n/a& Germany\\ \hline 10 & Lassen & 288,288 &18,200.0 &23,047.2 &n/a& USA\\ \hline \end{tabular} \end{frame} %\begin{frame}[containsverbatim] %\frametitle{TOP500 : current list (June 2018)} %\scriptsize %\begin{tabular}{| l | l | l | l | l | l | } %\hline % \textbf{Rank} & \textbf{Machine} & \textbf{\# cores} & \textbf{$R_{\infty}$} & \textbf{$R_{max}$} & \textbf{Power} \\ % & & & in TFlop/s & in TFlop/s & in KW \\ %\hline %\hline %1 & Summit & 2,282,544&122,300.0 &187,659.3 & 8,806 \\ %\hline %2 & Sunway TaihuLight & 10,649,600 &93,014.6 &125,435.9 &15,371 \\ %\hline %3 & Sierra & 1,572,480 &71,610.0 &119,193.6 & n/a \\ %\hline %4 & Tianhe-2A & 4,981,760 &61,444.5 & 100,678.7 &18,482 \\ %\hline %5 & Al Bridging & 391,680 &19,880.0 &32,576.6 &1,649\\ %\hline %6 & Piz Daint & 361,760 &19,590.0 &25,326.3 &2,272\\ %\hline %7 & Titan & 560,640 &17,590.0 &27,112.5 &8,209\\ %\hline %8 & Sequoia & 1,572,864 &17,173.2 &20,132.7 &7,890\\ %\hline %9 & Trinity & 979,968 &14,137.3 &43,902.6 &3,844\\ %\hline %10 & Cori & 622,336 &14,014.7 &27,880.7 &3,939\\ %\hline % %\end{tabular} %\end{frame} % =============================================================================================== % =============================================================================================== % PARALLEL APPLICATIONS AND ALGORITHMS % % % =============================================================================================== % =============================================================================================== \subsection{Parallel applications and algorithms} \begin{frame}[containsverbatim] \frametitle{} \begin{center} \textbf{Theoretical analysis of a code} \end{center} \end{frame} \begin{frame}[containsverbatim] \frametitle{Performance analysis} \textbf{Before starting parallelization : insight of the application} \begin{itemize} \item{is the algorithm/application a good candidate for parallelization ?} \item{Which parallelization strategy should I choose ?} \item{How should I partition the problem ?} \end{itemize} \textbf{Helps understanding and improving existing implementations} \begin{itemize} \item{do the benchmark match the performance predictions ?} \item{which factors have most influence on the performance ?} \item{which HW fits most to the applications needs ?} \end{itemize} \end{frame} \begin{frame} \frametitle{Speedup and efficiency} \[ S(p) = \frac{T_{1}}{T_{p}} \qquad E(p) = \frac{S(p)}{p} \] where \begin{itemize} \item{\textbf{$T_1$ :} Execution time using 1 process } \item{\textbf{$T_p$ :} Execution time using p process } \item{\textbf{$S(p)$ :} Speedup of $p$ processes } \item{\textbf{$E(p)$ :} Parallel Efficiency } \end{itemize} Example : \begin{columns} \begin{column}{0.47\textwidth} \begin{tabular}{| l | l | l | l |} \hline \textbf{n} & \textbf{Walltime in [s]} & \textbf{S(p)}& \textbf{E(p)} \\ \hline \hline 1 & 24.5 & 1.0 & 1.0\\ \hline 2 & 13.4 & 1.8 & 0.9\\ \hline 4 & 6.8 & 3.6 & 0.9\\ \hline 8 & 4.0.5 & 6.1 & 0.76\\ \hline \end{tabular} \end{column} \begin{column}{0.5\textwidth} \includegraphics[width=\textwidth]{Day0/images/speedup.png} \end{column} \end{columns} \end{frame} \begin{frame}[containsverbatim] \frametitle{Amdahl's law} \begin{itemize} \item{\textbf{Maximum achievable speedup} for an application where a fraction $f$ cannot be parallelized} \item{$S(p) \leqslant \frac{1}{f + \frac{(1-f)}{p}}$} \item{or $S(p) \leqslant \frac{p}{1 + (p-1) \cdot f}$} \item{$S(p)$ is always lower than $\frac{1}{f}$: $lim_{p \rightarrow \infty} S(p) \leqslant \frac{1}{f}$} \item{Desirable : $f < \frac{1}{p}$} \item{provides an upperbound} \end{itemize} \end{frame} \begin{frame}[containsverbatim] \frametitle{Amdahl's law} \begin{center} {\includegraphics[height=5cm]{Day0/images/amdahl.png}} \end{center} \end{frame} \begin{frame}[containsverbatim] \frametitle{Amdahl's law (deduce $f$)} \begin{align} S_p &= \frac{1}{f + \frac{(1-f)}{p}} \end{align} then \begin{align} S_p \cdot f + \frac{S_p}{p} - S_p \cdot \frac{f}{p} &= 1 \end{align} finally : \begin{align} f &= \frac{1 - \frac{S_p}{p}}{S_p - \frac{S_p}{p}} = \frac{\frac{1}{S_p} - \frac{1}{p}}{1 - \frac{1}{p}} \end{align} $f$ comprise communication overhead \end{frame} \begin{frame} \frametitle{Amdahl and Gustafson} \begin{exampleblock}{Observation} Amdahl's law is an estimation for a \textbf{fixed problem size} $n$. \end{exampleblock} \begin{alertblock}{Problem} If we increase the problem size, the relative sequential part can be made smaller and smaller \textit{if it is of lower complexity than the parallel part of the problem} \end{alertblock} \begin{alertblock}{Solution} Take the problem size $n$ into account. This is Gustafson's law (or Gustafson's complement to Amdahl's law) \end{alertblock} \end{frame} \begin{frame}[containsverbatim] \frametitle{Gustafson's law} $s$ is the sequential portion, $a$ is the parallel portion. The sequential ($t_s$) and parallel ($t_p$) are: \[ t_s = s + a \cdot n \qquad t_p = s + a \cdot \frac{n}{p} \] then the Speedup $S_p$ is : \begin{align} S_p &= \frac{t_s}{t_p} = \frac{s + a \cdot n}{s + a \cdot \frac{n}{p}} = \frac{\frac{s}{n} + a}{\frac{s}{n} + \frac{a}{p}} \end{align} Note $lim_{n \rightarrow \infty} S_p = p$ \end{frame} \begin{frame}[containsverbatim] \frametitle{Gustafson's law} \begin{center} {\includegraphics[height=5cm]{Day0/images/gustafson.png}} \end{center} \end{frame} \begin{frame}[containsverbatim] \frametitle{Complexity analysis} \begin{exampleblock}{Observation} The speedup $S(p)$ is determined by the \textbf{computation time} and the \textbf{communication time}, function of the problem size $n$ \end{exampleblock} \begin{exampleblock}{Communication \& computation time} It is an overhead to the parallel execution time. It can be partially hidden by computation. \end{exampleblock} \begin{exampleblock}{Complexity} Computing the \textbf{complexity} $\mathcal{O}(n,p)$ provides an insight into the parallelization potential. \end{exampleblock} \end{frame} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % FIXME : Prendre l'exemple du matrice vecteur à la place de matrice matrice % voir page 9 : https://www3.nd.edu/~zxu2/acms60212-40212-S12/Lec-05.pdf % plus : http://www.hpcc.unn.ru/mskurs/ENG/DOC/pp07.pdf (complexity analysis + dependencies) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame}[containsverbatim] \frametitle{Complexity analysis : example $c = A \cdot b$} \textbf{Full $N \times N $ matrix vector multiplication with the naïve method $\mathcal{O}(N^2)$} \begin{lstlisting}[language=C,frame=lines] struct timeval t; double t1 = gettimeoftheday(&t,0); for (i=0;i<N;i++){ for (j=0;j<N;j++){ c[i] = c[i] + A[i][j]*b[j]; } } double t2 = gettimeoftheday(&t,0); double mflops = 2.*(double)N*(double)N / (t2-t1) / 1.0E6; \end{lstlisting} \end{frame} \begin{frame}[containsverbatim] \frametitle{Complexity analysis : example $c = A \cdot b$} \textbf{Sequential algorithm :} \begin{itemize} \item{\textbf{Time complexity :} $\mathcal{O}(N)$} \item{\textbf{Size complexity :} $\mathcal{O}(N^2)$} \end{itemize} \end{frame} \begin{frame}[containsverbatim] \frametitle{Complexity analysis : example $c = A \cdot b$} \textbf{Parallel version} \begin{lstlisting}[language=C,frame=lines] t1 = MPI_Wtime(); MPI_Bcast(b, ndiag, MPI_FLOAT, 0, MPI_COMM_WORLD); MPI_Scatter(A,(nn_loc*ndiag),MPI_FLOAT,A_loc,(nn_loc*ndiag),MPI_FLOAT,0,MPI_COMM_WORLD); t2 = MPI_Wtime(); for (j=0;j<ndiag;j++){ for (i=0;i<nn_loc;i++){ c[i] = c[i] + A_loc[i+j*nn_loc]*b[i]; } } t3 = MPI_Wtime(); MPI_Gather(c,nn_loc,MPI_FLOAT,b,nn_loc,MPI_FLOAT,0,MPI_COMM_WORLD); t4 = MPI_Wtime(); \end{lstlisting} \end{frame} %\begin{frame}[containsverbatim] %\frametitle{Complexity analysis : example $c = A \cdot b$} %\textbf{Parallel version} %\begin{lstlisting}[language=C,frame=lines] % t1 = MPI_Wtime(); % MPI_Bcast(U, ndiag, MPI_FLOAT, 0, MPI_COMM_WORLD); % MPI_Scatter(A,(nn_loc*ndiag),MPI_FLOAT,A_loc,(nn_loc*ndiag),MPI_FLOAT,0,MPI_COMM_WORLD); % t2 = MPI_Wtime(); % for (j=0;j<ndiag;j++){ % for (i=0;i<nn_loc;i++){ % Ua[i] = Ua[i] + A_loc[i+j*nn_loc]*U[i]; % } % } % t3 = MPI_Wtime(); % MPI_Gather(Ua,nn_loc,MPI_FLOAT,U,nn_loc,MPI_FLOAT,0,MPI_COMM_WORLD); % t4 = MPI_Wtime(); %\end{lstlisting} %\end{frame} \begin{frame}[containsverbatim] \frametitle{Complexity analysis : example $c = A \cdot b$} \textbf{Parallel algorithm over $p$ processes:} \begin{itemize} \item{\textbf{Computational complexity :} $\mathcal{O}(\frac{N^2}{p})$} \item{\textbf{Communication complexity :} $\mathcal{O}(log p + N)$} \item{\textbf{Overall complexity :} $\mathcal{O}(\frac{N^2}{p} + log p + N)$} \item{for \textit{reasonably} large $N$, latency is neglictible compared to bandwidth} \item{The algorithm is not scalable} \end{itemize} \end{frame} \begin{frame}[containsverbatim] \frametitle{On the importance of algorithmic analysis} \textbf{Full $N \times N $ matrix matrix multiplication with the naïve method $\mathcal{O}(N^3)$} \begin{lstlisting}[language=C,frame=lines] struct timeval t; double t1 = gettimeoftheday(&t,0); for (i=0;i<N;i++){ for (j=0;j<N;j++){ for (k=0;k<N;k++){ C[i][j]=C[i][j] + A[i][k]*B[k][j]; } } } double t2 = gettimeoftheday(&t,0); double mflops = 2.0*pow(N,3) / (t2-t1) / 1.0E6 ; \end{lstlisting} \end{frame} \begin{frame}[containsverbatim] \frametitle{On the importance of algorithmic analysis} \begin{center} {\includegraphics[height=5cm]{Day0/images/dgemm-complexity.png}} \end{center} \end{frame} %\begin{frame}[containsverbatim] %\frametitle{Complexity analysis : HPL example} %\begin{exampleblock}{Complexity} %$\mathcal{O}(n^3)$ more specifically $\frac{2}{3} n^3 " 2 n^2 + \mathcal{O}(n)$ floating-point multiplications and additions %\end{exampleblock} % %\end{frame} \begin{frame}[containsverbatim] \frametitle{Task dependency graph} \begin{center} {\includegraphics[height=3cm]{Day0/images/dependency.png}} \end{center} {\tiny Image from : Wu, Hao \& Hua, Xiayu \& Li, Zheng \& Ren, Shangping. \textit{Resource and Instance Hour Minimization for Deadline Constrained DAG Applications Using Computer Clouds}. IEEE TPDS. 2015} \begin{itemize} \item{essentially a DAG (nodes = tasks, edges = dependencies)} \item{\textbf{critical path :} the longest path from starting task to the ending task} \item{\textbf{average degree of concurrency :} total amount of work devided by the critical path length} \end{itemize} \end{frame} \begin{frame}[containsverbatim] \frametitle{New bug in concurrent computing : deadlock} \begin{center} {\includegraphics[height=3cm]{Day0/images/deadlock.png}} \end{center} \begin{itemize} \item{P1 holds resource R2 and requires R1} \item{P2 holds resource R1 and requires R2} \item{\textbf{deadlock !!}} \end{itemize} \end{frame} \begin{frame}[containsverbatim] \frametitle{New bug in concurrent computing : race condition} \begin{itemize} \item{arise in concurrent computing when two (or more) processes depends on a sequence or timing on a shared variable} \item{example : $a = 0$ is a shared variable. P1 will do $a+1$ while P2 will do $a+2$ : \begin{enumerate} \item{[P1] read $a = 0$} \item{[P2] read $a = 0$} \item{[P1] incr $a = 1$} \item{[P2] incr $a = 2$} \end{enumerate} } \item{The order can lead to different $a$ values : if 2 and 3 are interverted : \begin{enumerate} \item{[P1] read $a = 0$} \item{[P1] incr $a = 1$} \item{[P2] read $a = 1$} \item{[P2] incr $a = 3$} \end{enumerate} } \item{\textbf{race condition !!}} \end{itemize} \end{frame}
module SN.AntiRename where open import Relation.Unary using (_∈_; _⊆_) open import Library open import Terms open import Substitution open import SN mutual -- To formulate this, we need heterogeneous SNholes, going from Γ to Δ -- unRenameSNh : ∀{a b Γ Δ} (ρ : Δ ≤ Γ) {t : Tm Γ b} {E : ECxt Γ a b} {t' : Tm Γ a} → -- SNhole (subst ρ t) (λ t' → subst ρ (E t')) t' → SNhole t E t' -- unRenameSNh = TODO unRenameSNe : ∀{a Γ Δ} {ρ : Δ ≤ Γ} {t : Tm Γ a}{t'} → IndRen ρ t t' → SNe t' → SNe t unRenameSNe (var x x₁) (var y) = var x unRenameSNe (app is is₁) (elim 𝒏 (appl 𝒖)) = elim (unRenameSNe is 𝒏) (appl (unRenameSN is₁ 𝒖)) unRenameSN : ∀{a Γ Δ} {ρ : Δ ≤ Γ} {t : Tm Γ a} {t'} → IndRen ρ t t' → SN t' → SN t -- neutral cases: unRenameSN n (ne 𝒏) = ne (unRenameSNe n 𝒏) -- redex cases: unRenameSN is (exp t⇒ 𝒕) = exp (unRename⇒1 is t⇒) (unRenameSN (proj₂ (unRename⇒0 is t⇒)) 𝒕) -- constructor cases: unRenameSN (abs t) (abs 𝒕) = abs (unRenameSN t 𝒕) unRename⇒0 : ∀{a Γ Δ} {ρ : Δ ≤ Γ} {t : Tm Γ a} {t' : Tm Δ a}{tρ} → IndRen ρ t tρ → tρ ⟨ _ ⟩⇒ t' → Σ _ \ s → IndRen ρ s t' unRename⇒0 {ρ = ρ} (app {u = u} (abs {t = t} is) is₁) (β 𝒖) = _ , prop→Ind ρ (≡.trans (≡.sym (sgs-lifts-term {σ = ρ} {u = u} {t = t})) (≡.cong₂ (λ t₁ u₁ → subst (sgs u₁) t₁) (Ind→prop _ is) (Ind→prop _ is₁))) unRename⇒0 (app is is₁) (cong (appl u) (appl .u) tρ→t') = let s , iss = unRename⇒0 is tρ→t' in app s _ , app iss is₁ unRename⇒1 : ∀{a Γ Δ} {ρ : Δ ≤ Γ} {t : Tm Γ a} {t' : Tm Δ a}{tρ} → (is : IndRen ρ t tρ) → (t⇒ : tρ ⟨ _ ⟩⇒ t') → t ⟨ _ ⟩⇒ proj₁ (unRename⇒0 is t⇒) unRename⇒1 (app (abs is) is₁) (β 𝒖) = β (unRenameSN is₁ 𝒖) unRename⇒1 (app is is₁) (cong (appl u) (appl .u) tρ→t') = cong (appl _) (appl _) (unRename⇒1 is tρ→t') -- Extensionality of SN for function types: -- If t x ∈ SN then t ∈ SN. absVarSNe : ∀{Γ a b}{t : Tm (a ∷ Γ) (a →̂ b)} → app t (var (zero)) ∈ SNe → t ∈ SNe absVarSNe (elim 𝒏 (appl 𝒖)) = 𝒏 absVarSN : ∀{Γ a b}{t : Tm (a ∷ Γ) (a →̂ b)} → app t (var (zero)) ∈ SN → t ∈ SN absVarSN (ne 𝒖) = ne (absVarSNe 𝒖) absVarSN (exp (β {t = t} 𝒖) 𝒕′) = abs (unRenameSN (prop→Ind contract (subst-ext contract-sgs t)) 𝒕′) absVarSN (exp (cong (appl ._) (appl ._) t⇒) 𝒕′) = exp t⇒ (absVarSN 𝒕′)
! ! Unit test for testing m_lp. ! ! NOTE: This code could evolve into a general purpose utility to compute ! surface marine fluxes from a GFIO dyn_vect file. ! Program ut_lp use m_dyn use m_insitu use m_lp Implicit NONE type(dyn_vect) w_f ! gcm state vector type(sim_vect) w_s ! simulator vector (transformed w_f for interpolation) character(len=*), parameter :: myname = 'ut_lp' integer, parameter :: im = 144, jm = 91, km = 26, nobs=im*jm*km real z1(im,jm), u1(im,jm), q1(im,jm), t1(im,jm) ! (u,t,q) at bottom real zs(im,jm), ts(im,jm), qs(im,jm) real z2, u2(im,jm,km), q2(im,jm,km), t2(im,jm,km) ! (u,t,q) at sfc layer real cd(im,jm), ce(im,jm), ct(im,jm), zdl(im,jm) real zlevs(km) integer i, j, k, kmfv, nymd, nhms, iopt, iu integer nconv, nfail, ier real amiss, conf, zmin, zmax, dz, dt1, dq1, dt2, dq2 real t, z, qsat_, theta ! Saturation specific humidity as in CCM3's trefoce() ! Units are g/kg ! --------------------------------------------------- qsat_ ( T ) = 640380.0 * 1000. / exp ( 5107.4 / T ) theta ( T, Z ) = T + 0.01 * Z ! Vertical levels ! --------------- zmin = 0. zmax = 50. dz = (zmax - zmin ) / float(km - 1) do k = 1, km zlevs(k) = zmin + (k-1) * dz if ( zlevs(k) .eq. 0 ) zlevs(k) = 0.001 print *, 'Levels: ', k, zlevs(k) end do ! Read state variables ! -------------------- nymd = 19971221 nhms = 0 print *, myname//': reading gridded fields' call dyn_get ( 'dyn.HDF', nymd, nhms, w_f, ier ) if ( ier .ne. 0 ) then print *, myname//': could not read gridded fields, ier =', ier stop else print *, myname//': just read gridded fields' end if ! Initialize simulator vector (needed for insitu calculations) ! ----------------------------------------------------------- call Insitu_Init ( w_f, w_s, ier ) if ( ier .ne. 0 ) then print *, myname//': could not created sim vect, ier =', ier stop else print *, myname//': just initialized simulator vector' end if ts = w_f%ts(1:im,1:jm) ! save this because w_s does not have it yet call dyn_clean ( w_f ) ! do not need this anymore iopt = 0 ! grads output ! ------------ iu = 10 open(iu,file='ut_lp.grd',form='unformatted') ! Initialize all fields to undef ! ------------------------------ amiss = 1.E+15 qs = amiss u1 = amiss t1 = amiss q1 = amiss u2 = amiss t2 = amiss q2 = amiss cd = amiss ct = amiss ce = amiss zdl = amiss ! Initialize sfc layer package ! ---------------------------- call lp_init() ! For each ocean gridpoint (based on topography) ! ----------------------------------------------- kmfv = w_s%grid%km nconv = 0 nfail = 0 do j = 1, jm do i = 1, im zs(i,j) = w_s%ze(i,kmfv+1,j) z1(i,j) = ( w_s%ze(i,kmfv,j) - w_s%ze(i,kmfv+1,j) ) / 2. ! Quantities at lowest model layer ! -------------------------------- u1(i,j) = sqrt( w_s%q3d(i,j,kmfv,1)**2 + w_s%q3d(i,j,kmfv,2)**2 ) t1(i,j) = w_s%q3d(i,j,kmfv,3) q1(i,j) = w_s%q3d(i,j,kmfv,4) qs(i,j) = 0.98 * qsat_ ( ts(i,j) ) dt1 = ts(i,j) - theta(t1(i,j),z1(i,j)) dq1 = qs(i,j) - q1(i,j) ! Over land? This is rough ! ------------------------ if ( zs(i,j) .gt. 0.5 ) cycle ! above middle of model lowest layer, set to missing ! -------------------------------------------------- if ( z2 .gt. z1(i,j) ) cycle ! Convert from lowest model layer to surface layer ! ------------------------------------------------ do k = 1, km z2 = zlevs(k) ! height to convert to call LP_MoveZ ( z1(i,j), u1(i,j), t1(i,j), dq1, dt1, ts(i,j), & z2, u2(i,j,k), conf, dq2, dt2, & CD(i,j), CT(i,j), CE(i,j), zdL(i,j) ) if ( conf .eq. 1.0 ) then t2(i,j,k) = ts(i,j) - dt2 - 0.01 * z2 q2(i,j,k) = qs(i,j) - dq2 nconv = nconv + 1 else u2(i,j,k) = amiss t2(i,j,k) = amiss q2(i,j,k) = amiss nfail = nfail + 1 end if end do end do end do print *,myname//': no. of converging gridpoints: ', nconv print *,myname//': no. of failing gridpoints: ', nfail, & nint(100.0*nfail/(nconv+nfail+0.000001)), '%' ! write out results ! ---------------- call write_grads ( ' zs ', iu, zs, im*jm, 1 ) call write_grads ( ' ts ', iu, ts, im*jm, 1 ) call write_grads ( ' qs ', iu, qs, im*jm, 1 ) call write_grads ( ' z1 ', iu, z1, im*jm, 1 ) call write_grads ( ' u1 ', iu, u1, im*jm, 1 ) call write_grads ( ' t1 ', iu, t1, im*jm, 1 ) call write_grads ( ' q1 ', iu, q1, im*jm, 1 ) call write_grads ( ' cd ', iu, cd, im*jm, 1 ) call write_grads ( ' ct ', iu, ct, im*jm, 1 ) call write_grads ( ' ce ', iu, ce, im*jm, 1 ) call write_grads ( 'zdl ', iu, zdl, im*jm, 1 ) call write_grads ( ' u2 ', iu, u2, im*jm, km ) call write_grads ( ' t2 ', iu, t2, im*jm, km ) call write_grads ( ' q2 ', iu, q2, im*jm, km ) close(iu) ! Clean up mess ! ------------- call insitu_clean ( w_s ) stop ! all done end Program ut_lp !................................................................ subroutine write_grads ( name, iu, x, m, n ) character(len=*) name real x(m,n) call minmax (name, x, m, n, 1) do j = 1, n write(iu) ( x(i,j), i = 1, m ) end do end !................................................................ subroutine minmax (name, f, m, n, l) implicit none character*(*) name integer m, n, l integer i, j, k real f(m,n,l) real fmax real fmin real mean real big parameter (big = 1.e14) integer count real mean logical hasmiss hasmiss = .false. fmax = - big fmin = + big mean = 0. count = 0 do k = 1, l do j = 1, n do i = 1, m if( abs(f(i,j,k)) .lt. big ) then fmax = max(fmax,f(i,j,k)) fmin = min(fmin,f(i,j,k)) mean = mean + f(i,j,k) count = count + 1 else hasmiss = .true. endif end do end do end do if( count .ne. 0 ) mean = mean / count if ( hasmiss ) then write(6,*) name // ' max, min, mean = ', fmax, fmin, mean, ' M' else write(6,*) name // ' max, min, mean = ', fmax, fmin, mean endif return end