File size: 2,763 Bytes
cead56f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import OAI.Geometry.ProjectionVolume.PolytopeDefinitions

namespace OAI

universe uι uκ

open Set MeasureTheory
open scoped RealInnerProductSpace Pointwise

noncomputable section
namespace Paper092.HPolytope

variable {d : ℕ} {ι : Type uι} {κ : Type uκ} [Fintype ι] [Fintype κ]

def reindex (P : HPolytope d ι) (e : κ ≃ ι) : HPolytope d κ where
  normal i := P.normal (e i)
  offset i := P.offset (e i)
  normal_unit i := P.normal_unit (e i)
  compact := by
    convert P.compact using 1
    ext x
    constructor
    · intro h i
      obtain ⟨j, rfl⟩ := e.surjective i
      exact h j
    · intro h j
      exact h (e j)
  strict_feasible := by
    obtain ⟨x, hx⟩ := P.strict_feasible
    exact ⟨x, fun i => hx (e i)⟩
  distinct := fun i j h => e.injective (P.distinct h)

theorem reindex_body (P : HPolytope d ι) (e : κ ≃ ι) :
    (P.reindex e).body = P.body := by
  ext x
  constructor
  · intro h i
    obtain ⟨j, rfl⟩ := e.surjective i
    exact h j
  · intro h j
    exact h (e j)

def translate (P : HPolytope d ι) (v : Euclidean d) : HPolytope d ι where
  normal := P.normal
  offset i := P.offset i + ⟪P.normal i, v⟫
  normal_unit := P.normal_unit
  compact := by
    have heq : {x : Euclidean d | ∀ i, ⟪P.normal i, x⟫ ≤ P.offset i + ⟪P.normal i, v⟫} =
        (fun x => v + x) '' P.body := by
      ext x
      constructor
      · intro hx
        refine ⟨x - v, ?_, by abel_nf⟩
        intro i
        have := hx i
        simpa only [inner_sub_right, sub_le_iff_le_add] using this
      · rintro ⟨x, hx, rfl⟩ i
        simpa only [inner_add_right, add_comm] using add_le_add_right (hx i) ⟪P.normal i, v⟫
    rw [heq]
    exact P.compact.image (continuous_const.add continuous_id)
  strict_feasible := by
    obtain ⟨x, hx⟩ := P.strict_feasible
    refine ⟨v + x, fun i => ?_⟩
    simpa only [inner_add_right, add_comm] using add_lt_add_right (hx i) ⟪P.normal i, v⟫
  distinct := by
    intro i j h
    apply P.distinct
    have hn := congrArg Prod.fst h
    have ho := congrArg Prod.snd h
    dsimp at hn ho
    exact Prod.ext hn (by simpa only [hn, add_left_inj] using ho)

theorem translate_body (P : HPolytope d ι) (v : Euclidean d) :
    (P.translate v).body = v +ᵥ P.body := by
  ext x
  constructor
  · intro hx
    refine ⟨x - v, ?_, by dsimp; abel_nf⟩
    intro i
    have h := hx i
    change ⟪P.normal i, x⟫ ≤ P.offset i + ⟪P.normal i, v⟫ at h
    simpa only [inner_sub_right, sub_le_iff_le_add] using h
  · rintro ⟨x, hx, rfl⟩ i
    change ⟪P.normal i, v + x⟫ ≤ P.offset i + ⟪P.normal i, v⟫
    simpa only [inner_add_right, add_comm] using add_le_add_right (hx i) ⟪P.normal i, v⟫

end Paper092.HPolytope

end

end OAI