Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 47c676e

Browse files
committed
feat(linear_algebra/affine_space/affine_subspace): affine_subspace.comap (#10795)
This copies a handful of lemmas from `group_theory/subgroup/basic.lean` to get things started.
1 parent 00454f2 commit 47c676e

File tree

2 files changed

+99
-10
lines changed

2 files changed

+99
-10
lines changed

src/geometry/euclidean/circumcenter.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ begin
463463
{ exact mem_insert_self _ _ } },
464464
change _ = ∑ i, f (point_index_embedding n i) + _,
465465
rw [add_comm, h, ←sum_map, sum_insert],
466-
simp_rw [mem_map, not_exists],
466+
simp_rw [finset.mem_map, not_exists],
467467
intros x hx h,
468468
injection h
469469
end

src/linear_algebra/affine_space/affine_subspace.lean

Lines changed: 98 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,8 @@ begin
343343
end
344344

345345
/-- 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 Pset P) :=
347+
λ s1 s2 h, begin
348348
cases s1,
349349
cases s2,
350350
congr,
@@ -353,7 +353,7 @@ end
353353

354354
@[simp] lemma ext_iff (s₁ s₂ : affine_subspace k P) :
355355
(s₁ : set P) = s₂ ↔ s₁ = s₂ :=
356-
ext, by tidy⟩
356+
λ h, coe_injective h, by tidy⟩
357357

358358
/-- Two affine subspaces with the same direction and nonempty
359359
intersection are equal. -/
@@ -554,7 +554,7 @@ instance : complete_lattice (affine_subspace k P) :=
554554
Sup_le := λ _ _ h, span_points_subset_coe_of_subset_coe (set.bUnion_subset h),
555555
Inf_le := λ _ _, set.bInter_subset_of_mem,
556556
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 }
558558

559559
instance : inhabited (affine_subspace k P) := ⟨⊤⟩
560560

@@ -1192,13 +1192,16 @@ end
11921192

11931193
end affine_subspace
11941194

1195-
section maps
1195+
section map_comap
11961196

1197-
variables {k V₁ P₁ V₂ P₂ : Type*} [ring k]
1197+
variables {k V₁ P₁ V₂ P₂ V₃ P₃ : Type*} [ring k]
11981198
variables [add_comm_group V₁] [module k V₁] [add_torsor V₁ P₁]
11991199
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₃]
12001201
include V₁ V₂
12011202

1203+
section
1204+
12021205
variables (f : P₁ →ᵃ[k] P₂)
12031206

12041207
@[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₂ :=
12181221
exact s.smul_vsub_vadd_mem t h₁ h₂ h₃,
12191222
end }
12201223

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
12221228

12231229
@[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₃
12251244

12261245
@[simp] lemma map_direction (s : affine_subspace k P₁) :
12271246
(s.map f).direction = s.direction.map f.linear :=
@@ -1264,4 +1283,74 @@ begin
12641283
exact (e.symm : P₂ →ᵃ[k] P₁).span_eq_top_of_surjective e.symm.surjective h,
12651284
end
12661285

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

Comments
 (0)