fix(frontends/lean): problems with sections

This commit is contained in:
Leonardo de Moura 2015-04-21 19:46:57 -07:00
parent 9fb7aa9f1c
commit 3df99e514b
5 changed files with 5 additions and 27 deletions

View file

@ -50,8 +50,8 @@ definition weak_funext_of_naive_funext : naive_funext → weak_funext :=
funext, the space of "pointwise homotopies" has the same universal property as
the space of paths. -/
context
universes l k
section
universe variables l k
parameters [wf : weak_funext.{l k}] {A : Type.{l}} {B : A → Type.{k}} (f : Π x, B x)
definition is_contr_sigma_homotopy [instance] : is_contr (Σ (g : Π x, B x), f g) :=
@ -86,7 +86,6 @@ context
local attribute homotopy_ind [reducible]
definition homotopy_ind_comp : homotopy_ind f (homotopy.refl f) = d :=
(@hprop_eq_of_is_contr _ _ _ _ !center_eq idp)⁻¹ ▹ idp
end
-- Now the proof is fairly easy; we can just use the same induction principle on both sides.

View file

@ -1174,7 +1174,7 @@ name parser::check_constant_next(char const * msg) {
name id = check_id_next(msg);
expr e = id_to_expr(id, p);
if (in_context(m_env) && is_as_atomic(e)) {
if ((in_section(m_env) || in_context(m_env)) && is_as_atomic(e)) {
e = get_app_fn(get_as_atomic_arg(e));
if (is_explicit(e))
e = get_explicit_arg(e);

View file

@ -1,19 +0,0 @@
open nat
constant list.{l} : Type.{l} → Type.{l}
constant vector.{l} : Type.{l} → nat → Type.{l}
constant nil (A : Type) : list A
set_option pp.coercions true
context
parameter A : Type
parameter n : nat
definition foo2 [coercion] (v : vector A n) : list A :=
nil A
definition foo (v : vector A n) : list A :=
nil A
attribute foo [coercion]
end

View file

@ -1,2 +0,0 @@
bad_coercions.lean:12:18: error: invalid '[coercion]' attribute, (non local) coercions cannot be defined in contexts
bad_coercions.lean:18:16: error: invalid '[coercion]' attribute, (non local) coercions cannot be defined in contexts

View file

@ -11,7 +11,7 @@ mk : Π (comp : Π⦃A B C : ob⦄, mor B C → mor A B → mor A C)
attribute category [class]
namespace category
context sec_cat
section sec_cat
parameter A : Type
inductive foo :=
mk : A → foo
@ -20,7 +20,7 @@ context sec_cat
parameters {ob : Type} {mor : ob → ob → Type} {Cat : category ob mor}
definition compose := category.rec (λ comp id assoc idr idl, comp) Cat
definition id := category.rec (λ comp id assoc idr idl, id) Cat
infixr ∘ := compose
local infixr ∘ := compose
inductive is_section {A B : ob} (f : mor A B) : Type :=
mk : ∀g, g ∘ f = id → is_section f
end sec_cat