|
| 1 | +opaque double (n : Nat) : Nat |
| 2 | + |
1 | 3 | inductive Parity : Nat -> Type |
2 | | -| even (n) : Parity (n + n) |
3 | | -| odd (n) : Parity (Nat.succ (n + n)) |
| 4 | +| even (n) : Parity (double n) |
| 5 | +| odd (n) : Parity (Nat.succ (double n)) |
4 | 6 |
|
5 | | -set_option trace.Meta.Match.matchEqs true |
| 7 | +-- set_option trace.Meta.Match.matchEqs true |
6 | 8 |
|
7 | 9 | partial def natToBin3 : (n : Nat) → Parity n → List Bool |
8 | 10 | | 0, _ => [] |
9 | 11 | | _, Parity.even j => [false, false] |
10 | 12 | | _, Parity.odd j => [true, true] |
11 | 13 |
|
12 | | --- #guard_msgs in |
13 | | --- #print sig natToBin3.match_1.splitter |
14 | | - |
15 | 14 | /-- |
16 | | -error: Failed to realize constant natToBin3.match_1.congr_eq_1: |
17 | | - failed to generate equality theorem _private.lean.run.issue11342.0.natToBin3.match_1.congr_eq_2 for `match` expression `natToBin3.match_1` |
18 | | - case else.even |
19 | | - motive✝ : (x : Nat) → Parity x → Sort u_1 |
20 | | - h_1✝ : (x : Parity 0) → motive✝ 0 x |
21 | | - h_2✝ : (j : Nat) → motive✝ (j + j) (Parity.even j) |
22 | | - h_3✝ : (j : Nat) → motive✝ (j + j).succ (Parity.odd j) |
23 | | - j✝ n✝ : Nat |
24 | | - h✝ : Nat.hasNotBit 1 (n✝ + n✝).ctorIdx |
25 | | - heq_1✝ : n✝ + n✝ = j✝ + j✝ |
26 | | - heq_2✝ : Parity.even n✝ ≍ Parity.even j✝ |
27 | | - x✝ : ∀ (x : Parity 0), n✝ + n✝ = 0 → Parity.even n✝ ≍ x → False |
28 | | - ⊢ h_2✝ n✝ ≍ h_2✝ j✝ |
29 | | ---- |
30 | | -error: Unknown constant `natToBin3.match_1.congr_eq_1` |
| 15 | +info: private theorem natToBin3.match_1.congr_eq_1.{u_1} : ∀ (motive : (x : Nat) → Parity x → Sort u_1) (x : Nat) |
| 16 | + (x_1 : Parity x) (h_1 : (x : Parity 0) → motive 0 x) (h_2 : (j : Nat) → motive (double j) (Parity.even j)) |
| 17 | + (h_3 : (j : Nat) → motive (double j).succ (Parity.odd j)) (x_2 : Parity 0), |
| 18 | + x = 0 → |
| 19 | + x_1 ≍ x_2 → |
| 20 | + (match x, x_1 with |
| 21 | + | 0, x => h_1 x |
| 22 | + | .(double j), Parity.even j => h_2 j |
| 23 | + | .((double j).succ), Parity.odd j => h_3 j) ≍ |
| 24 | + h_1 x_2 |
31 | 25 | -/ |
32 | 26 | #guard_msgs(pass trace, all) in |
33 | 27 | #print sig natToBin3.match_1.congr_eq_1 |
0 commit comments