1 (* (C) 2014 Luca Bressan *)
6 definition eplus: est → est → est ≝
9 (λz,z'. (∃b: B. ∃b': B. (z = inl … b) ∧ ((z' = inl … b') ∧ (b ≃ b')))
10 ∨ (∃c: C. ∃c': C. (z = inr … c) ∧ ((z' = inr … c') ∧ (c ≃ c'))))
12 % [ * #x [ %1 | %2 ] %{x} %{x} %
13 [ 1,3: @(reflexivity …)
14 | 2: @(mk_conj … (reflexivity …) (ıx))
15 | 4: @(mk_conj … (reflexivity …) (ıx))
17 | #z1 #z2 * * #x1 * #x2 * #h1 * #h2 #e [ %1 | %2 ] %{x2} %{x1} %
23 | #z1 #z2 #z3 * * #x1 * #x12 * #h1 * #h12 #e12 * * #x23 * #x3 * #h23 * #h3 #e23
28 (rewrite_l … x23 (λz. z ≃ x3) e23 …
29 (injectivity_inl … (h12⁻¹•h23)⁻¹)))
32 | @(falsum_rect_CProp0 … (plus_clash … (h12⁻¹•h23)))
33 | @(falsum_rect_CProp0 … (plus_clash … ((h12⁻¹•h23)⁻¹)))
38 (rewrite_l … x23 (λz. z ≃ x3) e23 …
39 (injectivity_inr … (h12⁻¹•h23)⁻¹)))
46 definition einl: ∀B,C: est. eto B (eplus B C) ≝
48 #x #y #h %1 %{x} %{y} % % [ % | @h ]
51 definition einr: ∀B,C: est. eto C (eplus B C) ≝
53 #x #y #h %2 %{x} %{y} % % [ % | @h ]
56 lemma injectivity_einl: ∀B,C: est. ∀b,b': B. (einl B C)˙b ≃ (einl B C)˙b' → b ≃ b'.
57 #B #C #b #b' * * #z * #z' * #h1 * #h2 #h3
58 [ @(rewrite_l … z (λw. w ≃ b')
59 (rewrite_l … z' (λw. z ≃ w) h3 … (symmetry … (injectivity_inl … h2))) …
60 (symmetry … (injectivity_inl … h1)))
61 | @(falsum_rect_CProp0 … (plus_clash … h1))
65 lemma injectivity_einr: ∀B,C: est. ∀c,c': C. (einr B C)˙c ≃ (einr B C)˙c' → c ≃ c'.
66 #B #C #c #c' * * #z * #z' * #h1 * #h2 #h3
67 [ @(falsum_rect_CProp0 … (plus_clash … (symmetry … h1)))
68 | @(rewrite_l … z (λw. w ≃ c')
69 (rewrite_l … z' (λw. z ≃ w) h3 … (symmetry … (injectivity_inr … h2))) …
70 (symmetry … (injectivity_inr … h1)))
74 definition edplus: ∀I: est. edst I → edst I → edst I.
76 [ @(λi. eplus (B i) (C i))
77 | #i1 #i2 #e * #x [ @(inl … (x∘e)) | @(inr … (x∘e)) ]
78 | % [ #i1 #i2 #e * #x1 * #x2 #h
79 cases h * #z1 * #z2 * #h1 * #h2 #d
80 [ 1: %1 %{(x1∘e)} %{(x2∘e)} % [ % | % [ % | @(pres_eq … (injectivity_einl … h)) ]]
81 | 2,4: @(falsum_rect_CProp0 … (plus_clash … h1))
82 | 3: @(falsum_rect_CProp0 … (plus_clash … h2⁻¹))
83 | 5,7: @(falsum_rect_CProp0 … (plus_clash … h1⁻¹))
84 | 6: @(falsum_rect_CProp0 … (plus_clash … h2))
85 | 8: %2 %{(x1∘e)} %{(x2∘e)} % [ % | % [ % | @(pres_eq … (injectivity_einr … h)) ]]
87 | #i1 #i2 #e1 #e2 * #x [ %1 | %2 ] %{(x∘e1)} %{(x∘e2)} %
88 [ 1,3: % | 2,4: % [ 1,3: % | 2,4: @not_dep ]]
89 | #i * #x [ %1 | %2 ] %{(x∘ıi)} %{x} %
90 [ 1,3: % | 2,4: % [ 1,3: % | 2,4: @pres_id ]]
91 | #i1 #i2 #i3 * #x #d1 #d2 [ %1 | %2 ] %{(x∘d1∘d2)} %{(x∘d1•d2)} %
92 [ 1,3: % | 2,4: % [ 1,3: % | 2,4: @clos_comp ]]