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

Commit 53ce8d4

Browse files
committed
chore: update test capture
1 parent 64ad4c6 commit 53ce8d4

13 files changed

+2798
-533
lines changed

test/dep/Dep.lean.leanInk.expected

Lines changed: 475 additions & 165 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,3 @@
11
[{"contents":
2-
"/-|\nCopyright (c) 2014 Microsoft Corporation. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthor: Leonardo de Moura, Jeremy Avigad, Haitao Zhang\n|-/\n-- a port of core Lean `init/function.lean`\n\n/-!\n# General operations on functions\n-/\n\nnamespace Function\n\nvariable {α : Sort u₁} {β : Sort u₂} {φ : Sort u₃} {δ : Sort u₄} {ζ : Sort u₁}\n\n@[reducible] def comp_right (f : β → β → β) (g : α → β) : β → α → β :=\nλ b a => f b (g a)\n\n@[reducible] def comp_left (f : β → β → β) (g : α → β) : α → β → β :=\nλ a b => f (g a) b\n\n/-- Given functions `f : β → β → φ` and `g : α → β`, produce a function `α → α → φ` that evaluates\n`g` on each argument, then applies `f` to the results. Can be used, e.g., to transfer a relation\nfrom `β` to `α`. -/\n@[reducible] def on_fun (f : β → β → φ) (g : α → β) : α → α → φ :=\nλ x y => f (g x) (g y)\n\n@[reducible] def combine (f : α → β → φ) (op : φ → δ → ζ) (g : α → β → δ)\n : α → β → ζ :=\nλ x y => op (f x y) (g x y)\n\n@[reducible] def swap {φ : α → β → Sort u₃} (f : ∀ x y, φ x y) : ∀ y x, φ x y :=\nλ y x => f x y\n\n@[reducible] def app {β : α → Sort u₂} (f : ∀ x, β x) (x : α) : β x :=\nf x\n\ntheorem left_id (f : α → β) : id ∘ f = f := rfl\n\ntheorem right_id (f : α → β) : f ∘ id = f := rfl\n\n@[simp] theorem comp_app (f : β → φ) (g : α → β) (a : α) : (f ∘ g) a = f (g a) := rfl\n\ntheorem comp.assoc (f : φ → δ) (g : β → φ) (h : α → β) : (f ∘ g) ∘ h = f ∘ (g ∘ h) := rfl\n\n@[simp] theorem comp.left_id (f : α → β) : id ∘ f = f := rfl\n\n@[simp] theorem comp.right_id (f : α → β) : f ∘ id = f := rfl\n\ntheorem comp_const_right (f : β → φ) (b : β) : f ∘ (const α b) = const α (f b) := rfl\n\n/-- A function `f : α → β` is called injective if `f x = f y` implies `x = y`. -/\n@[reducible] def injective (f : α → β) : Prop := ∀ {a₁ a₂}, f a₁ = f a₂ → a₁ = a₂\n\ntheorem injective.comp {g : β → φ} {f : α → β} (hg : injective g) (hf : injective f) :\n injective (g ∘ f) :=\nλ h => hf (hg h)\n\n/-- A function `f : α → β` is calles surjective if every `b : β` is equal to `f a`\nfor some `a : α`. -/\n@[reducible] def surjective (f : α → β) : Prop := ∀ b, ∃ a, f a = b\n\ntheorem surjective.comp {g : β → φ} {f : α → β} (hg : surjective g) (hf : surjective f) :\n surjective (g ∘ f) :=\nλ (c : φ) => Exists.elim (hg c) (λ b hb => Exists.elim (hf b) (λ a ha =>\n Exists.intro a (show g (f a) = c from (Eq.trans (congrArg g ha) hb))))\n\n/-- A function is called bijective if it is both injective and surjective. -/\ndef bijective (f : α → β) := injective f ∧ surjective f\n\ntheorem bijective.comp {g : β → φ} {f : α → β} : bijective g → bijective f → bijective (g ∘ f)\n| ⟨h_ginj, h_gsurj⟩, ⟨h_finj, h_fsurj⟩ => ⟨h_ginj.comp h_finj, h_gsurj.comp h_fsurj⟩\n\n/-- `left_inverse g f` means that g is a left inverse to f. That is, `g ∘ f = id`. -/\ndef left_inverse (g : β → α) (f : α → β) : Prop := ∀ x, g (f x) = x\n\n/-- `has_left_inverse f` means that `f` has an unspecified left inverse. -/\ndef has_left_inverse (f : α → β) : Prop := ∃ finv : β → α, left_inverse finv f\n\n/-- `right_inverse g f` means that g is a right inverse to f. That is, `f ∘ g = id`. -/\ndef right_inverse (g : β → α) (f : α → β) : Prop := left_inverse f g\n\n/-- `has_right_inverse f` means that `f` has an unspecified right inverse. -/\ndef has_right_inverse (f : α → β) : Prop := ∃ finv : β → α, right_inverse finv f\n\ntheorem left_inverse.injective {g : β → α} {f : α → β} : left_inverse g f → injective f :=\nλ h a b hf => h a ▸ h b ▸ hf ▸ rfl\n\ntheorem has_left_inverse.injective {f : α → β} : has_left_inverse f → injective f :=\nλ h => Exists.elim h (λ finv inv => inv.injective)\n\ntheorem right_inverse_of_injective_of_left_inverse {f : α → β} {g : β → α}\n (injf : injective f) (lfg : left_inverse f g) :\n right_inverse f g :=\nλ x => injf $ lfg $ f x\n\ntheorem right_inverse.surjective {f : α → β} {g : β → α} (h : right_inverse g f) : surjective f :=\nλ y => ⟨g y, h y⟩\n\ntheorem has_right_inverse.surjective {f : α → β} : has_right_inverse f → surjective f\n| ⟨finv, inv⟩ => inv.surjective\n\ntheorem left_inverse_of_surjective_of_right_inverse {f : α → β} {g : β → α} (surjf : surjective f)\n (rfg : right_inverse f g) : left_inverse f g :=\nλ y =>\n let ⟨x, hx⟩ := surjf y\n by rw [",
3-
"_type": "text"},
4-
{"messages": [],
5-
"goals":
6-
[{"name": "",
7-
"hypotheses":
8-
[{"type": "Sort u₁", "names": ["α"], "body": "", "_type": "hypothesis"},
9-
{"type": "Sort u₂", "names": ["β"], "body": "", "_type": "hypothesis"},
10-
{"type": "Sort u₃", "names": ["φ"], "body": "", "_type": "hypothesis"},
11-
{"type": "Sort u₄", "names": ["δ"], "body": "", "_type": "hypothesis"},
12-
{"type": "Sort u₁", "names": ["ζ"], "body": "", "_type": "hypothesis"},
13-
{"type": "α → β", "names": ["f"], "body": "", "_type": "hypothesis"},
14-
{"type": "β → α", "names": ["g"], "body": "", "_type": "hypothesis"},
15-
{"type": "surjective f",
16-
"names": ["surjf"],
17-
"body": "",
18-
"_type": "hypothesis"},
19-
{"type": "right_inverse f g",
20-
"names": ["rfg"],
21-
"body": "",
22-
"_type": "hypothesis"},
23-
{"type": "β", "names": ["y"], "body": "", "_type": "hypothesis"},
24-
{"type": "α", "names": ["x"], "body": "", "_type": "hypothesis"},
25-
{"type": "f x = y", "names": ["hx"], "body": "", "_type": "hypothesis"}],
26-
"conclusion": "f (g (f x)) = f x",
27-
"_type": "goal"}],
28-
"contents": "← hx,",
29-
"_type": "sentence"},
30-
{"contents": " ", "_type": "text"},
31-
{"messages": [],
32-
"goals":
33-
[{"name": "",
34-
"hypotheses":
35-
[{"type": "Sort u₁", "names": ["α"], "body": "", "_type": "hypothesis"},
36-
{"type": "Sort u₂", "names": ["β"], "body": "", "_type": "hypothesis"},
37-
{"type": "Sort u₃", "names": ["φ"], "body": "", "_type": "hypothesis"},
38-
{"type": "Sort u₄", "names": ["δ"], "body": "", "_type": "hypothesis"},
39-
{"type": "Sort u₁", "names": ["ζ"], "body": "", "_type": "hypothesis"},
40-
{"type": "α → β", "names": ["f"], "body": "", "_type": "hypothesis"},
41-
{"type": "β → α", "names": ["g"], "body": "", "_type": "hypothesis"},
42-
{"type": "surjective f",
43-
"names": ["surjf"],
44-
"body": "",
45-
"_type": "hypothesis"},
46-
{"type": "right_inverse f g",
47-
"names": ["rfg"],
48-
"body": "",
49-
"_type": "hypothesis"},
50-
{"type": "β", "names": ["y"], "body": "", "_type": "hypothesis"},
51-
{"type": "α", "names": ["x"], "body": "", "_type": "hypothesis"},
52-
{"type": "f x = y", "names": ["hx"], "body": "", "_type": "hypothesis"}],
53-
"conclusion": "f x = f x",
54-
"_type": "goal"}],
55-
"contents": "rfg",
56-
"_type": "sentence"},
57-
{"contents":
58-
"]\n\ntheorem injective_id : injective (@id α) := id\n\ntheorem surjective_id : surjective (@id α) := λ a => ⟨a, rfl⟩\n\ntheorem bijective_id : bijective (@id α) := ⟨injective_id, surjective_id⟩\n\nend Function\n\nnamespace Function\n\nvariable {α : Type u₁} {β : Type u₂} {φ : Type u₃}\n\n/-- Interpret a function on `α × β` as a function with two arguments. -/\n@[inline] def curry : (α × β → φ) → α → β → φ :=\nλ f a b => f (a, b)\n\n/-- Interpret a function with two arguments as a function on `α × β` -/\n@[inline] def uncurry : (α → β → φ) → α × β → φ :=\nλ f a => f a.1 a.2\n\n@[simp] theorem curry_uncurry (f : α → β → φ) : curry (uncurry f) = f :=\nrfl\n\n@[simp] theorem uncurry_curry (f : α × β → φ) : uncurry (curry f) = f :=\nfunext (λ ⟨a, b⟩ => rfl)\n\nprotected theorem left_inverse.id {g : β → α} {f : α → β} (h : left_inverse g f) : g ∘ f = id :=\nfunext h\n\nprotected theorem right_inverse.id {g : β → α} {f : α → β} (h : right_inverse g f) : f ∘ g = id :=\nfunext h\n\nend Function\n",
2+
"/-|\nCopyright (c) 2014 Microsoft Corporation. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthor: Leonardo de Moura, Jeremy Avigad, Haitao Zhang\n|-/\n-- a port of core Lean `init/function.lean`\n\n/-!\n# General operations on functions\n-/\n\nnamespace Function\n\nvariable {α : Sort u₁} {β : Sort u₂} {φ : Sort u₃} {δ : Sort u₄} {ζ : Sort u₁}\n\n@[reducible] def comp_right (f : β → β → β) (g : α → β) : β → α → β :=\nλ b a => f b (g a)\n\n@[reducible] def comp_left (f : β → β → β) (g : α → β) : α → β → β :=\nλ a b => f (g a) b\n\n/-- Given functions `f : β → β → φ` and `g : α → β`, produce a function `α → α → φ` that evaluates\n`g` on each argument, then applies `f` to the results. Can be used, e.g., to transfer a relation\nfrom `β` to `α`. -/\n@[reducible] def on_fun (f : β → β → φ) (g : α → β) : α → α → φ :=\nλ x y => f (g x) (g y)\n\n@[reducible] def combine (f : α → β → φ) (op : φ → δ → ζ) (g : α → β → δ)\n : α → β → ζ :=\nλ x y => op (f x y) (g x y)\n\n@[reducible] def swap {φ : α → β → Sort u₃} (f : ∀ x y, φ x y) : ∀ y x, φ x y :=\nλ y x => f x y\n\n@[reducible] def app {β : α → Sort u₂} (f : ∀ x, β x) (x : α) : β x :=\nf x\n\ntheorem left_id (f : α → β) : id ∘ f = f := rfl\n\ntheorem right_id (f : α → β) : f ∘ id = f := rfl\n\n@[simp] theorem comp_app (f : β → φ) (g : α → β) (a : α) : (f ∘ g) a = f (g a) := rfl\n\ntheorem comp.assoc (f : φ → δ) (g : β → φ) (h : α → β) : (f ∘ g) ∘ h = f ∘ (g ∘ h) := rfl\n\n@[simp] theorem comp.left_id (f : α → β) : id ∘ f = f := rfl\n\n@[simp] theorem comp.right_id (f : α → β) : f ∘ id = f := rfl\n\ntheorem comp_const_right (f : β → φ) (b : β) : f ∘ (const α b) = const α (f b) := rfl\n\n/-- A function `f : α → β` is called injective if `f x = f y` implies `x = y`. -/\n@[reducible] def injective (f : α → β) : Prop := ∀ {a₁ a₂}, f a₁ = f a₂ → a₁ = a₂\n\ntheorem injective.comp {g : β → φ} {f : α → β} (hg : injective g) (hf : injective f) :\n injective (g ∘ f) :=\nλ h => hf (hg h)\n\n/-- A function `f : α → β` is calles surjective if every `b : β` is equal to `f a`\nfor some `a : α`. -/\n@[reducible] def surjective (f : α → β) : Prop := ∀ b, ∃ a, f a = b\n\ntheorem surjective.comp {g : β → φ} {f : α → β} (hg : surjective g) (hf : surjective f) :\n surjective (g ∘ f) :=\nλ (c : φ) => Exists.elim (hg c) (λ b hb => Exists.elim (hf b) (λ a ha =>\n Exists.intro a (show g (f a) = c from (Eq.trans (congrArg g ha) hb))))\n\n/-- A function is called bijective if it is both injective and surjective. -/\ndef bijective (f : α → β) := injective f ∧ surjective f\n\ntheorem bijective.comp {g : β → φ} {f : α → β} : bijective g → bijective f → bijective (g ∘ f)\n| ⟨h_ginj, h_gsurj⟩, ⟨h_finj, h_fsurj⟩ => ⟨h_ginj.comp h_finj, h_gsurj.comp h_fsurj⟩\n\n/-- `left_inverse g f` means that g is a left inverse to f. That is, `g ∘ f = id`. -/\ndef left_inverse (g : β → α) (f : α → β) : Prop := ∀ x, g (f x) = x\n\n/-- `has_left_inverse f` means that `f` has an unspecified left inverse. -/\ndef has_left_inverse (f : α → β) : Prop := ∃ finv : β → α, left_inverse finv f\n\n/-- `right_inverse g f` means that g is a right inverse to f. That is, `f ∘ g = id`. -/\ndef right_inverse (g : β → α) (f : α → β) : Prop := left_inverse f g\n\n/-- `has_right_inverse f` means that `f` has an unspecified right inverse. -/\ndef has_right_inverse (f : α → β) : Prop := ∃ finv : β → α, right_inverse finv f\n\ntheorem left_inverse.injective {g : β → α} {f : α → β} : left_inverse g f → injective f :=\nλ h a b hf => h a ▸ h b ▸ hf ▸ rfl\n\ntheorem has_left_inverse.injective {f : α → β} : has_left_inverse f → injective f :=\nλ h => Exists.elim h (λ finv inv => inv.injective)\n\ntheorem right_inverse_of_injective_of_left_inverse {f : α → β} {g : β → α}\n (injf : injective f) (lfg : left_inverse f g) :\n right_inverse f g :=\nλ x => injf $ lfg $ f x\n\ntheorem right_inverse.surjective {f : α → β} {g : β → α} (h : right_inverse g f) : surjective f :=\nλ y => ⟨g y, h y⟩\n\ntheorem has_right_inverse.surjective {f : α → β} : has_right_inverse f → surjective f\n| ⟨finv, inv⟩ => inv.surjective\n\ntheorem left_inverse_of_surjective_of_right_inverse {f : α → β} {g : β → α} (surjf : surjective f)\n (rfg : right_inverse f g) : left_inverse f g :=\nλ y =>\n let ⟨x, hx⟩ := surjf y\n by rw [← hx, rfg]\n\ntheorem injective_id : injective (@id α) := id\n\ntheorem surjective_id : surjective (@id α) := λ a => ⟨a, rfl⟩\n\ntheorem bijective_id : bijective (@id α) := ⟨injective_id, surjective_id⟩\n\nend Function\n\nnamespace Function\n\nvariable {α : Type u₁} {β : Type u₂} {φ : Type u₃}\n\n/-- Interpret a function on `α × β` as a function with two arguments. -/\n@[inline] def curry : (α × β → φ) → α → β → φ :=\nλ f a b => f (a, b)\n\n/-- Interpret a function with two arguments as a function on `α × β` -/\n@[inline] def uncurry : (α → β → φ) → α × β → φ :=\nλ f a => f a.1 a.2\n\n@[simp] theorem curry_uncurry (f : α → β → φ) : curry (uncurry f) = f :=\nrfl\n\n@[simp] theorem uncurry_curry (f : α × β → φ) : uncurry (curry f) = f :=\nfunext (λ ⟨a, b⟩ => rfl)\n\nprotected theorem left_inverse.id {g : β → α} {f : α → β} (h : left_inverse g f) : g ∘ f = id :=\nfunext h\n\nprotected theorem right_inverse.id {g : β → α} {f : α → β} (h : right_inverse g f) : f ∘ g = id :=\nfunext h\n\nend Function\n",
593
"_type": "text"}]
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
[{"contents":
2-
"import Lean\n\nopen Lean.Elab\n\nstructure A where\n val : Nat → Nat\n\nstructure B where\n pair : A × A\n\ndef f (x : Nat) : Nat × Nat :=\n let y := ⟨x, x⟩\n id y\n\ndef h : (x y : Nat) → (b : Bool) → x + 0 = x :=\n fun x y b => by\n simp\n\ndef f2 : (x y : Nat) → (b : Bool) → Nat :=\n fun x y b =>\n let (z, w) := (x + y, x - y)\n let z1 := z + w\n z + z1\n\ndef f3 (s : Nat × Array (Array Nat)) : Array Nat :=\n s.2[1].push s.1\n\ndef f4 (arg : B) : Nat :=\n arg.pair.fst.val 0\n\ndef f5 (x : Nat) : B := {\n pair := ({ val := id }, { val := id })\n}\n\nopen Nat in\n",
2+
"import Lean\n\nopen Lean.Elab\n\nstructure A where\n val : Nat → Nat\n\nstructure B where\n pair : A × A\n\ndef f (x : Nat) : Nat × Nat :=\n let y := ⟨x, x⟩\n id y\n\ndef h : (x y : Nat) → (b : Bool) → x + 0 = x :=\n fun x y b => ",
33
"_type": "text"},
4-
{"messages":
5-
[{"contents": "def Nat.xor : Nat → Nat → Nat :=\nbitwise bne\n",
6-
"_type": "message"}],
7-
"goals": [],
8-
"contents": "#print",
4+
{"messages": [],
5+
"goals":
6+
[{"name": "",
7+
"hypotheses":
8+
[{"type": "Nat", "names": ["x", "y"], "body": "", "_type": "hypothesis"},
9+
{"type": "Bool", "names": ["b"], "body": "", "_type": "hypothesis"}],
10+
"conclusion": "x + 0 = x",
11+
"_type": "goal"}],
12+
"contents": "by\n ",
913
"_type": "sentence"},
10-
{"contents": " xor\ninstance : Inhabited Nat where\n\n", "_type": "text"},
11-
{"messages":
12-
[{"contents": "infoTree.lean:39:0: error: expected identifier or term\n",
13-
"_type": "message"}],
14-
"goals": [],
15-
"contents": "macro",
14+
{"messages": [],
15+
"goals": [{"name": "", "hypotheses": [], "conclusion": "🐙", "_type": "goal"}],
16+
"contents": "simp",
1617
"_type": "sentence"},
17-
{"messages":
18-
[{"contents": "infoTree.lean:39:0: error: expected identifier or term\n",
19-
"_type": "message"},
20-
{"contents": "infoTree.lean:39:5: error: unexpected end of input\n",
21-
"_type": "message"}],
22-
"goals": [],
23-
"contents": "",
24-
"_type": "sentence"}]
18+
{"contents":
19+
"\n\ndef f2 : (x y : Nat) → (b : Bool) → Nat :=\n fun x y b =>\n let (z, w) := (x + y, x - y)\n let z1 := z + w\n z + z1\n\ndef f3 (s : Nat × Array (Array Nat)) : Array Nat :=\n s.2[1].push s.1\n\ndef f4 (arg : B) : Nat :=\n arg.pair.fst.val 0\n\ndef f5 (x : Nat) : B := {\n pair := ({ val := id }, { val := id })\n}\n\nopen Nat in\n",
20+
"_type": "text"},
21+
{"contents": "#print", "_type": "text"},
22+
{"contents": " xor\ninstance : Inhabited Nat where\n\n", "_type": "text"},
23+
{"contents": "macro", "_type": "text"},
24+
{"contents": "", "_type": "text"}]

0 commit comments

Comments
 (0)