Step |
Hyp |
Ref |
Expression |
1 |
|
metakunt27.1 |
⊢ ( 𝜑 → 𝑀 ∈ ℕ ) |
2 |
|
metakunt27.2 |
⊢ ( 𝜑 → 𝐼 ∈ ℕ ) |
3 |
|
metakunt27.3 |
⊢ ( 𝜑 → 𝐼 ≤ 𝑀 ) |
4 |
|
metakunt27.4 |
⊢ ( 𝜑 → 𝑋 ∈ ( 1 ... 𝑀 ) ) |
5 |
|
metakunt27.5 |
⊢ 𝐴 = ( 𝑥 ∈ ( 1 ... 𝑀 ) ↦ if ( 𝑥 = 𝐼 , 𝑀 , if ( 𝑥 < 𝐼 , 𝑥 , ( 𝑥 − 1 ) ) ) ) |
6 |
|
metakunt27.6 |
⊢ 𝐵 = ( 𝑧 ∈ ( 1 ... 𝑀 ) ↦ if ( 𝑧 = 𝑀 , 𝑀 , if ( 𝑧 < 𝐼 , ( 𝑧 + ( 𝑀 − 𝐼 ) ) , ( 𝑧 + ( 1 − 𝐼 ) ) ) ) ) |
7 |
|
metakunt27.7 |
⊢ ( 𝜑 → ¬ 𝑋 = 𝐼 ) |
8 |
|
metakunt27.8 |
⊢ ( 𝜑 → 𝑋 < 𝐼 ) |
9 |
5
|
a1i |
⊢ ( 𝜑 → 𝐴 = ( 𝑥 ∈ ( 1 ... 𝑀 ) ↦ if ( 𝑥 = 𝐼 , 𝑀 , if ( 𝑥 < 𝐼 , 𝑥 , ( 𝑥 − 1 ) ) ) ) ) |
10 |
7
|
adantr |
⊢ ( ( 𝜑 ∧ 𝑥 = 𝑋 ) → ¬ 𝑋 = 𝐼 ) |
11 |
|
simpr |
⊢ ( ( 𝜑 ∧ 𝑥 = 𝑋 ) → 𝑥 = 𝑋 ) |
12 |
11
|
eqeq1d |
⊢ ( ( 𝜑 ∧ 𝑥 = 𝑋 ) → ( 𝑥 = 𝐼 ↔ 𝑋 = 𝐼 ) ) |
13 |
12
|
notbid |
⊢ ( ( 𝜑 ∧ 𝑥 = 𝑋 ) → ( ¬ 𝑥 = 𝐼 ↔ ¬ 𝑋 = 𝐼 ) ) |
14 |
10 13
|
mpbird |
⊢ ( ( 𝜑 ∧ 𝑥 = 𝑋 ) → ¬ 𝑥 = 𝐼 ) |
15 |
14
|
iffalsed |
⊢ ( ( 𝜑 ∧ 𝑥 = 𝑋 ) → if ( 𝑥 = 𝐼 , 𝑀 , if ( 𝑥 < 𝐼 , 𝑥 , ( 𝑥 − 1 ) ) ) = if ( 𝑥 < 𝐼 , 𝑥 , ( 𝑥 − 1 ) ) ) |
16 |
8
|
adantr |
⊢ ( ( 𝜑 ∧ 𝑥 = 𝑋 ) → 𝑋 < 𝐼 ) |
17 |
11
|
breq1d |
⊢ ( ( 𝜑 ∧ 𝑥 = 𝑋 ) → ( 𝑥 < 𝐼 ↔ 𝑋 < 𝐼 ) ) |
18 |
16 17
|
mpbird |
⊢ ( ( 𝜑 ∧ 𝑥 = 𝑋 ) → 𝑥 < 𝐼 ) |
19 |
18
|
iftrued |
⊢ ( ( 𝜑 ∧ 𝑥 = 𝑋 ) → if ( 𝑥 < 𝐼 , 𝑥 , ( 𝑥 − 1 ) ) = 𝑥 ) |
20 |
19 11
|
eqtrd |
⊢ ( ( 𝜑 ∧ 𝑥 = 𝑋 ) → if ( 𝑥 < 𝐼 , 𝑥 , ( 𝑥 − 1 ) ) = 𝑋 ) |
21 |
15 20
|
eqtrd |
⊢ ( ( 𝜑 ∧ 𝑥 = 𝑋 ) → if ( 𝑥 = 𝐼 , 𝑀 , if ( 𝑥 < 𝐼 , 𝑥 , ( 𝑥 − 1 ) ) ) = 𝑋 ) |
22 |
9 21 4 4
|
fvmptd |
⊢ ( 𝜑 → ( 𝐴 ‘ 𝑋 ) = 𝑋 ) |
23 |
22
|
fveq2d |
⊢ ( 𝜑 → ( 𝐵 ‘ ( 𝐴 ‘ 𝑋 ) ) = ( 𝐵 ‘ 𝑋 ) ) |
24 |
6
|
a1i |
⊢ ( 𝜑 → 𝐵 = ( 𝑧 ∈ ( 1 ... 𝑀 ) ↦ if ( 𝑧 = 𝑀 , 𝑀 , if ( 𝑧 < 𝐼 , ( 𝑧 + ( 𝑀 − 𝐼 ) ) , ( 𝑧 + ( 1 − 𝐼 ) ) ) ) ) ) |
25 |
|
elfznn |
⊢ ( 𝑋 ∈ ( 1 ... 𝑀 ) → 𝑋 ∈ ℕ ) |
26 |
4 25
|
syl |
⊢ ( 𝜑 → 𝑋 ∈ ℕ ) |
27 |
26
|
nnred |
⊢ ( 𝜑 → 𝑋 ∈ ℝ ) |
28 |
2
|
nnred |
⊢ ( 𝜑 → 𝐼 ∈ ℝ ) |
29 |
1
|
nnred |
⊢ ( 𝜑 → 𝑀 ∈ ℝ ) |
30 |
27 28 29 8 3
|
ltletrd |
⊢ ( 𝜑 → 𝑋 < 𝑀 ) |
31 |
27 30
|
ltned |
⊢ ( 𝜑 → 𝑋 ≠ 𝑀 ) |
32 |
31
|
neneqd |
⊢ ( 𝜑 → ¬ 𝑋 = 𝑀 ) |
33 |
32
|
adantr |
⊢ ( ( 𝜑 ∧ 𝑧 = 𝑋 ) → ¬ 𝑋 = 𝑀 ) |
34 |
|
simpr |
⊢ ( ( 𝜑 ∧ 𝑧 = 𝑋 ) → 𝑧 = 𝑋 ) |
35 |
34
|
eqeq1d |
⊢ ( ( 𝜑 ∧ 𝑧 = 𝑋 ) → ( 𝑧 = 𝑀 ↔ 𝑋 = 𝑀 ) ) |
36 |
35
|
notbid |
⊢ ( ( 𝜑 ∧ 𝑧 = 𝑋 ) → ( ¬ 𝑧 = 𝑀 ↔ ¬ 𝑋 = 𝑀 ) ) |
37 |
33 36
|
mpbird |
⊢ ( ( 𝜑 ∧ 𝑧 = 𝑋 ) → ¬ 𝑧 = 𝑀 ) |
38 |
37
|
iffalsed |
⊢ ( ( 𝜑 ∧ 𝑧 = 𝑋 ) → if ( 𝑧 = 𝑀 , 𝑀 , if ( 𝑧 < 𝐼 , ( 𝑧 + ( 𝑀 − 𝐼 ) ) , ( 𝑧 + ( 1 − 𝐼 ) ) ) ) = if ( 𝑧 < 𝐼 , ( 𝑧 + ( 𝑀 − 𝐼 ) ) , ( 𝑧 + ( 1 − 𝐼 ) ) ) ) |
39 |
8
|
adantr |
⊢ ( ( 𝜑 ∧ 𝑧 = 𝑋 ) → 𝑋 < 𝐼 ) |
40 |
34
|
breq1d |
⊢ ( ( 𝜑 ∧ 𝑧 = 𝑋 ) → ( 𝑧 < 𝐼 ↔ 𝑋 < 𝐼 ) ) |
41 |
39 40
|
mpbird |
⊢ ( ( 𝜑 ∧ 𝑧 = 𝑋 ) → 𝑧 < 𝐼 ) |
42 |
41
|
iftrued |
⊢ ( ( 𝜑 ∧ 𝑧 = 𝑋 ) → if ( 𝑧 < 𝐼 , ( 𝑧 + ( 𝑀 − 𝐼 ) ) , ( 𝑧 + ( 1 − 𝐼 ) ) ) = ( 𝑧 + ( 𝑀 − 𝐼 ) ) ) |
43 |
34
|
oveq1d |
⊢ ( ( 𝜑 ∧ 𝑧 = 𝑋 ) → ( 𝑧 + ( 𝑀 − 𝐼 ) ) = ( 𝑋 + ( 𝑀 − 𝐼 ) ) ) |
44 |
42 43
|
eqtrd |
⊢ ( ( 𝜑 ∧ 𝑧 = 𝑋 ) → if ( 𝑧 < 𝐼 , ( 𝑧 + ( 𝑀 − 𝐼 ) ) , ( 𝑧 + ( 1 − 𝐼 ) ) ) = ( 𝑋 + ( 𝑀 − 𝐼 ) ) ) |
45 |
38 44
|
eqtrd |
⊢ ( ( 𝜑 ∧ 𝑧 = 𝑋 ) → if ( 𝑧 = 𝑀 , 𝑀 , if ( 𝑧 < 𝐼 , ( 𝑧 + ( 𝑀 − 𝐼 ) ) , ( 𝑧 + ( 1 − 𝐼 ) ) ) ) = ( 𝑋 + ( 𝑀 − 𝐼 ) ) ) |
46 |
4
|
elfzelzd |
⊢ ( 𝜑 → 𝑋 ∈ ℤ ) |
47 |
1
|
nnzd |
⊢ ( 𝜑 → 𝑀 ∈ ℤ ) |
48 |
2
|
nnzd |
⊢ ( 𝜑 → 𝐼 ∈ ℤ ) |
49 |
47 48
|
zsubcld |
⊢ ( 𝜑 → ( 𝑀 − 𝐼 ) ∈ ℤ ) |
50 |
46 49
|
zaddcld |
⊢ ( 𝜑 → ( 𝑋 + ( 𝑀 − 𝐼 ) ) ∈ ℤ ) |
51 |
24 45 4 50
|
fvmptd |
⊢ ( 𝜑 → ( 𝐵 ‘ 𝑋 ) = ( 𝑋 + ( 𝑀 − 𝐼 ) ) ) |
52 |
23 51
|
eqtrd |
⊢ ( 𝜑 → ( 𝐵 ‘ ( 𝐴 ‘ 𝑋 ) ) = ( 𝑋 + ( 𝑀 − 𝐼 ) ) ) |