@@ -343,8 +343,8 @@ begin
343
343
end
344
344
345
345
/-- Two affine subspaces are equal if they have the same points. -/
346
- @[ext] lemma ext {s1 s2 : affine_subspace k P} (h : (s1 : set P) = s2) : s1 = s2 :=
347
- begin
346
+ @[ext] lemma coe_injective : function.injective (coe : affine_subspace k P → set P) :=
347
+ λ s1 s2 h, begin
348
348
cases s1,
349
349
cases s2,
350
350
congr,
353
353
354
354
@[simp] lemma ext_iff (s₁ s₂ : affine_subspace k P) :
355
355
(s₁ : set P) = s₂ ↔ s₁ = s₂ :=
356
- ⟨ext , by tidy⟩
356
+ ⟨λ h, coe_injective h , by tidy⟩
357
357
358
358
/-- Two affine subspaces with the same direction and nonempty
359
359
intersection are equal. -/
@@ -554,7 +554,7 @@ instance : complete_lattice (affine_subspace k P) :=
554
554
Sup_le := λ _ _ h, span_points_subset_coe_of_subset_coe (set.bUnion_subset h),
555
555
Inf_le := λ _ _, set.bInter_subset_of_mem,
556
556
le_Inf := λ _ _, set.subset_bInter,
557
- .. partial_order.lift (coe : affine_subspace k P → set P) (λ _ _, ext) }
557
+ .. partial_order.lift (coe : affine_subspace k P → set P) coe_injective }
558
558
559
559
instance : inhabited (affine_subspace k P) := ⟨⊤⟩
560
560
@@ -1192,13 +1192,16 @@ end
1192
1192
1193
1193
end affine_subspace
1194
1194
1195
- section maps
1195
+ section map_comap
1196
1196
1197
- variables {k V₁ P₁ V₂ P₂ : Type *} [ring k]
1197
+ variables {k V₁ P₁ V₂ P₂ V₃ P₃ : Type *} [ring k]
1198
1198
variables [add_comm_group V₁] [module k V₁] [add_torsor V₁ P₁]
1199
1199
variables [add_comm_group V₂] [module k V₂] [add_torsor V₂ P₂]
1200
+ variables [add_comm_group V₃] [module k V₃] [add_torsor V₃ P₃]
1200
1201
include V₁ V₂
1201
1202
1203
+ section
1204
+
1202
1205
variables (f : P₁ →ᵃ[k] P₂)
1203
1206
1204
1207
@[simp] lemma affine_map.vector_span_image_eq_submodule_map {s : set P₁} :
@@ -1218,10 +1221,26 @@ def map (s : affine_subspace k P₁) : affine_subspace k P₂ :=
1218
1221
exact s.smul_vsub_vadd_mem t h₁ h₂ h₃,
1219
1222
end }
1220
1223
1221
- @[simp] lemma map_coe (s : affine_subspace k P₁) : (s.map f : set P₂) = f '' s := rfl
1224
+ @[simp] lemma coe_map (s : affine_subspace k P₁) : (s.map f : set P₂) = f '' s := rfl
1225
+
1226
+ @[simp] lemma mem_map {f : P₁ →ᵃ[k] P₂} {x : P₂} {s : affine_subspace k P₁} :
1227
+ x ∈ s.map f ↔ ∃ y ∈ s, f y = x := mem_image_iff_bex
1222
1228
1223
1229
@[simp] lemma map_bot : (⊥ : affine_subspace k P₁).map f = ⊥ :=
1224
- by { rw ← ext_iff, exact image_empty f, }
1230
+ coe_injective $ image_empty f
1231
+
1232
+ omit V₂
1233
+
1234
+ @[simp] lemma map_id (s : affine_subspace k P₁) : s.map (affine_map.id k P₁) = s :=
1235
+ coe_injective $ image_id _
1236
+
1237
+ include V₂ V₃
1238
+
1239
+ lemma map_map (s : affine_subspace k P₁) (f : P₁ →ᵃ[k] P₂) (g : P₂ →ᵃ[k] P₃) :
1240
+ (s.map f).map g = s.map (g.comp f) :=
1241
+ coe_injective $ image_image _ _ _
1242
+
1243
+ omit V₃
1225
1244
1226
1245
@[simp] lemma map_direction (s : affine_subspace k P₁) :
1227
1246
(s.map f).direction = s.direction.map f.linear :=
@@ -1264,4 +1283,74 @@ begin
1264
1283
exact (e.symm : P₂ →ᵃ[k] P₁).span_eq_top_of_surjective e.symm.surjective h,
1265
1284
end
1266
1285
1267
- end maps
1286
+ end
1287
+
1288
+ namespace affine_subspace
1289
+
1290
+ /-- The preimage of an affine subspace under an affine map as an affine subspace. -/
1291
+ def comap (f : P₁ →ᵃ[k] P₂) (s : affine_subspace k P₂) : affine_subspace k P₁ :=
1292
+ { carrier := f ⁻¹' s,
1293
+ smul_vsub_vadd_mem := λ t p₁ p₂ p₃ (hp₁ : f p₁ ∈ s) (hp₂ : f p₂ ∈ s) (hp₃ : f p₃ ∈ s),
1294
+ show f _ ∈ s, begin
1295
+ rw [affine_map.map_vadd, linear_map.map_smul, affine_map.linear_map_vsub],
1296
+ apply s.smul_vsub_vadd_mem _ hp₁ hp₂ hp₃,
1297
+ end }
1298
+
1299
+ @[simp] lemma coe_comap (f : P₁ →ᵃ[k] P₂) (s : affine_subspace k P₂) :
1300
+ (s.comap f : set P₁) = f ⁻¹' ↑s := rfl
1301
+
1302
+ @[simp] lemma mem_comap {f : P₁ →ᵃ[k] P₂} {x : P₁} {s : affine_subspace k P₂} :
1303
+ x ∈ s.comap f ↔ f x ∈ s := iff.rfl
1304
+
1305
+ lemma comap_mono {f : P₁ →ᵃ[k] P₂} {s t : affine_subspace k P₂} : s ≤ t → s.comap f ≤ t.comap f :=
1306
+ preimage_mono
1307
+
1308
+ @[simp] lemma comap_top {f : P₁ →ᵃ[k] P₂} : (⊤ : affine_subspace k P₂).comap f = ⊤ :=
1309
+ by { rw ← ext_iff, exact preimage_univ, }
1310
+
1311
+ omit V₂
1312
+
1313
+ @[simp] lemma comap_id (s : affine_subspace k P₁) : s.comap (affine_map.id k P₁) = s :=
1314
+ coe_injective rfl
1315
+
1316
+ include V₂ V₃
1317
+
1318
+ lemma comap_comap (s : affine_subspace k P₃) (f : P₁ →ᵃ[k] P₂) (g : P₂ →ᵃ[k] P₃) :
1319
+ (s.comap g).comap f = s.comap (g.comp f) :=
1320
+ coe_injective rfl
1321
+
1322
+ omit V₃
1323
+
1324
+ -- lemmas about map and comap derived from the galois connection
1325
+
1326
+ lemma map_le_iff_le_comap {f : P₁ →ᵃ[k] P₂} {s : affine_subspace k P₁} {t : affine_subspace k P₂} :
1327
+ s.map f ≤ t ↔ s ≤ t.comap f :=
1328
+ image_subset_iff
1329
+
1330
+ lemma gc_map_comap (f : P₁ →ᵃ[k] P₂) : galois_connection (map f) (comap f) :=
1331
+ λ _ _, map_le_iff_le_comap
1332
+
1333
+ lemma map_comap_le (f : P₁ →ᵃ[k] P₂) (s : affine_subspace k P₂) : (s.comap f).map f ≤ s :=
1334
+ (gc_map_comap f).l_u_le _
1335
+
1336
+ lemma le_comap_map (f : P₁ →ᵃ[k] P₂) (s : affine_subspace k P₁) : s ≤ (s.map f).comap f :=
1337
+ (gc_map_comap f).le_u_l _
1338
+
1339
+ lemma map_sup (s t : affine_subspace k P₁) (f : P₁ →ᵃ[k] P₂) : (s ⊔ t).map f = s.map f ⊔ t.map f :=
1340
+ (gc_map_comap f).l_sup
1341
+
1342
+ lemma map_supr {ι : Sort *} (f : P₁ →ᵃ[k] P₂) (s : ι → affine_subspace k P₁) :
1343
+ (supr s).map f = ⨆ i, (s i).map f :=
1344
+ (gc_map_comap f).l_supr
1345
+
1346
+ lemma comap_inf (s t : affine_subspace k P₂) (f : P₁ →ᵃ[k] P₂) :
1347
+ (s ⊓ t).comap f = s.comap f ⊓ t.comap f :=
1348
+ (gc_map_comap f).u_inf
1349
+
1350
+ lemma comap_supr {ι : Sort *} (f : P₁ →ᵃ[k] P₂) (s : ι → affine_subspace k P₂) :
1351
+ (infi s).comap f = ⨅ i, (s i).comap f :=
1352
+ (gc_map_comap f).u_infi
1353
+
1354
+ end affine_subspace
1355
+
1356
+ end map_comap
0 commit comments